forked from extern/egroupware
Ported revisions 33494-33496 from trunk to 10.1 (egw.stylite bug 8295)
This commit is contained in:
parent
dbdb0c092e
commit
bfd0871d18
@ -275,7 +275,14 @@ class vfs_widget
|
||||
$extension_data = array('type' => $type,'allowPath' => $allowPath);
|
||||
break;
|
||||
|
||||
case 'vfs-mime':
|
||||
case 'vfs-mime': // size: [thsize] (thumbnail size)
|
||||
//Read the thumbnail size
|
||||
list($thsize) = explode(',', $cell['size']);
|
||||
if (!is_numeric($thsize))
|
||||
{
|
||||
$thsize = NULL;
|
||||
}
|
||||
|
||||
if (!$value)
|
||||
{
|
||||
$cell = etemplate::empty_cell();
|
||||
@ -320,7 +327,16 @@ class vfs_widget
|
||||
{
|
||||
$path = parse_url(egw_vfs::resolve_url_symlinks($path),PHP_URL_PATH);
|
||||
}
|
||||
$value = $GLOBALS['egw']->link('/etemplate/thumbnail.php',array('path' => $path));
|
||||
|
||||
//Assemble the thumbnail parameters
|
||||
$thparams = array('path' => $path);
|
||||
|
||||
if ($thsize)
|
||||
{
|
||||
$thparams['thsize'] = $thsize;
|
||||
}
|
||||
|
||||
$value = $GLOBALS['egw']->link('/etemplate/thumbnail.php', $thparams);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -122,7 +122,7 @@
|
||||
height: 16px;
|
||||
}
|
||||
.vfsFilename {
|
||||
white-space: nowrap;
|
||||
/* white-space: nowrap; << deactivated as images may be scaled strangely */
|
||||
}
|
||||
/**
|
||||
* mark a file (icon) as link
|
||||
@ -152,4 +152,4 @@
|
||||
max-height: 6.75em;
|
||||
overflow: auto;
|
||||
padding-right: 15px;
|
||||
}
|
||||
}
|
||||
|
@ -5,23 +5,15 @@
|
||||
* @link http://www.egroupware.org
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @author Nathan Gray
|
||||
* @author Andreas Stöckel
|
||||
* @package etemplate
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
if (isset($_GET['app']))
|
||||
{
|
||||
$app = $_GET['app'];
|
||||
}
|
||||
elseif(isset($_GET['path']))
|
||||
{
|
||||
list(,$apps,$app) = explode('/',$_GET['path']);
|
||||
if ($apps !== 'apps') $app = 'filemanager';
|
||||
}
|
||||
if (!preg_match('/^[a-z0-9_-]+$/i',$app)) die('Stop'); // just to prevent someone doing nasty things
|
||||
|
||||
//Set all necessary info and fire up egroupware
|
||||
$GLOBALS['egw_info']['flags'] = array(
|
||||
'currentapp' => $app,
|
||||
'currentapp' => get_app(),
|
||||
'noheader' => true,
|
||||
'nonavbar' => true
|
||||
);
|
||||
@ -36,125 +28,300 @@ if (get_magic_quotes_gpc() && $_GET)
|
||||
// no need to keep the session open (it stops other parallel calls)
|
||||
$GLOBALS['egw']->session->commit_session();
|
||||
|
||||
if (isset($_GET['path']))
|
||||
if (!read_thumbnail(get_srcfile()))
|
||||
{
|
||||
$g_srcfile = $_GET['path'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$g_srcfile = egw_link::vfs_path($_GET['app'],$_GET['id'],$_GET['file'],true);
|
||||
}
|
||||
$g_dstfile = $GLOBALS['egw_info']['server']['temp_dir'] . '/egw-thumbs'.$g_srcfile;
|
||||
$g_srcfile = egw_vfs::PREFIX.$g_srcfile;
|
||||
|
||||
if (!file_exists($g_srcfile) || !egw_vfs::is_readable($g_srcfile))
|
||||
{
|
||||
//error_log("file_exists('$g_srcfile')=".(int)file_exists($g_srcfile).", egw_vfs::is_readable('$g_srcfile')=".(int)egw_vfs::is_readable($g_srcfile));
|
||||
header('404 Not found');
|
||||
exit;
|
||||
}
|
||||
|
||||
// Check for existing thumbnail
|
||||
if(file_exists($g_dstfile) && filemtime($g_dstfile) >= filemtime($g_srcfile)) {
|
||||
header('Content-Type: image/png');
|
||||
readfile($g_dstfile);
|
||||
return;
|
||||
}
|
||||
|
||||
$thumbnail = get_thumbnail($file, true);
|
||||
|
||||
if($thumbnail) {
|
||||
header('Content-Type: image/png');
|
||||
imagepng( $thumbnail );
|
||||
imagedestroy($thumbnail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Private function to get a thumbnail image for a linked image file.
|
||||
*
|
||||
* This function creates a thumbnail of the given image, if possible, and stores it in $GLOBALS['egw_info']['server']['temp_dir'].
|
||||
* Returns the image, or false if the file could not be thumbnailed. Thumbnails are PNGs.
|
||||
*
|
||||
* @param array $file VFS File array to thumbnail
|
||||
* @return image or false
|
||||
*
|
||||
* @author Nathan Gray
|
||||
*/
|
||||
function get_thumbnail($file, $return_data = true)
|
||||
* Reads the source file from the path parameters
|
||||
*/
|
||||
function get_srcfile()
|
||||
{
|
||||
global $g_srcfile,$g_dstfile;
|
||||
if (isset($_GET['path']))
|
||||
{
|
||||
$g_srcfile = $_GET['path'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$g_srcfile = egw_link::vfs_path($_GET['app'], $_GET['id'], $_GET['file'], true);
|
||||
}
|
||||
|
||||
$max_width = $max_height = (string)$GLOBALS['egw_info']['server']['link_list_thumbnail'] == '' ? 32 :
|
||||
return egw_vfs::PREFIX.$g_srcfile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently active app.
|
||||
*/
|
||||
function get_app()
|
||||
{
|
||||
if (isset($_GET['app']))
|
||||
{
|
||||
$app = $_GET['app'];
|
||||
}
|
||||
elseif (isset($_GET['path']))
|
||||
{
|
||||
list(, $apps, $app) = explode('/', $_GET['path']);
|
||||
if ($apps !== 'apps')
|
||||
{
|
||||
$app = 'filemanager';
|
||||
}
|
||||
}
|
||||
|
||||
if (!preg_match('/^[a-z0-9_-]+$/i',$app))
|
||||
{
|
||||
die('Stop'); // just to prevent someone doing nasty things
|
||||
}
|
||||
|
||||
return $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum width/height of a thumbnail
|
||||
*/
|
||||
function get_maxsize()
|
||||
{
|
||||
$preset = (string)$GLOBALS['egw_info']['server']['link_list_thumbnail'] == '' ? 32 :
|
||||
$GLOBALS['egw_info']['server']['link_list_thumbnail'];
|
||||
|
||||
//error_log(__METHOD__."() src=$g_srcfile, dst=$g_dstfile, size=$max_width");
|
||||
// Another maximum size may be passed if thumbnails are turned on
|
||||
if ($preset != 0 && isset($_GET['thsize']) && is_numeric($_GET['thsize']))
|
||||
{
|
||||
$preset = (int)$_GET['thsize'];
|
||||
}
|
||||
|
||||
if($max_width == 0) {
|
||||
// thumbnailing disabled
|
||||
return false;
|
||||
} elseif( !gdVersion() ) {
|
||||
// GD disabled or not installed
|
||||
return $preset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Either loads the thumbnail for the given file form cache or generates a new
|
||||
* one
|
||||
*
|
||||
* @param string $file is the file of which a thumbnail should be created
|
||||
* @returns false if the file doesn't exist or any other error occured.
|
||||
*/
|
||||
function read_thumbnail($src)
|
||||
{
|
||||
//Check whether the source file is readable and exists
|
||||
if (!file_exists($src) || !egw_vfs::is_readable($src))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Quality
|
||||
$g_imgcomp=55;
|
||||
// Get the maxsize of an thumbnail. If thumbnailing is turned off, the value
|
||||
// will be 0
|
||||
$maxsize = get_maxsize();
|
||||
|
||||
$dst_dir = dirname($g_dstfile);
|
||||
// files dont exist, if you have no access permission
|
||||
if((file_exists($dst_dir) || mkdir($dst_dir, 0700, true)) && file_exists($g_srcfile)) {
|
||||
$g_is=getimagesize($g_srcfile);
|
||||
if($g_is[0] < $max_width && $g_is[1] < $max_height) {
|
||||
$g_iw = $g_is[0];
|
||||
$g_ih = $g_is[1];
|
||||
} elseif(($g_is[0]-$max_width)>=($g_is[1]-$max_height)) {
|
||||
$g_iw=$max_width;
|
||||
$g_ih=($max_width/$g_is[0])*$g_is[1];
|
||||
} else {
|
||||
$g_ih=$max_height;
|
||||
$g_iw=($g_ih/$g_is[1])*$g_is[0];
|
||||
// Check whether the destination directory exists, if not, create it. If this
|
||||
// process failes, dont' return an image.
|
||||
$dst = gen_dstfile($src, $maxsize);
|
||||
$dst_dir = dirname($dst);
|
||||
if(file_exists($dst_dir) || mkdir($dst_dir, 0700, true))
|
||||
{
|
||||
// Check whether the destination file already exists and is newer than
|
||||
// the source file. Assume the file doesn't exist if thumbnailing is turned off.
|
||||
$exists = ($maxsize > 0) && (file_exists($dst) && filemtime($dst) >= filemtime($src));
|
||||
|
||||
// Only generate the thumbnail if the destination file does not match the
|
||||
// conditions mentioned above. Abort if $maxsize is 0.
|
||||
$gen_thumb = ($maxsize > 0) && (!$exists);
|
||||
if ($gen_thumb && ($thumb = gd_image_thumbnail($src, $maxsize, $maxsize)))
|
||||
{
|
||||
// Save the file to disk...
|
||||
imagepng($thumb, $dst);
|
||||
|
||||
// Previous versions generated a new copy of the png to output it -
|
||||
// as encoding pngs is quite cpu-intensive I think it might
|
||||
// be better to just read it from the temp dir again - as it is probably
|
||||
// still in the fs-cache
|
||||
$exists = true;
|
||||
|
||||
imagedestroy($thumb);
|
||||
}
|
||||
|
||||
// Get mime type
|
||||
list($type, $image_type) = explode('/',egw_vfs::mime_content_type($g_srcfile));
|
||||
if($type != 'image') {
|
||||
return false;
|
||||
$output_mime = 'image/png';
|
||||
|
||||
// If some error occured during thumbnail generation or thumbnailing is turned off,
|
||||
// simply output the mime type icon
|
||||
if (!$exists)
|
||||
{
|
||||
$mime = egw_vfs::mime_content_type($src);
|
||||
list($app, $icon) = explode('/', egw_vfs::mime_icon($mime), 2);
|
||||
list(, $path) = explode($GLOBALS['egw_info']['server']['webserver_url'],
|
||||
$GLOBALS['egw']->common->image($app, $icon), 2);
|
||||
$dst = EGW_SERVER_ROOT.$path;
|
||||
$output_mime = mime_content_type($dst);
|
||||
}
|
||||
|
||||
switch ($image_type) {
|
||||
if ($dst)
|
||||
{
|
||||
header('Content-Type: '.$output_mime);
|
||||
readfile($dst);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function gen_dstfile($src, $maxsize)
|
||||
{
|
||||
// Previous versions of this code didn't use an md5-sum of $src but appended
|
||||
// it directly - this might have been an security issue as thumbnails from
|
||||
// multiple instances might get mixed up.
|
||||
return $GLOBALS['egw_info']['server']['temp_dir'] . '/egw-thumbs/thumb_' .
|
||||
md5($src . $GLOBALS['egw_info']['server']['webserver_url'] . $maxsize).'.png';
|
||||
}
|
||||
|
||||
/**
|
||||
* Function which calculates the sizes of an image with the width w and the height
|
||||
* h, which should be scaled to an thumbnail of the maximum dimensions maxw and
|
||||
* maxh
|
||||
*
|
||||
* @param int $w original width of the image
|
||||
* @param int $h original height of the image
|
||||
* @param int $maxw maximum width of the image
|
||||
* @param int $maxh maximum height of the image
|
||||
* @returns an array with two elements, w, h or "false" if the original dimensions
|
||||
* of the image are that "odd", that one of the output sizes is smaller than one pixel.
|
||||
*
|
||||
* TODO: As this is a general purpose function, it might probably be moved
|
||||
* to some other php file or an "image utils" class.
|
||||
*/
|
||||
function get_scaled_image_size($w, $h, $maxw, $maxh)
|
||||
{
|
||||
//Set the output width to zero
|
||||
$wout = 0.0;
|
||||
$hout = 0.0;
|
||||
|
||||
//Scale will contain the factor by which the image has to be scaled down
|
||||
$scale = 1.0;
|
||||
|
||||
//Select the constraining dimension
|
||||
if ($w > $h) //The constraining factor will be $maxw
|
||||
{
|
||||
$scale = $maxw / $w;
|
||||
}
|
||||
else //The constraning factor will be $maxh
|
||||
{
|
||||
$scale = $maxh / $h;
|
||||
}
|
||||
|
||||
// Don't scale images up
|
||||
if ($scale > 1.0)
|
||||
{
|
||||
$scale = 1.0;
|
||||
}
|
||||
|
||||
$wout = $w * $scale;
|
||||
$hout = $h * $scale;
|
||||
|
||||
//Return the calculated values
|
||||
if ($wout < 1 || $hout < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array(round($wout), round($hout));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given imagefile - returns "false" if the file wasn't an image,
|
||||
* otherwise the gd-image is returned.
|
||||
*
|
||||
* @param string $file the file which to load
|
||||
* @returns false or a gd_image
|
||||
*/
|
||||
function gd_image_load($file)
|
||||
{
|
||||
// Get mime type
|
||||
list($type, $image_type) = explode('/', egw_vfs::mime_content_type($file));
|
||||
|
||||
// Call the according gd constructor depending on the file type
|
||||
if($type == 'image')
|
||||
{
|
||||
switch ($image_type)
|
||||
{
|
||||
case 'png':
|
||||
$img_src = imagecreatefrompng($g_srcfile);
|
||||
break;
|
||||
return imagecreatefrompng($file);
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$img_src = imagecreatefromjpeg($g_srcfile);
|
||||
break;
|
||||
return imagecreatefromjpeg($file);
|
||||
case 'gif':
|
||||
$img_src = imagecreatefromgif($g_srcfile);
|
||||
break;
|
||||
return imagecreatefromgif($file);
|
||||
case 'bmp':
|
||||
$img_src = imagecreatefromwbmp($g_srcfile);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
if(!($gdVersion = gdVersion())) {
|
||||
return false;
|
||||
} elseif ($gdVersion >= 2) {
|
||||
$img_dst=imagecreatetruecolor($g_iw,$g_ih);
|
||||
imageSaveAlpha($img_dst, true);
|
||||
$trans_color = imagecolorallocatealpha($img_dst, 0, 0, 0, 127);
|
||||
imagefill($img_dst, 0, 0, $trans_color);
|
||||
} else {
|
||||
$img_dst = imagecreate($g_iw, $g_ih);
|
||||
return imagecreatefromwbmp($file);
|
||||
}
|
||||
}
|
||||
|
||||
imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $g_iw, $g_ih, $g_is[0], $g_is[1]);
|
||||
imagepng($img_dst, $g_dstfile);
|
||||
return $return_data ? $img_dst : $g_dstfile;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an gd_image with transparent background.
|
||||
*
|
||||
* @param int $w the width of the resulting image
|
||||
* @param int $h the height of the resutling image
|
||||
*/
|
||||
function gd_create_transparent_image($w, $h)
|
||||
{
|
||||
if (!($gdVersion = gdVersion()))
|
||||
{
|
||||
//Looking up the gd version failed, return false
|
||||
return false;
|
||||
}
|
||||
elseif ($gdVersion >= 2)
|
||||
{
|
||||
//Create an 32-bit image and fill it with transparency.
|
||||
$img_dst = imagecreatetruecolor($w, $h);
|
||||
imageSaveAlpha($img_dst, true);
|
||||
$trans_color = imagecolorallocatealpha($img_dst, 0, 0, 0, 127);
|
||||
imagefill($img_dst, 0, 0, $trans_color);
|
||||
|
||||
return $img_dst;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Just crate a simple image
|
||||
return imagecreate($w, $h);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a scaled version of the given image - returns the gd-image or false if the
|
||||
* process failed.
|
||||
*
|
||||
* @param string $file the filename of the file
|
||||
* @param int $maxw the maximum width of the thumbnail
|
||||
* @param int $maxh the maximum height of the thumbnail
|
||||
* @return the gd_image or false if one of the steps taken to produce the thumbnail
|
||||
* failed.
|
||||
*/
|
||||
function gd_image_thumbnail($file, $maxw, $maxh)
|
||||
{
|
||||
//Load the image
|
||||
if (($img_src = gd_image_load($file)) !== false)
|
||||
{
|
||||
//Get the constraints of the image
|
||||
$w = imagesx($img_src);
|
||||
$h = imagesy($img_src);
|
||||
|
||||
//Calculate the actual size of the thumbnail
|
||||
$scaled = get_scaled_image_size($w, $h, $maxw, $maxh);
|
||||
if ($scaled !== false)
|
||||
{
|
||||
list($sw, $sh) = $scaled;
|
||||
|
||||
//Now scale it down
|
||||
$img_dst = gd_create_transparent_image($sw, $sh);
|
||||
imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $sw, $sh, $w, $h);
|
||||
return $img_dst;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -221,6 +221,7 @@ class filemanager_select
|
||||
$content['path'] = filemanager_ui::get_home_dir();
|
||||
}
|
||||
if (!($files = egw_vfs::find($content['path'],array(
|
||||
'dirsontop' => true,
|
||||
'order' => 'name',
|
||||
'sort' => 'ASC',
|
||||
'maxdepth' => 1,
|
||||
|
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* eGroupWare - eTemplates for Application filemanager
|
||||
* http://www.egroupware.org
|
||||
* generated by soetemplate::dump4setup() 2010-09-16 14:31
|
||||
* generated by soetemplate::dump4setup() 2010-12-31 15:27
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @package filemanager
|
||||
@ -43,5 +43,5 @@ $templ_data[] = array('name' => 'filemanager.search','template' => '','lang' =>
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.search.rows','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:3:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";s:1:"A";s:2:"20";}i:1;a:12:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Type";s:4:"name";s:13:"vfs_mime_type";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:2:"Id";s:4:"name";s:11:"vfs_file_id";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"File";s:4:"name";s:7:"fulldir";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:9:"Directory";s:4:"name";s:13:"vfs_directory";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"name";s:4:"name";s:8:"vfs_name";}s:1:"F";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:9:"mime type";s:4:"name";s:9:"mime_type";}s:1:"G";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Size";s:4:"name";s:8:"vfs_size";}s:1:"H";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"comment";s:4:"name";s:11:"vfs_comment";}s:1:"I";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"created";s:4:"name";s:11:"vfs_created";}s:1:"J";a:3:{s:4:"type";s:23:"nextmatch-accountfilter";s:4:"size";s:10:"Created by";s:4:"name";s:16:"vfs_createdby_id";}s:1:"K";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"modified";s:4:"name";s:12:"vfs_modified";}s:1:"L";a:3:{s:4:"type";s:23:"nextmatch-accountfilter";s:4:"size";s:11:"Modified by";s:4:"name";s:17:"vfs_modifiedby_id";}}i:2;a:12:{s:1:"A";a:4:{s:4:"type";s:5:"image";s:5:"label";s:24:"$row_cont[vfs_mime_type]";s:4:"name";s:12:"${row}[icon]";s:5:"align";s:6:"center";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[vfs_file_id]";s:7:"no_lang";s:1:"1";}s:1:"C";a:4:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[file]";s:7:"no_lang";s:1:"1";s:4:"size";s:21:",$row_cont[file_link]";}s:1:"D";a:4:{s:4:"type";s:5:"label";s:4:"name";s:21:"${row}[vfs_directory]";s:7:"no_lang";s:1:"1";s:4:"size";s:20:",$row_cont[dir_link]";}s:1:"E";a:4:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[vfs_name]";s:7:"no_lang";s:1:"1";s:4:"size";s:21:",$row_cont[file_link]";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:4:"name";s:21:"${row}[vfs_mime_type]";}s:1:"G";a:3:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[vfs_size]";s:5:"align";s:5:"right";}s:1:"H";a:3:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[vfs_comment]";s:7:"no_lang";s:1:"1";}s:1:"I";a:4:{s:4:"type";s:9:"date-time";s:4:"name";s:19:"${row}[vfs_created]";s:4:"size";s:11:"Y-m-d H:i:s";s:8:"readonly";s:1:"1";}s:1:"J";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:24:"${row}[vfs_createdby_id]";s:8:"readonly";s:1:"1";}s:1:"K";a:4:{s:4:"type";s:9:"date-time";s:4:"name";s:20:"${row}[vfs_modified]";s:4:"size";s:11:"Y-m-d H:i:s";s:8:"readonly";s:1:"1";}s:1:"L";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:25:"${row}[vfs_modifiedby_id]";s:8:"readonly";s:1:"1";}}}s:4:"rows";i:2;s:4:"cols";i:12;s:4:"size";s:9:"100%,auto";s:7:"options";a:2:{i:0;s:4:"100%";i:1;s:4:"auto";}}}','size' => '100%,auto','style' => '','modified' => '1173104345',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.select','template' => '','lang' => '','group' => '0','version' => '1.7.003','data' => 'a:2:{i:0;a:4:{s:4:"type";s:5:"label";s:4:"name";s:3:"msg";s:4:"span";s:6:",error";s:5:"align";s:6:"center";}i:1;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:2:{s:2:"c1";s:4:",top";s:1:"A";s:2:"32";}i:1;a:2:{s:1:"A";a:7:{s:4:"type";s:4:"grid";s:5:"align";s:6:"center";s:4:"data";a:3:{i:0;a:2:{s:2:"h2";s:2:"40";s:2:"h1";s:4:",!@0";}i:1;a:1:{s:1:"A";a:5:{s:4:"type";s:6:"button";s:4:"size";s:9:"favorites";s:5:"label";s:9:"Favorites";s:5:"align";s:6:"center";s:4:"name";s:9:"favorites";}}i:2;a:1:{s:1:"A";a:5:{s:4:"type";s:6:"button";s:4:"size";s:16:"$row_cont/navbar";s:5:"label";s:9:"$row_cont";s:5:"align";s:6:"center";s:4:"name";s:6:"${row}";}}}s:4:"rows";i:2;s:4:"cols";i:1;s:4:"name";s:4:"apps";s:7:"options";a:0:{}}s:1:"B";a:6:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:4:{s:2:"c2";s:11:"selectFiles";s:2:"h3";s:35:",@mode=/(open-multiple|select-dir)/";s:2:"h4";s:15:",!@options-mime";s:2:"h5";s:11:",@no_upload";}i:1;a:1:{s:1:"A";a:7:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"5";i:1;a:2:{s:4:"type";s:4:"html";s:4:"name";s:2:"js";}i:2;a:4:{s:4:"type";s:6:"button";s:4:"name";s:10:"button[up]";s:4:"size";s:4:"goup";s:5:"label";s:2:"Up";}i:3;a:4:{s:4:"type";s:6:"button";s:4:"name";s:12:"button[home]";s:4:"size";s:6:"gohome";s:5:"label";s:25:"Go to your home directory";}i:4;a:4:{s:4:"type";s:3:"box";s:4:"size";s:1:"1";i:1;a:4:{s:4:"type";s:3:"vfs";s:4:"name";s:4:"path";s:7:"onclick";s:87:"path=document.getElementById(form::name(\'path\')); path.value=$path; path.form.submit();";s:4:"span";s:11:",selectPath";}s:4:"span";s:20:",selectPathContainer";}i:5;a:3:{s:4:"type";s:4:"text";s:4:"name";s:4:"path";s:4:"span";s:12:",displayNone";}}}i:2;a:1:{s:1:"A";a:7:{s:4:"type";s:4:"grid";s:4:"size";s:17:"100%,400,,,,,auto";s:4:"name";s:3:"dir";s:4:"data";a:2:{i:0;a:3:{s:2:"c1";s:3:"row";s:1:"A";s:2:"20";s:1:"C";s:23:"1%,!@mode=open-multiple";}i:1;a:3:{s:1:"A";a:4:{s:4:"type";s:8:"vfs-mime";s:4:"name";s:12:"${row}[path]";s:4:"span";s:11:",selectIcon";s:5:"align";s:6:"center";}s:1:"B";a:3:{s:4:"type";s:3:"vfs";s:4:"name";s:4:"$row";s:7:"onclick";s:18:"$row_cont[onclick]";}s:1:"C";a:4:{s:4:"type";s:8:"checkbox";s:4:"size";s:17:""$row_cont[name]"";s:4:"name";s:10:"selected[]";s:5:"align";s:5:"right";}}}s:4:"rows";i:1;s:4:"cols";i:3;s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"400";i:6;s:4:"auto";}}}i:3;a:1:{s:1:"A";a:3:{s:4:"type";s:4:"text";s:4:"name";s:4:"name";s:4:"span";s:11:",selectName";}}i:4;a:1:{s:1:"A";a:5:{s:4:"type";s:6:"select";s:4:"size";s:9:"All files";s:4:"name";s:4:"mime";s:4:"span";s:11:",selectMime";s:8:"onchange";i:1;}}i:5;a:1:{s:1:"A";a:6:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"2";s:5:"label";s:11:"File upload";s:4:"name";s:15:"upload_groupbox";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:27:"Choose a file for uploading";}i:2;a:2:{s:4:"type";s:4:"file";s:4:"name";s:11:"file_upload";}}}i:6;a:1:{s:1:"A";a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"@label";s:4:"name";s:10:"button[ok]";}i:2;a:4:{s:4:"type";s:10:"buttononly";s:4:"name";s:14:"button[cancel]";s:5:"label";s:6:"Cancel";s:7:"onclick";s:15:"window.close();";}s:5:"align";s:5:"right";}}}s:4:"rows";i:6;s:4:"cols";i:1;s:7:"options";a:1:{i:0;s:4:"100%";}s:4:"size";s:4:"100%";}}}s:4:"rows";i:1;s:4:"cols";i:2;s:4:"size";s:3:"600";s:7:"options";a:1:{i:0;s:3:"600";}}}','size' => '600','style' => '.error{color:red; font-style:italic;}','modified' => '1274435121',);
|
||||
$templ_data[] = array('name' => 'filemanager.select','template' => '','lang' => '','group' => '0','version' => '1.7.004','data' => 'a:2:{i:0;a:4:{s:4:"type";s:5:"label";s:4:"name";s:3:"msg";s:4:"span";s:6:",error";s:5:"align";s:6:"center";}i:1;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:2:{s:2:"c1";s:4:",top";s:1:"A";s:2:"32";}i:1;a:2:{s:1:"A";a:7:{s:4:"type";s:4:"grid";s:5:"align";s:6:"center";s:4:"data";a:3:{i:0;a:2:{s:2:"h2";s:2:"40";s:2:"h1";s:4:",!@0";}i:1;a:1:{s:1:"A";a:5:{s:4:"type";s:6:"button";s:4:"size";s:9:"favorites";s:5:"label";s:9:"Favorites";s:5:"align";s:6:"center";s:4:"name";s:9:"favorites";}}i:2;a:1:{s:1:"A";a:5:{s:4:"type";s:6:"button";s:4:"size";s:16:"$row_cont/navbar";s:5:"label";s:9:"$row_cont";s:5:"align";s:6:"center";s:4:"name";s:6:"${row}";}}}s:4:"rows";i:2;s:4:"cols";i:1;s:4:"name";s:4:"apps";s:7:"options";a:0:{}}s:1:"B";a:6:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:4:{s:2:"c2";s:11:"selectFiles";s:2:"h3";s:35:",@mode=/(open-multiple|select-dir)/";s:2:"h4";s:15:",!@options-mime";s:2:"h5";s:11:",@no_upload";}i:1;a:1:{s:1:"A";a:7:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"5";i:1;a:2:{s:4:"type";s:4:"html";s:4:"name";s:2:"js";}i:2;a:4:{s:4:"type";s:6:"button";s:4:"name";s:10:"button[up]";s:4:"size";s:4:"goup";s:5:"label";s:2:"Up";}i:3;a:4:{s:4:"type";s:6:"button";s:4:"name";s:12:"button[home]";s:4:"size";s:6:"gohome";s:5:"label";s:25:"Go to your home directory";}i:4;a:4:{s:4:"type";s:3:"box";s:4:"size";s:1:"1";i:1;a:4:{s:4:"type";s:3:"vfs";s:4:"name";s:4:"path";s:7:"onclick";s:87:"path=document.getElementById(form::name(\'path\')); path.value=$path; path.form.submit();";s:4:"span";s:11:",selectPath";}s:4:"span";s:20:",selectPathContainer";}i:5;a:3:{s:4:"type";s:4:"text";s:4:"name";s:4:"path";s:4:"span";s:12:",displayNone";}}}i:2;a:1:{s:1:"A";a:7:{s:4:"type";s:4:"grid";s:4:"size";s:17:"100%,400,,,,,auto";s:4:"name";s:3:"dir";s:4:"data";a:2:{i:0;a:3:{s:2:"c1";s:3:"row";s:1:"A";s:2:"20";s:1:"C";s:23:"1%,!@mode=open-multiple";}i:1;a:3:{s:1:"A";a:5:{s:4:"type";s:8:"vfs-mime";s:4:"name";s:12:"${row}[path]";s:4:"span";s:11:",selectIcon";s:5:"align";s:6:"center";s:4:"size";s:2:"16";}s:1:"B";a:3:{s:4:"type";s:3:"vfs";s:4:"name";s:4:"$row";s:7:"onclick";s:18:"$row_cont[onclick]";}s:1:"C";a:4:{s:4:"type";s:8:"checkbox";s:4:"size";s:17:""$row_cont[name]"";s:4:"name";s:10:"selected[]";s:5:"align";s:5:"right";}}}s:4:"rows";i:1;s:4:"cols";i:3;s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"400";i:6;s:4:"auto";}}}i:3;a:1:{s:1:"A";a:3:{s:4:"type";s:4:"text";s:4:"name";s:4:"name";s:4:"span";s:11:",selectName";}}i:4;a:1:{s:1:"A";a:5:{s:4:"type";s:6:"select";s:4:"size";s:9:"All files";s:4:"name";s:4:"mime";s:4:"span";s:11:",selectMime";s:8:"onchange";i:1;}}i:5;a:1:{s:1:"A";a:6:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"2";s:5:"label";s:11:"File upload";s:4:"name";s:15:"upload_groupbox";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:27:"Choose a file for uploading";}i:2;a:2:{s:4:"type";s:4:"file";s:4:"name";s:11:"file_upload";}}}i:6;a:1:{s:1:"A";a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"@label";s:4:"name";s:10:"button[ok]";}i:2;a:4:{s:4:"type";s:10:"buttononly";s:4:"name";s:14:"button[cancel]";s:5:"label";s:6:"Cancel";s:7:"onclick";s:15:"window.close();";}s:5:"align";s:5:"right";}}}s:4:"rows";i:6;s:4:"cols";i:1;s:7:"options";a:1:{i:0;s:4:"100%";}s:4:"size";s:4:"100%";}}}s:4:"rows";i:1;s:4:"cols";i:2;s:4:"size";s:3:"600";s:7:"options";a:1:{i:0;s:3:"600";}}}','size' => '600','style' => '.error{color:red; font-style:italic;}','modified' => '1293805622',);
|
||||
|
||||
|
@ -19,6 +19,6 @@
|
||||
.selectPathContainer { width: 480px; overflow: auto; }
|
||||
.selectName input { width: 100%; }
|
||||
.selectMime select { width: 100%; }
|
||||
.selectIcon img { height: 16px; }
|
||||
/*.selectIcon img { height: 16px; }*/
|
||||
.displayNone input { display: none; }
|
||||
.selectFiles td div { border-style: groove; }
|
||||
.selectFiles td div { border-style: groove; }
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- $Id$ -->
|
||||
<overlay>
|
||||
<template id="filemanager.select" template="" lang="" group="0" version="1.7.002">
|
||||
<template id="filemanager.select" template="" lang="" group="0" version="1.7.004">
|
||||
<description id="msg" class="error" align="center"/>
|
||||
<grid width="600">
|
||||
<columns>
|
||||
<column width="32"/>
|
||||
@ -47,7 +48,7 @@
|
||||
</columns>
|
||||
<rows>
|
||||
<row class="row">
|
||||
<vfs-mime id="${row}[path]" class="selectIcon" align="center"/>
|
||||
<vfs-mime id="${row}[path]" class="selectIcon" align="center" options="16"/>
|
||||
<vfs id="$row" onclick="$row_cont[onclick]"/>
|
||||
<checkbox options=""$row_cont[name]"" id="selected[]" align="right"/>
|
||||
</row>
|
||||
@ -55,13 +56,20 @@
|
||||
</grid>
|
||||
</row>
|
||||
<row disabled="@mode=/(open-multiple|select-dir)/">
|
||||
<textbox id="name" class="selectName" needed="1"/>
|
||||
<textbox id="name" class="selectName"/>
|
||||
</row>
|
||||
<row disabled="!@options-mime">
|
||||
<menulist class="selectMime">
|
||||
<menupopup options="All files" id="mime" onchange="1"/>
|
||||
</menulist>
|
||||
</row>
|
||||
<row disabled="@no_upload">
|
||||
<groupbox id="upload_groupbox">
|
||||
<caption label="File upload"/>
|
||||
<description value="Choose a file for uploading"/>
|
||||
<file id="file_upload"/>
|
||||
</groupbox>
|
||||
</row>
|
||||
<row>
|
||||
<hbox align="right">
|
||||
<button label="@label" id="button[ok]"/>
|
||||
@ -73,5 +81,8 @@
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<styles>
|
||||
.error{color:red; font-style:italic;}
|
||||
</styles>
|
||||
</template>
|
||||
</overlay>
|
Loading…
Reference in New Issue
Block a user