mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:42 +01:00
use new api in filemanager
This commit is contained in:
parent
0eeb8b56c0
commit
1587c977b8
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/php -qC
|
||||
<?php
|
||||
/**
|
||||
* Filemanager - Command line interface
|
||||
* EGroupware Filemanager - Command line interface
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @package filemanager
|
||||
@ -13,6 +13,9 @@
|
||||
* @todo --domain does NOT work with --user root_* for domains other then the first in header.inc.php
|
||||
*/
|
||||
|
||||
use EGroupware\Api;
|
||||
use EGroupware\Api\Vfs;
|
||||
|
||||
chdir(dirname(__FILE__)); // to enable our relative pathes to work
|
||||
|
||||
error_reporting(error_reporting() & ~E_NOTICE & ~E_DEPRECATED);
|
||||
@ -190,16 +193,16 @@ switch($cmd)
|
||||
usage('Wrong number of parameters!');
|
||||
}
|
||||
if (($url = $argv[0])) load_wrapper($url);
|
||||
if(!egw_vfs::$is_root)
|
||||
if(!Vfs::$is_root)
|
||||
{
|
||||
die("You need to be root to do that!\n");
|
||||
}
|
||||
if ($all)
|
||||
{
|
||||
config::save_value('vfs_fstab',$GLOBALS['egw_info']['server']['vfs_fstab']='','phpgwapi');
|
||||
Api\Config::save_value('vfs_fstab',$GLOBALS['egw_info']['server']['vfs_fstab']='','phpgwapi');
|
||||
echo "Restored default mounts:\n";
|
||||
}
|
||||
elseif (!egw_vfs::umount($url))
|
||||
elseif (!Vfs::umount($url))
|
||||
{
|
||||
die("$url is NOT mounted!\n");
|
||||
}
|
||||
@ -215,11 +218,11 @@ switch($cmd)
|
||||
}
|
||||
load_wrapper($url=$argv[0]);
|
||||
|
||||
if($argc > 1 && !egw_vfs::$is_root)
|
||||
if($argc > 1 && !Vfs::$is_root)
|
||||
{
|
||||
die("You need to be root to do that!\n");
|
||||
}
|
||||
$fstab = egw_vfs::mount($url,$path=$argv[1]);
|
||||
$fstab = Vfs::mount($url,$path=$argv[1]);
|
||||
if (is_array($fstab))
|
||||
{
|
||||
foreach($fstab as $path => $url)
|
||||
@ -261,12 +264,12 @@ switch($cmd)
|
||||
break;
|
||||
|
||||
case 'migrate-db2fs':
|
||||
if (empty($user) || empty($passwd) || !egw_vfs::$is_root)
|
||||
if (empty($user) || empty($passwd) || !Vfs::$is_root)
|
||||
{
|
||||
die("\nYou need to be root to do that!\n\n");
|
||||
}
|
||||
if (!is_writable($GLOBALS['egw_info']['server']['files_dir'])) exit; // we need write access, error msg already given
|
||||
$fstab = egw_vfs::mount();
|
||||
$fstab = Vfs::mount();
|
||||
if (!is_array($fstab) || !isset($fstab['/']) || strpos($fstab['/'],'storage=db') === false)
|
||||
{
|
||||
foreach($fstab as $path => $url)
|
||||
@ -275,11 +278,11 @@ switch($cmd)
|
||||
}
|
||||
die("\n/ NOT mounted with 'storage=db' --> no need to convert!\n\n");
|
||||
}
|
||||
$num_files = sqlfs_utils::migrate_db2fs(); // throws exception on error
|
||||
$num_files = Vfs\Sqlfs\Utils::migrate_db2fs(); // throws exception on error
|
||||
echo "\n$num_files files migrated from DB to filesystem.\n";
|
||||
$new_url = preg_replace('/storage=db&?/','',$fstab['/']);
|
||||
if (substr($new_url,-1) == '?') $new_url = substr($new_url,0,-1);
|
||||
if (egw_vfs::mount($new_url,'/'))
|
||||
if (Vfs::mount($new_url,'/'))
|
||||
{
|
||||
echo "/ successful re-mounted on $new_url\n";
|
||||
}
|
||||
@ -307,7 +310,7 @@ switch($cmd)
|
||||
die("rm -r only implemented for eGW streams!"); // dont want to repeat the code here
|
||||
}
|
||||
array_unshift($argv,$url);
|
||||
egw_vfs::remove($argv,true);
|
||||
Vfs::remove($argv,true);
|
||||
$argv = array();
|
||||
}
|
||||
else
|
||||
@ -339,7 +342,7 @@ switch($cmd)
|
||||
$mode = $url; // first param is mode
|
||||
$url = array_shift($argv);
|
||||
}
|
||||
if (egw_vfs::parse_url($url,PHP_URL_SCHEME)) load_wrapper($url); // cant use stat or egw_vfs::mode2int otherwise!
|
||||
if (Vfs::parse_url($url,PHP_URL_SCHEME)) load_wrapper($url); // cant use stat or Vfs::mode2int otherwise!
|
||||
|
||||
if (strpos($mode,'+') !== false || strpos($mode,'-') !== false)
|
||||
{
|
||||
@ -354,7 +357,7 @@ switch($cmd)
|
||||
{
|
||||
die("chmod only implemented for eGW streams!"); // dont want to repeat the code here
|
||||
}
|
||||
$set = egw_vfs::mode2int($mode,$set);
|
||||
$set = Vfs::mode2int($mode,$set);
|
||||
$params = array($url,$set);
|
||||
break;
|
||||
case 'chown':
|
||||
@ -364,7 +367,7 @@ switch($cmd)
|
||||
{
|
||||
$owner = $url; // first param is owner/group
|
||||
$url = array_shift($argv);
|
||||
if (egw_vfs::parse_url($url,PHP_URL_SCHEME)) load_wrapper($url); // we need the header loaded
|
||||
if (Vfs::parse_url($url,PHP_URL_SCHEME)) load_wrapper($url); // we need the header loaded
|
||||
if ($owner == 'root')
|
||||
{
|
||||
$owner = 0;
|
||||
@ -390,7 +393,7 @@ switch($cmd)
|
||||
$params = array($url,$owner);
|
||||
break;
|
||||
}
|
||||
if (($scheme = egw_vfs::parse_url($url,PHP_URL_SCHEME)))
|
||||
if (($scheme = Vfs::parse_url($url,PHP_URL_SCHEME)))
|
||||
{
|
||||
load_wrapper($url);
|
||||
}
|
||||
@ -413,14 +416,14 @@ switch($cmd)
|
||||
{
|
||||
load_wrapper($url);
|
||||
array_unshift($argv,$url);
|
||||
egw_vfs::find($argv,array('url'=>true,),'do_stat',array($long,$numeric,true,$inode));
|
||||
Vfs::find($argv,array('url'=>true,),'do_stat',array($long,$numeric,true,$inode));
|
||||
$argv = array();
|
||||
}
|
||||
elseif (is_dir($url) && ($dir = opendir($url)))
|
||||
{
|
||||
if ($argc)
|
||||
{
|
||||
if (!($name = basename(egw_vfs::parse_url($url,PHP_URL_PATH)))) $name = '/';
|
||||
if (!($name = basename(Vfs::parse_url($url,PHP_URL_PATH)))) $name = '/';
|
||||
echo "\n$name:\n";
|
||||
}
|
||||
// separate evtl. query part, to re-add it after the file-name
|
||||
@ -448,7 +451,7 @@ switch($cmd)
|
||||
{
|
||||
if ($argc)
|
||||
{
|
||||
echo "\n".basename(egw_vfs::parse_url($url,PHP_URL_PATH)).":\n";
|
||||
echo "\n".basename(Vfs::parse_url($url,PHP_URL_PATH)).":\n";
|
||||
}
|
||||
fpassthru($f);
|
||||
fclose($f);
|
||||
@ -491,7 +494,7 @@ function load_wrapper($url)
|
||||
// get eGW's __autoload() function
|
||||
include_once(EGW_API_INC.'/common_functions.inc.php');
|
||||
|
||||
if (!egw_vfs::load_wrapper($scheme))
|
||||
if (!Vfs::load_wrapper($scheme))
|
||||
{
|
||||
die("Unknown scheme '$scheme' in $url !!!\n\n");
|
||||
}
|
||||
@ -548,7 +551,7 @@ function load_egw($user,$passwd,$domain='default')
|
||||
$GLOBALS['egw_domain'][$domain]['config_passwd']))
|
||||
{
|
||||
echo "\nRoot access granted!\n";
|
||||
egw_vfs::$is_root = true;
|
||||
Vfs::$is_root = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -588,11 +591,11 @@ function do_eacl(array $argv)
|
||||
}
|
||||
if ($argc == 1)
|
||||
{
|
||||
foreach(egw_vfs::get_eacl($url) as $acl)
|
||||
foreach(Vfs::get_eacl($url) as $acl)
|
||||
{
|
||||
$mode = ($acl['rights'] & egw_vfs::READABLE ? 'r' : '-').
|
||||
($acl['rights'] & egw_vfs::WRITABLE ? 'w' : '-').
|
||||
($acl['rights'] & egw_vfs::EXECUTABLE ? 'x' : '-');
|
||||
$mode = ($acl['rights'] & Vfs::READABLE ? 'r' : '-').
|
||||
($acl['rights'] & Vfs::WRITABLE ? 'w' : '-').
|
||||
($acl['rights'] & Vfs::EXECUTABLE ? 'x' : '-');
|
||||
echo $acl['path']."\t$mode\t".$GLOBALS['egw']->accounts->id2name($acl['owner'])."\n";
|
||||
}
|
||||
return;
|
||||
@ -605,15 +608,15 @@ function do_eacl(array $argv)
|
||||
{
|
||||
switch($mode[$i])
|
||||
{
|
||||
case 'x': $argv[1] |= egw_vfs::EXECUTABLE; break;
|
||||
case 'w': $argv[1] |= egw_vfs::WRITABLE; break;
|
||||
case 'r': $argv[1] |= egw_vfs::READABLE; break;
|
||||
case 'x': $argv[1] |= Vfs::EXECUTABLE; break;
|
||||
case 'w': $argv[1] |= Vfs::WRITABLE; break;
|
||||
case 'r': $argv[1] |= Vfs::READABLE; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!egw_vfs::eacl($url,$argv[1],$argc > 2 && !is_numeric($argv[2]) ? $GLOBALS['egw']->accounts->name2id($argv[2]) : $argv[2]))
|
||||
if (!Vfs::eacl($url,$argv[1],$argc > 2 && !is_numeric($argv[2]) ? $GLOBALS['egw']->accounts->name2id($argv[2]) : $argv[2]))
|
||||
{
|
||||
echo "Error setting extended acl for $argv[0]!\n";
|
||||
echo "Error setting extended Acl for $argv[0]!\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -629,7 +632,7 @@ function do_eacl(array $argv)
|
||||
function do_stat($url,$long=false,$numeric=false,$full_path=false,$inode=false)
|
||||
{
|
||||
//echo "do_stat($url,$long,$numeric,$full_path)\n";
|
||||
$bname = egw_vfs::parse_url($url,PHP_URL_PATH);
|
||||
$bname = Vfs::parse_url($url,PHP_URL_PATH);
|
||||
|
||||
if (!$full_path)
|
||||
{
|
||||
@ -645,7 +648,7 @@ function do_stat($url,$long=false,$numeric=false,$full_path=false,$inode=false)
|
||||
|
||||
if (class_exists('egw_vfs'))
|
||||
{
|
||||
$perms = egw_vfs::int2mode($stat['mode']);
|
||||
$perms = Vfs::int2mode($stat['mode']);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -680,7 +683,7 @@ function do_stat($url,$long=false,$numeric=false,$full_path=false,$inode=false)
|
||||
$nlink = $stat['nlink'];
|
||||
if (($stat['mode'] & 0xA000) == 0xA000)
|
||||
{
|
||||
$symlink = " -> ".(class_exists('egw_vfs') ? egw_vfs::readlink($url) : readlink($url));
|
||||
$symlink = " -> ".(class_exists('egw_vfs') ? Vfs::readlink($url) : readlink($url));
|
||||
}
|
||||
if ($inode)
|
||||
{
|
||||
@ -718,7 +721,7 @@ function do_cp($argv,$recursive=false,$perms=false)
|
||||
{
|
||||
if (is_dir($from) && (!file_exists($to) || is_dir($to)) && $recursive && class_exists('egw_vfs'))
|
||||
{
|
||||
foreach(egw_vfs::find($from,array('url' => true)) as $f)
|
||||
foreach(Vfs::find($from,array('url' => true)) as $f)
|
||||
{
|
||||
$t = $to.substr($f,strlen($from));
|
||||
if (is_dir($f))
|
||||
@ -749,7 +752,7 @@ function _cp($from,$to,$verbose=false)
|
||||
|
||||
if (is_dir($to))
|
||||
{
|
||||
$path = egw_vfs::parse_url($from,PHP_URL_PATH);
|
||||
$path = Vfs::parse_url($from,PHP_URL_PATH);
|
||||
if (is_dir($to))
|
||||
{
|
||||
list($to,$query) = explode('?',$to,2);
|
||||
@ -805,7 +808,7 @@ function do_find($bases,$options)
|
||||
}
|
||||
$options['url'] = true; // we use url's not vfs pathes in filemanager/cli.php
|
||||
|
||||
foreach(egw_vfs::find($bases,$options) as $path)
|
||||
foreach(Vfs::find($bases,$options) as $path)
|
||||
{
|
||||
echo "$path\n";
|
||||
}
|
||||
@ -829,7 +832,7 @@ function do_lntree($from,$to)
|
||||
{
|
||||
usage("Directory '$to' is not writable!");
|
||||
}
|
||||
egw_vfs::find($from, array(
|
||||
Vfs::find($from, array(
|
||||
'url' => true,
|
||||
), '_ln', array($to));
|
||||
}
|
||||
@ -837,15 +840,15 @@ function do_lntree($from,$to)
|
||||
function _ln($src, $base, $stat)
|
||||
{
|
||||
//echo "_ln('$src', '$base', ".array2string($stat).")\n";
|
||||
$dst = $base.egw_vfs::parse_url($src, PHP_URL_PATH);
|
||||
$dst = $base.Vfs::parse_url($src, PHP_URL_PATH);
|
||||
|
||||
if (is_link($src))
|
||||
{
|
||||
if (($target = sqlfs_stream_wrapper::readlink($src)))
|
||||
if (($target = Vfs\Sqlfs\StreamWrapper::readlink($src)))
|
||||
{
|
||||
if ($target[0] != '/')
|
||||
{
|
||||
$target = egw_vfs::dirname($src).'/'.$target;
|
||||
$target = Vfs::dirname($src).'/'.$target;
|
||||
}
|
||||
echo "_ln('$src', '$base')\tsymlink('$base$target', '$dst')\n";
|
||||
symlink($base.$target, $dst);
|
||||
@ -862,7 +865,7 @@ function _ln($src, $base, $stat)
|
||||
}
|
||||
else
|
||||
{
|
||||
$target = sqlfs_stream_wrapper::_fs_path($stat['ino']);
|
||||
$target = Vfs\Sqlfs\StreamWrapper::_fs_path($stat['ino']);
|
||||
echo "_ln('$src', '$base')\tlink('$target', '$dst')\n";
|
||||
link($target, $dst);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Filemanager: mounting GUI
|
||||
* EGroupware Filemanager: mounting GUI
|
||||
*
|
||||
* @link http://www.egroupware.org/
|
||||
* @package filemanager
|
||||
@ -10,6 +10,9 @@
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
use EGroupware\Api;
|
||||
use EGroupware\Api\Framework;
|
||||
use EGroupware\Api\Etemplate;
|
||||
use EGroupware\Stylite\Vfs\Versioning;
|
||||
use EGroupware\Api\Vfs;
|
||||
|
||||
@ -57,11 +60,11 @@ class filemanager_admin extends filemanager_ui
|
||||
// make sure user has admin rights
|
||||
if (!isset($GLOBALS['egw_info']['user']['apps']['admin']))
|
||||
{
|
||||
throw new egw_exception_no_permission_admin();
|
||||
throw new Api\Exception\NoPermission\Admin();
|
||||
}
|
||||
// sudo handling
|
||||
parent::__construct();
|
||||
self::$is_setup = egw_session::appsession('is_setup','filemanager');
|
||||
self::$is_setup = Api\Cache::getSession('filemanager', 'is_setup');
|
||||
|
||||
if (class_exists('EGroupware\Stylite\Vfs\Versioning\StreamWrapper'))
|
||||
{
|
||||
@ -120,7 +123,7 @@ class filemanager_admin extends filemanager_ui
|
||||
}
|
||||
else // re-mount / with sqlFS, to disable versioning
|
||||
{
|
||||
$msg = Vfs::mount($url=sqlfs_stream_wrapper::SCHEME.'://default'.$path,$path) ?
|
||||
$msg = Vfs::mount($url=Vfs\Sqlfs\StreamWrapper::SCHEME.'://default'.$path,$path) ?
|
||||
lang('Successful mounted %1 on %2.',$url,$path) : lang('Error mounting %1 on %2!',$url,$path);
|
||||
}
|
||||
}
|
||||
@ -154,7 +157,7 @@ class filemanager_admin extends filemanager_ui
|
||||
}
|
||||
if ($content['allow_delete_versions'] != $GLOBALS['egw_info']['server']['allow_delete_versions'])
|
||||
{
|
||||
config::save_value('allow_delete_versions', $content['allow_delete_versions'], 'phpgwapi');
|
||||
Api\Config::save_value('allow_delete_versions', $content['allow_delete_versions'], 'phpgwapi');
|
||||
$GLOBALS['egw_info']['server']['allow_delete_versions'] = $content['allow_delete_versions'];
|
||||
$msg = lang('Configuration changed.');
|
||||
}
|
||||
@ -247,7 +250,7 @@ class filemanager_admin extends filemanager_ui
|
||||
$content['is_setup'] = self::$is_setup;
|
||||
$content['versioning'] = $this->versioning;
|
||||
$content['allow_delete_versions'] = $GLOBALS['egw_info']['server']['allow_delete_versions'];
|
||||
egw_framework::message($msg, $msg_type);
|
||||
Framework::message($msg, $msg_type);
|
||||
|
||||
$n = 2;
|
||||
$content['mounts'] = array();
|
||||
@ -275,7 +278,7 @@ class filemanager_admin extends filemanager_ui
|
||||
!isset($GLOBALS['egw_info']['user']['apps']['admin']);
|
||||
//_debug_array($content);
|
||||
|
||||
$tpl = new etemplate_new('filemanager.admin');
|
||||
$tpl = new Etemplate('filemanager.admin');
|
||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('VFS mounts and versioning');
|
||||
$tpl->exec('filemanager.filemanager_admin.index',$content,$sel_options,$readonlys);
|
||||
}
|
||||
@ -287,18 +290,18 @@ class filemanager_admin extends filemanager_ui
|
||||
{
|
||||
if ($_POST['cancel'])
|
||||
{
|
||||
egw_framework::redirect_link('/admin/index.php', null, 'admin');
|
||||
Framework::redirect_link('/admin/index.php', null, 'admin');
|
||||
}
|
||||
$check_only = !isset($_POST['fix']);
|
||||
|
||||
if (!($msgs = sqlfs_utils::fsck($check_only)))
|
||||
if (!($msgs = Vfs\Sqlfs\Utils::fsck($check_only)))
|
||||
{
|
||||
$msgs = lang('Filesystem check reported no problems.');
|
||||
}
|
||||
$content = '<p>'.implode("</p>\n<p>", (array)$msgs)."</p>\n";
|
||||
|
||||
$content .= html::form('<p>'.($check_only&&is_array($msgs)?html::submit_button('fix', lang('Fix reported problems')):'').
|
||||
html::submit_button('cancel', lang('Cancel')).'</p>',
|
||||
$content .= Api\Html::form('<p>'.($check_only&&is_array($msgs)?html::submit_button('fix', lang('Fix reported problems')):'').
|
||||
Api\Html::submit_button('cancel', lang('Cancel')).'</p>',
|
||||
'','/index.php',array('menuaction'=>'filemanager.filemanager_admin.fsck'));
|
||||
|
||||
$GLOBALS['egw']->framework->render($content, lang('Admin').' - '.lang('Check virtual filesystem'), true);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* eGroupWare - Hooks for admin, preferences and sidebox-menus
|
||||
* EGroupware - Hooks for admin, preferences and sidebox-menus
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
@ -9,6 +9,11 @@
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
use EGroupware\Api;
|
||||
use EGroupware\Api\Framework;
|
||||
use EGroupware\Api\Egw;
|
||||
use EGroupware\Api\Vfs;
|
||||
|
||||
/**
|
||||
* Class containing admin, preferences and sidebox-menus (used as hooks)
|
||||
*/
|
||||
@ -24,7 +29,7 @@ class filemanager_hooks
|
||||
static function sidebox_menu($args)
|
||||
{
|
||||
// Magic etemplate2 favorites menu (from nextmatch widget)
|
||||
display_sidebox(self::$appname, lang('Favorites'), egw_framework::favorite_list(self::$appname));
|
||||
display_sidebox(self::$appname, lang('Favorites'), Framework\Favorites::list_favorites(self::$appname));
|
||||
|
||||
$location = is_array($args) ? $args['location'] : $args;
|
||||
$rootpath = '/';
|
||||
@ -41,7 +46,7 @@ class filemanager_hooks
|
||||
// add "file a file" (upload) dialog
|
||||
$file[] = array(
|
||||
'text' => 'File a file',
|
||||
'link' => "javascript:egw_openWindowCentered2('".egw::link('/index.php',array(
|
||||
'link' => "javascript:egw_openWindowCentered2('".Egw::link('/index.php',array(
|
||||
'menuaction'=>'stylite.stylite_filemanager.upload',
|
||||
),false)."','_blank',550,350)",
|
||||
'app' => 'phpgwapi',
|
||||
@ -51,9 +56,9 @@ class filemanager_hooks
|
||||
// add selection for available views, if we have more then one
|
||||
if (count(filemanager_ui::init_views()) > 1)
|
||||
{
|
||||
$index_url = egw::link('/index.php',array('menuaction' => 'filemanager.filemanager_ui.index'),false);
|
||||
$index_url = Egw::link('/index.php',array('menuaction' => 'filemanager.filemanager_ui.index'),false);
|
||||
$file[] = array(
|
||||
'text' => html::select('filemanager_view',filemanager_ui::get_view(),filemanager_ui::$views,false,
|
||||
'text' => Api\Html::select('filemanager_view',filemanager_ui::get_view(),filemanager_ui::$views,false,
|
||||
' onchange="'."egw_appWindow('filemanager').location='$index_url&view='+this.value;".
|
||||
'" style="width: 100%;"'),
|
||||
'no_lang' => True,
|
||||
@ -62,22 +67,22 @@ class filemanager_hooks
|
||||
}
|
||||
if ($file_prefs['showhome'] != 'no')
|
||||
{
|
||||
$file['Your home directory'] = egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$homepath,'ajax'=>'true'));
|
||||
$file['Your home directory'] = Egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$homepath,'ajax'=>'true'));
|
||||
}
|
||||
if ($file_prefs['showusers'] != 'no')
|
||||
{
|
||||
$file['Users and groups'] = egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$basepath,'ajax'=>'true'));
|
||||
$file['Users and groups'] = Egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$basepath,'ajax'=>'true'));
|
||||
}
|
||||
if (!empty($file_prefs['showbase']) && $file_prefs['showbase']=='yes')
|
||||
{
|
||||
$file['Basedirectory'] = egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$rootpath,'ajax'=>'true'));
|
||||
$file['Basedirectory'] = Egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$rootpath,'ajax'=>'true'));
|
||||
}
|
||||
if (!empty($file_prefs['startfolder']))
|
||||
{
|
||||
$file['Startfolder']= egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$file_prefs['startfolder'],'ajax'=>'true'));
|
||||
$file['Startfolder']= Egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$file_prefs['startfolder'],'ajax'=>'true'));
|
||||
}
|
||||
$file['Placeholders'] = egw::link('/index.php','menuaction=filemanager.filemanager_merge.show_replacements');
|
||||
$file['Shared files'] = egw::link('/index.php','menuaction=filemanager.filemanager_shares.index&ajax=true');
|
||||
$file['Placeholders'] = Egw::link('/index.php','menuaction=filemanager.filemanager_merge.show_replacements');
|
||||
$file['Shared files'] = Egw::link('/index.php','menuaction=filemanager.filemanager_shares.index&ajax=true');
|
||||
display_sidebox(self::$appname,$title,$file);
|
||||
}
|
||||
if ($GLOBALS['egw_info']['user']['apps']['admin']) self::admin(self::$appname);
|
||||
@ -93,10 +98,10 @@ class filemanager_hooks
|
||||
if (is_array($location)) $location = $location['location'];
|
||||
|
||||
$file = Array(
|
||||
//'Site Configuration' => egw::link('/index.php','menuaction=admin.admin_config.index&appname='.self::$appname.'&ajax=true'),
|
||||
'Custom fields' => egw::link('/index.php','menuaction=admin.customfields.index&appname='.self::$appname.'&ajax=true'),
|
||||
'Check virtual filesystem' => egw::link('/index.php','menuaction=filemanager.filemanager_admin.fsck'),
|
||||
'VFS mounts and versioning' => egw::link('/index.php', 'menuaction=filemanager.filemanager_admin.index'),
|
||||
//'Site Configuration' => Egw::link('/index.php','menuaction=admin.admin_config.index&appname='.self::$appname.'&ajax=true'),
|
||||
'Custom fields' => Egw::link('/index.php','menuaction=admin.customfields.index&appname='.self::$appname.'&ajax=true'),
|
||||
'Check virtual filesystem' => Egw::link('/index.php','menuaction=filemanager.filemanager_admin.fsck'),
|
||||
'VFS mounts and versioning' => Egw::link('/index.php', 'menuaction=filemanager.filemanager_admin.index'),
|
||||
);
|
||||
if ($location == 'admin')
|
||||
{
|
||||
@ -115,7 +120,7 @@ class filemanager_hooks
|
||||
*/
|
||||
static function settings()
|
||||
{
|
||||
$config = config::read(self::$appname);
|
||||
$config = Api\Config::read(self::$appname);
|
||||
if (!empty($config['max_folderlinks'])) self::$foldercount = (int)$config['max_folderlinks'];
|
||||
|
||||
$yes_no = array(
|
||||
@ -173,7 +178,7 @@ class filemanager_hooks
|
||||
'name' => 'default_document',
|
||||
'help' => lang('If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.',lang('filemanager')).' '.
|
||||
lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'name').' '.
|
||||
lang('The following document-types are supported:'). implode(',',bo_merge::get_file_extensions()),
|
||||
lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
|
||||
'run_lang' => false,
|
||||
'xmlrpc' => True,
|
||||
'admin' => False,
|
||||
@ -185,7 +190,7 @@ class filemanager_hooks
|
||||
'name' => 'document_dir',
|
||||
'help' => lang('If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the %1 data inserted.', lang('filemanager')).' '.
|
||||
lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','name').' '.
|
||||
lang('The following document-types are supported:'). implode(',',bo_merge::get_file_extensions()),
|
||||
lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
|
||||
'run_lang' => false,
|
||||
'xmlrpc' => True,
|
||||
'admin' => False,
|
||||
@ -233,7 +238,7 @@ class filemanager_hooks
|
||||
/**
|
||||
* Register filemanager as handler for directories
|
||||
*
|
||||
* @return array see egw_link class
|
||||
* @return array see Api\Link class
|
||||
*/
|
||||
static function search_link()
|
||||
{
|
||||
@ -244,7 +249,7 @@ class filemanager_hooks
|
||||
'edit_id' => 'path',
|
||||
'edit_popup' => '495x425',
|
||||
'mime' => array(
|
||||
egw_vfs::DIR_MIME_TYPE => array(
|
||||
Vfs::DIR_MIME_TYPE => array(
|
||||
'menuaction' => 'filemanager.filemanager_ui.index',
|
||||
'ajax' => 'true',
|
||||
'mime_id' => 'path',
|
||||
|
@ -10,11 +10,15 @@
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
use EGroupware\Api;
|
||||
use EGroupware\Api\Link;
|
||||
use EGroupware\Api\Vfs;
|
||||
|
||||
/**
|
||||
* Filemanager - document merge object
|
||||
* Only merges information about the files, not the files themselves
|
||||
*/
|
||||
class filemanager_merge extends bo_merge
|
||||
class filemanager_merge extends Api\Storage\Merge
|
||||
{
|
||||
/**
|
||||
* Functions that can be called via menuaction
|
||||
@ -61,8 +65,8 @@ class filemanager_merge extends bo_merge
|
||||
$this->dir = $_dir;
|
||||
}
|
||||
|
||||
// switch of handling of html formated content, if html is not used
|
||||
$this->parse_html_styles = egw_customfields::use_html('filemanager');
|
||||
// switch off handling of html formated content, if html is not used
|
||||
$this->parse_html_styles = Api\Storage\Customfields::use_html('filemanager');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,31 +95,31 @@ class filemanager_merge extends bo_merge
|
||||
public function filemanager_replacements($id,$prefix='', &$content = null)
|
||||
{
|
||||
$info = array();
|
||||
$file = egw_vfs::lstat($id,true);
|
||||
$file = Vfs::lstat($id,true);
|
||||
|
||||
$file['mtime'] = egw_time::to($file['mtime']);
|
||||
$file['ctime'] = egw_time::to($file['ctime']);
|
||||
$file['mtime'] = Api\DateTime::to($file['mtime']);
|
||||
$file['ctime'] = Api\DateTime::to($file['ctime']);
|
||||
|
||||
$file['name'] = egw_vfs::basename($id);
|
||||
$file['dir'] = egw_vfs::decodePath(egw_vfs::dirname($id));
|
||||
$file['name'] = Vfs::basename($id);
|
||||
$file['dir'] = Vfs::decodePath(Vfs::dirname($id));
|
||||
$dirlist = explode('/',$file['dir']);
|
||||
$file['folder'] = array_pop($dirlist);
|
||||
$file['folder_file'] = $file['folder'] . '/'.$file['name'];
|
||||
$file['path'] = $id;
|
||||
$file['rel_path'] = str_replace($this->dir.'/', '', $id);
|
||||
$file['hsize'] = egw_vfs::hsize($file['size']);
|
||||
$file['mime'] = egw_vfs::mime_content_type($id);
|
||||
$file['hsize'] = Vfs::hsize($file['size']);
|
||||
$file['mime'] = Vfs::mime_content_type($id);
|
||||
$file['gid'] *= -1; // our widgets use negative gid's
|
||||
if (($props = egw_vfs::propfind($id)))
|
||||
if (($props = Vfs::propfind($id)))
|
||||
{
|
||||
foreach($props as $prop)
|
||||
{
|
||||
$file[$prop['name']] = $prop['val'];
|
||||
}
|
||||
}
|
||||
if (($file['is_link'] = egw_vfs::is_link($id)))
|
||||
if (($file['is_link'] = Vfs::is_link($id)))
|
||||
{
|
||||
$file['symlink'] = egw_vfs::readlink($id);
|
||||
$file['symlink'] = Vfs::readlink($id);
|
||||
}
|
||||
// Custom fields
|
||||
if($content && strpos($content, '#') !== 0)
|
||||
@ -123,7 +127,7 @@ class filemanager_merge extends bo_merge
|
||||
// Expand link-to custom fields
|
||||
$this->cf_link_to_expand($file, $content, $info);
|
||||
|
||||
foreach(config::get_customfields('filemanager') as $name => $field)
|
||||
foreach(Api\Storage\Customfields::get('filemanager') as $name => $field)
|
||||
{
|
||||
// Set any missing custom fields, or the marker will stay
|
||||
if(!$file['#'.$name])
|
||||
@ -132,11 +136,11 @@ class filemanager_merge extends bo_merge
|
||||
continue;
|
||||
}
|
||||
|
||||
// Format date cfs per user preferences
|
||||
// Format date cfs per user Api\Preferences
|
||||
if($field['type'] == 'date' || $field['type'] == 'date-time')
|
||||
{
|
||||
$this->date_fields[] = '#'.$name;
|
||||
$file['#'.$name] = egw_time::to($file['#'.$name], $field['type'] == 'date' ? true : '');
|
||||
$file['#'.$name] = Api\DateTime::to($file['#'.$name], $field['type'] == 'date' ? true : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -149,12 +153,12 @@ class filemanager_merge extends bo_merge
|
||||
// Symlink?
|
||||
if(!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) {
|
||||
// Try resolving just app + ID - /apps/App Name/Record Title/file
|
||||
$resolved = egw_vfs::resolve_url_symlinks(implode('/',array_slice(explode('/',$file['dir']),0,4)));
|
||||
$resolved = Vfs::resolve_url_symlinks(implode('/',array_slice(explode('/',$file['dir']),0,4)));
|
||||
list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/')+5));
|
||||
|
||||
if(!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) {
|
||||
// Get rid of any virtual folders (eg: All$) and symlinks
|
||||
$resolved = egw_vfs::resolve_url_symlinks($file['path']);
|
||||
$resolved = Vfs::resolve_url_symlinks($file['path']);
|
||||
list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/')+5));
|
||||
}
|
||||
}
|
||||
@ -182,17 +186,17 @@ class filemanager_merge extends bo_merge
|
||||
}
|
||||
}
|
||||
}
|
||||
$link = egw_link::mime_open($file['url'], $file['mime']);
|
||||
$link = Link::mime_open($file['url'], $file['mime']);
|
||||
if(is_array($link))
|
||||
{
|
||||
// Directories have their internal protocol in path here
|
||||
if($link['path'] && strpos($link['path'], '://') !== false) $link['path'] = $file['path'];
|
||||
$link = egw_session::link('/index.php', $link);
|
||||
$link = Api\Session::link('/index.php', $link);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Regular files
|
||||
$link = egw_session::link($link);
|
||||
$link = Api\Session::link($link);
|
||||
}
|
||||
|
||||
// Prepend site, if missing
|
||||
@ -201,7 +205,7 @@ class filemanager_merge extends bo_merge
|
||||
$link = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://').
|
||||
($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).$link;
|
||||
}
|
||||
$file['link'] = html::a_href(html::htmlspecialchars($file['name']), $link);
|
||||
$file['link'] = Api\Html::a_href(Api\Html::htmlspecialchars($file['name']), $link);
|
||||
$file['url'] = $link;
|
||||
|
||||
// Add markers
|
||||
@ -218,14 +222,14 @@ class filemanager_merge extends bo_merge
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate table with replacements for the preferences
|
||||
* Generate table with replacements for the Api\Preferences
|
||||
*
|
||||
*/
|
||||
public function show_replacements()
|
||||
{
|
||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('filemanager').' - '.lang('Replacements for inserting entries into documents');
|
||||
$GLOBALS['egw_info']['flags']['nonavbar'] = false;
|
||||
common::egw_header();
|
||||
$GLOBALS['egw']->framework->header();
|
||||
|
||||
echo "<table width='90%' align='center'>\n";
|
||||
echo '<tr><td colspan="4"><h3>'.lang('Filemanager fields:')."</h3></td></tr>";
|
||||
@ -255,7 +259,7 @@ class filemanager_merge extends bo_merge
|
||||
}
|
||||
|
||||
echo '<tr><td colspan="4"><h3>'.lang('Custom fields').":</h3></td></tr>";
|
||||
foreach(config::get_customfields('filemanager') as $name => $field)
|
||||
foreach(Api\Storage\Customfields::get('filemanager') as $name => $field)
|
||||
{
|
||||
echo '<tr><td>{{#'.$name.'}}</td><td colspan="3">'.$field['label']."</td></tr>\n";
|
||||
}
|
||||
@ -283,6 +287,6 @@ class filemanager_merge extends bo_merge
|
||||
|
||||
echo "</table>\n";
|
||||
|
||||
common::egw_footer();
|
||||
$GLOBALS['egw']->framework->footer();
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* eGroupWare - Filemanager - select file to open or save dialog
|
||||
* EGroupware - Filemanager - select file to open or save dialog
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @package filemanager
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @copyright (c) 2009-2012 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @copyright (c) 2009-2016 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
use EGroupware\Api;
|
||||
use EGroupware\Api\Link;
|
||||
use EGroupware\Api\Framework;
|
||||
use EGroupware\Api\Egw;
|
||||
use EGroupware\Api\Vfs;
|
||||
use EGroupware\Api\Etemplate;
|
||||
|
||||
/**
|
||||
* Select file to open or save dialog
|
||||
*
|
||||
@ -49,7 +56,7 @@ class filemanager_select
|
||||
// strip slashes from _GET parameters, if someone still has magic_quotes_gpc on
|
||||
if (get_magic_quotes_gpc() && $_GET)
|
||||
{
|
||||
$_GET = etemplate::array_stripslashes($_GET);
|
||||
$_GET = array_stripslashes($_GET);
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,17 +76,17 @@ class filemanager_select
|
||||
$content['msg'] = $_GET['msg'];
|
||||
$_GET['mode'] = 'open';
|
||||
$_GET['method'] = 'ckeditor_return';
|
||||
$_GET['CKEditorFuncNum'] = egw_cache::getSession('filemanager','ckeditorfuncnum');
|
||||
$_GET['CKEditorFuncNum'] = Api\Cache::getSession('filemanager','ckeditorfuncnum');
|
||||
}
|
||||
$content['mode'] = $_GET['mode'];
|
||||
if (!in_array($content['mode'],array('open','open-multiple','saveas','select-dir')))
|
||||
{
|
||||
throw new egw_exception_wrong_parameter("Wrong or unset required mode parameter!");
|
||||
throw new Api\Exception\WrongParameter("Wrong or unset required mode parameter!");
|
||||
}
|
||||
$content['path'] = $_GET['path'];
|
||||
if (empty($content['path']))
|
||||
{
|
||||
$content['path'] = egw_session::appsession('select_path','filemanger');
|
||||
$content['path'] = Api\Cache::getSession('filemanger', 'select_path');
|
||||
}
|
||||
$content['name'] = (string)$_GET['name'];
|
||||
$content['method'] = $_GET['method'];
|
||||
@ -87,12 +94,12 @@ class filemanager_select
|
||||
{
|
||||
if (isset($_GET['CKEditorFuncNum']) && is_numeric($_GET['CKEditorFuncNum']))
|
||||
{
|
||||
egw_cache::setSession('filemanager','ckeditorfuncnum',
|
||||
Api\Cache::setSession('filemanager','ckeditorfuncnum',
|
||||
$content['ckeditorfuncnum'] = $_GET['CKEditorFuncNum']);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new egw_exception_wrong_parameter("chkeditor_return has been specified as a method but some parameters are missing or invalid.");
|
||||
throw new Api\Exception\WrongParameter("chkeditor_return has been specified as a method but some parameters are missing or invalid.");
|
||||
}
|
||||
}
|
||||
$content['id'] = $_GET['id'];
|
||||
@ -104,7 +111,7 @@ class filemanager_select
|
||||
{
|
||||
if (is_numeric($key))
|
||||
{
|
||||
$sel_options['mime'][$value] = lang('%1 files',strtoupper(mime_magic::mime2ext($value))).' ('.$value.')';
|
||||
$sel_options['mime'][$value] = lang('%1 files',strtoupper(Api\MimeMagic::mime2ext($value))).' ('.$value.')';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -131,11 +138,11 @@ class filemanager_select
|
||||
{
|
||||
//Set the "content" name filed accordingly to the uploaded file
|
||||
// encode chars which special meaning in url/vfs (some like / get removed!)
|
||||
$content['name'] = egw_vfs::encodePathComponent($content['file_upload']['name']);
|
||||
$to_path = egw_vfs::concat($content['path'],$content['name']);
|
||||
$content['name'] = Vfs::encodePathComponent($content['file_upload']['name']);
|
||||
$to_path = Vfs::concat($content['path'],$content['name']);
|
||||
|
||||
$copy_result = (egw_vfs::is_writable($content['path']) || egw_vfs::is_writable($to_path)) &&
|
||||
copy($content['file_upload']['tmp_name'],egw_vfs::PREFIX.$to_path);
|
||||
$copy_result = (Vfs::is_writable($content['path']) || Vfs::is_writable($to_path)) &&
|
||||
copy($content['file_upload']['tmp_name'],Vfs::PREFIX.$to_path);
|
||||
}
|
||||
|
||||
//Break on an error condition
|
||||
@ -159,7 +166,7 @@ class filemanager_select
|
||||
case 'open-multiple':
|
||||
foreach((array)$content['dir']['selected'] as $name)
|
||||
{
|
||||
$files[] = egw_vfs::concat($content['path'],$name);
|
||||
$files[] = Vfs::concat($content['path'],$name);
|
||||
}
|
||||
//Add an uploaded file to the files result array2string
|
||||
if ($copy_result === true) $files[] = $to_path;
|
||||
@ -171,11 +178,11 @@ class filemanager_select
|
||||
|
||||
case 'saveas':
|
||||
// Don't trust the name the user gives, encode it
|
||||
$content['name'] = egw_vfs::encodePathComponent($content['name']);
|
||||
$content['name'] = Vfs::encodePathComponent($content['name']);
|
||||
// Fall through
|
||||
|
||||
default:
|
||||
$files = egw_vfs::concat($content['path'],$content['name']);
|
||||
$files = Vfs::concat($content['path'],$content['name']);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -185,16 +192,16 @@ class filemanager_select
|
||||
}
|
||||
else if ($content['method'] == 'ckeditor_return')
|
||||
{
|
||||
$download_url = egw_vfs::download_url(egw_vfs::concat($content['path'],$content['name']));
|
||||
if ($download_url[0] == '/') $download_url = egw::link($download_url);
|
||||
$download_url = Vfs::download_url(Vfs::concat($content['path'],$content['name']));
|
||||
if ($download_url[0] == '/') $download_url = Egw::link($download_url);
|
||||
$js = "window.opener.CKEDITOR.tools.callFunction(".
|
||||
$content['ckeditorfuncnum'].",'".
|
||||
htmlspecialchars($download_url)."',".
|
||||
"'');\negw(window).close();";
|
||||
}
|
||||
if(egw_json_response::isJSONResponse() && !($content['method'] == 'ckeditor_return'))
|
||||
if(Api\Json\Response::isJSONResponse() && !($content['method'] == 'ckeditor_return'))
|
||||
{
|
||||
$response = egw_json_response::get();
|
||||
$response = Api\Json\Response::get();
|
||||
if($js)
|
||||
{
|
||||
$response->script($js);
|
||||
@ -205,10 +212,10 @@ class filemanager_select
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Content-type: text/html; charset='.translation::charset());
|
||||
header('Content-type: text/html; charset='.Api\Translation::charset());
|
||||
echo "<html>\n<head>\n<script type='text/javascript'>\n$js\n</script>\n</head>\n</html>\n";
|
||||
}
|
||||
common::egw_exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
$sel_options['mime'] = $content['options-mime'];
|
||||
@ -221,7 +228,7 @@ class filemanager_select
|
||||
|
||||
//Deactivate the opload field if the current directory is not writeable or
|
||||
//we're currently not in the single file open mode.
|
||||
$content['no_upload'] = !egw_vfs::is_writable($content['path']) ||
|
||||
$content['no_upload'] = !Vfs::is_writable($content['path']) ||
|
||||
!in_array($content['mode'],array('open'));
|
||||
|
||||
$content['apps'] = array_keys(self::get_apps());
|
||||
@ -234,17 +241,17 @@ class filemanager_select
|
||||
// Set a flag for easy detection as we go
|
||||
$favorites_flag = substr($content['path'],0,strlen('/apps/favorites')) == '/apps/favorites';
|
||||
|
||||
if (!$favorites_flag && (!$content['path'] || !egw_vfs::is_dir($content['path'])))
|
||||
if (!$favorites_flag && (!$content['path'] || !Vfs::is_dir($content['path'])))
|
||||
{
|
||||
$content['path'] = filemanager_ui::get_home_dir();
|
||||
}
|
||||
$tpl = new etemplate_new('filemanager.select');
|
||||
$tpl = new Etemplate('filemanager.select');
|
||||
|
||||
if ($favorites_flag)
|
||||
{
|
||||
// Display favorites as if they were folders
|
||||
$files = array();
|
||||
$favorites = egw_favorites::get_favorites('filemanager');
|
||||
$favorites = Framework\Favorites::get_favorites('filemanager');
|
||||
$n = 0;
|
||||
foreach($favorites as $favorite)
|
||||
{
|
||||
@ -253,7 +260,7 @@ class filemanager_select
|
||||
if(!$path) continue;
|
||||
if ($path == $content['path']) continue; // remove directory itself
|
||||
|
||||
$mime = egw_vfs::mime_content_type($path);
|
||||
$mime = Vfs::mime_content_type($path);
|
||||
$content['dir'][$n] = array(
|
||||
'name' => $favorite['name'],
|
||||
'path' => $path,
|
||||
@ -267,7 +274,7 @@ class filemanager_select
|
||||
++$n;
|
||||
}
|
||||
}
|
||||
else if (!($files = egw_vfs::find($content['path'],array(
|
||||
else if (!($files = Vfs::find($content['path'],array(
|
||||
'dirsontop' => true,
|
||||
'order' => 'name',
|
||||
'sort' => 'ASC',
|
||||
@ -284,9 +291,9 @@ class filemanager_select
|
||||
{
|
||||
if ($path == $content['path']) continue; // remove directory itself
|
||||
|
||||
$name = egw_vfs::basename($path);
|
||||
$is_dir = egw_vfs::is_dir($path);
|
||||
$mime = egw_vfs::mime_content_type($path);
|
||||
$name = Vfs::basename($path);
|
||||
$is_dir = Vfs::is_dir($path);
|
||||
$mime = Vfs::mime_content_type($path);
|
||||
if ($content['mime'] && !$is_dir && $mime != $content['mime'])
|
||||
{
|
||||
continue; // does not match mime-filter --> ignore
|
||||
@ -305,10 +312,10 @@ class filemanager_select
|
||||
}
|
||||
if (!$n) $readonlys['selected[]'] = true; // remove checkbox from empty line
|
||||
}
|
||||
$readonlys['button[createdir]'] = !egw_vfs::is_writable($content['path']);
|
||||
$readonlys['button[createdir]'] = !Vfs::is_writable($content['path']);
|
||||
|
||||
//_debug_array($readonlys);
|
||||
egw_session::appsession('select_path','filemanger',$content['path']);
|
||||
Api\Cache::setSession('filemanger', 'select_path', $content['path']);
|
||||
$preserve = array(
|
||||
'mode' => $content['mode'],
|
||||
'method' => $content['method'],
|
||||
@ -328,7 +335,7 @@ class filemanager_select
|
||||
// tell framework we need inline javascript for ckeditor_return
|
||||
if ($content['method'] == 'ckeditor_return')
|
||||
{
|
||||
egw_framework::csp_script_src_attrs('unsafe-inline');
|
||||
Api\Header\ContentSecurityPolicy::add('script-src', 'unsafe-inline');
|
||||
}
|
||||
$tpl->exec('filemanager.filemanager_select.select',$content,$sel_options,$readonlys,$preserve,2);
|
||||
}
|
||||
@ -342,7 +349,7 @@ class filemanager_select
|
||||
{
|
||||
$apps = array(false); // index starting from 1
|
||||
if (isset($GLOBALS['egw_info']['apps']['stylite'])) $apps = array('favorites' => lang('Favorites'));
|
||||
$apps += egw_link::app_list('query');
|
||||
$apps += Link::app_list('query');
|
||||
|
||||
unset($apps['mydms']); // they do NOT support adding files to VFS
|
||||
unset($apps['wiki']);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Filemanager: shares
|
||||
* EGroupware Filemanager: shares
|
||||
*
|
||||
* @link http://www.egroupware.org/
|
||||
* @package filemanager
|
||||
@ -11,6 +11,8 @@
|
||||
*/
|
||||
|
||||
use EGroupware\Api;
|
||||
use EGroupware\Api\Framework;
|
||||
use EGroupware\Api\Etemplate;
|
||||
use EGroupware\Api\Vfs\Sharing;
|
||||
|
||||
/**
|
||||
@ -162,7 +164,7 @@ class filemanager_shares extends filemanager_ui
|
||||
{
|
||||
$where['share_id'] = $content['nm']['selected'];
|
||||
}
|
||||
egw_framework::message(lang('%1 shares deleted.', Sharing::delete($where)), 'success');
|
||||
Framework::message(lang('%1 shares deleted.', Sharing::delete($where)), 'success');
|
||||
break;
|
||||
default:
|
||||
throw new Api\Exception\WrongParameter("Unknown action '{$content['nm']['action']}'!");
|
||||
@ -180,7 +182,7 @@ class filemanager_shares extends filemanager_ui
|
||||
);
|
||||
unset($sel_options['type'][Sharing::ATTACH]);
|
||||
|
||||
$tpl = new Api\Etemplate('filemanager.shares');
|
||||
$tpl = new Etemplate('filemanager.shares');
|
||||
$tpl->exec('filemanager.filemanager_shares.index', $content, $sel_options, null, $content);
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* eGroupWare - Filemanager - user interface
|
||||
* EGroupware - Filemanager - user interface
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @package filemanager
|
||||
@ -11,6 +11,11 @@
|
||||
*/
|
||||
|
||||
use EGroupware\Api;
|
||||
use EGroupware\Api\Link;
|
||||
use EGroupware\Api\Framework;
|
||||
use EGroupware\Api\Egw;
|
||||
use EGroupware\Api\Etemplate;
|
||||
|
||||
use EGroupware\Api\Vfs;
|
||||
|
||||
/**
|
||||
@ -53,7 +58,7 @@ class filemanager_ui
|
||||
// strip slashes from _GET parameters, if someone still has magic_quotes_gpc on
|
||||
if (get_magic_quotes_gpc() && $_GET)
|
||||
{
|
||||
$_GET = etemplate::array_stripslashes($_GET);
|
||||
$_GET = array_stripslashes($_GET);
|
||||
}
|
||||
// do we have root rights
|
||||
if (Api\Cache::getSession('filemanager', 'is_root'))
|
||||
@ -80,7 +85,7 @@ class filemanager_ui
|
||||
$label = lang($label);
|
||||
}
|
||||
// search for plugins with additional filemanager views
|
||||
foreach($GLOBALS['egw']->hooks->process('filemanager_views') as $views)
|
||||
foreach(Api\Hooks::process('filemanager_views') as $views)
|
||||
{
|
||||
if (is_array($views)) static::$views += $views;
|
||||
}
|
||||
@ -385,16 +390,16 @@ class filemanager_ui
|
||||
*/
|
||||
function listview(array $content=null,$msg=null)
|
||||
{
|
||||
$tpl = new Api\Etemplate('filemanager.index');
|
||||
$tpl = new Etemplate('filemanager.index');
|
||||
|
||||
if($msg) egw_framework::message($msg);
|
||||
if($msg) Framework::message($msg);
|
||||
|
||||
if (($content['nm']['action'] || $content['nm']['rows']) && (empty($content['button']) || !isset($content['button'])))
|
||||
{
|
||||
if ($content['nm']['action'])
|
||||
{
|
||||
$msg = static::action($content['nm']['action'],$content['nm']['selected'],$content['nm']['path']);
|
||||
if($msg) egw_framework::message($msg);
|
||||
if($msg) Framework::message($msg);
|
||||
|
||||
// clean up after action
|
||||
unset($content['nm']['selected']);
|
||||
@ -408,7 +413,7 @@ class filemanager_ui
|
||||
elseif($content['nm']['rows']['delete'])
|
||||
{
|
||||
$msg = static::action('delete',array_keys($content['nm']['rows']['delete']),$content['nm']['path']);
|
||||
if($msg) egw_framework::message($msg);
|
||||
if($msg) Framework::message($msg);
|
||||
|
||||
// clean up after action
|
||||
unset($content['nm']['rows']['delete']);
|
||||
@ -440,7 +445,7 @@ class filemanager_ui
|
||||
case 'upload':
|
||||
if (!$content['upload'])
|
||||
{
|
||||
egw_framework::message(lang('You need to select some files first!'),'error');
|
||||
Framework::message(lang('You need to select some files first!'),'error');
|
||||
break;
|
||||
}
|
||||
$upload_success = $upload_failure = array();
|
||||
@ -462,12 +467,12 @@ class filemanager_ui
|
||||
$content['nm']['msg'] = '';
|
||||
if ($upload_success)
|
||||
{
|
||||
egw_framework::message( count($upload_success) == 1 && !$upload_failure ? lang('File successful uploaded.') :
|
||||
Framework::message( count($upload_success) == 1 && !$upload_failure ? lang('File successful uploaded.') :
|
||||
lang('%1 successful uploaded.',implode(', ',$upload_success)));
|
||||
}
|
||||
if ($upload_failure)
|
||||
{
|
||||
egw_framework::message(lang('Error uploading file!')."\n".etemplate::max_upload_size_message(),'error');
|
||||
Framework::message(lang('Error uploading file!')."\n".etemplate::max_upload_size_message(),'error');
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -807,7 +812,7 @@ class filemanager_ui
|
||||
{
|
||||
// we will leave here, since we are not allowed, or the location does not exist. Index must handle that, and give
|
||||
// an appropriate message
|
||||
egw::redirect_link('/index.php',array('menuaction'=>'filemanager.filemanager_ui.index',
|
||||
Egw::redirect_link('/index.php',array('menuaction'=>'filemanager.filemanager_ui.index',
|
||||
'path' => $path,
|
||||
'msg' => lang('The requested path %1 is not available.',Vfs::decodePath($query['path'])),
|
||||
'ajax' => 'true'
|
||||
@ -926,7 +931,7 @@ class filemanager_ui
|
||||
*/
|
||||
function file(array $content=null,$msg='')
|
||||
{
|
||||
$tpl = new Api\Etemplate('filemanager.file');
|
||||
$tpl = new Etemplate('filemanager.file');
|
||||
|
||||
if (!is_array($content))
|
||||
{
|
||||
@ -1031,7 +1036,7 @@ class filemanager_ui
|
||||
$msg .= lang('Renamed %1 to %2.',Vfs::decodePath(basename($path)),Vfs::decodePath(basename($to))).' ';
|
||||
$content['old']['name'] = $content[$name];
|
||||
$path = $to;
|
||||
$content['mime'] = mime_magic::filename2mime($path); // recheck mime type
|
||||
$content['mime'] = Api\MimeMagic::filename2mime($path); // recheck mime type
|
||||
$refresh_path = Vfs::dirname($path); // for renames, we have to refresh the parent
|
||||
}
|
||||
else
|
||||
@ -1154,14 +1159,14 @@ class filemanager_ui
|
||||
}
|
||||
}
|
||||
}
|
||||
egw_framework::refresh_opener($msg, 'filemanager', $refresh_path ? $refresh_path : $path, 'edit', null, '&path=[^&]*');
|
||||
if ($button == 'save') egw_framework::window_close();
|
||||
Framework::refresh_opener($msg, 'filemanager', $refresh_path ? $refresh_path : $path, 'edit', null, '&path=[^&]*');
|
||||
if ($button == 'save') Framework::window_close();
|
||||
}
|
||||
if ($content['is_link'] && !Vfs::stat($path))
|
||||
{
|
||||
$msg .= ($msg ? "\n" : '').lang('Link target %1 not found!',$content['symlink']);
|
||||
}
|
||||
$content['link'] = egw::link(Vfs::download_url($path));
|
||||
$content['link'] = Egw::link(Vfs::download_url($path));
|
||||
$content['icon'] = Vfs::mime_icon($content['mime']);
|
||||
$content['msg'] = $msg;
|
||||
|
||||
@ -1242,7 +1247,7 @@ class filemanager_ui
|
||||
$content['mergeapp_effective'] = null;
|
||||
}
|
||||
// mergeapp select options
|
||||
$mergeapp_list = Api\Link::app_list('merge');
|
||||
$mergeapp_list = Link::app_list('merge');
|
||||
unset($mergeapp_list[$GLOBALS['egw_info']['flags']['currentapp']]); // exclude filemanager from list
|
||||
$mergeapp_empty = !empty($content['mergeapp_parent'])
|
||||
? $mergeapp_list[$content['mergeapp_parent']] . ' (parent setting)' : '';
|
||||
@ -1309,7 +1314,7 @@ class filemanager_ui
|
||||
}
|
||||
}
|
||||
}
|
||||
egw_framework::window_focus();
|
||||
Framework::window_focus();
|
||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('Preferences').' '.Vfs::decodePath($path);
|
||||
|
||||
$tpl->exec('filemanager.filemanager_ui.file',$content,$sel_options,$readonlys,$preserve,2);
|
||||
@ -1407,7 +1412,7 @@ class filemanager_ui
|
||||
case 'link':
|
||||
// First upload
|
||||
$arr = static::ajax_action('upload', $selected, $dir, $props);
|
||||
$app_dir = Api\Link::vfs_path($props['entry']['app'],$props['entry']['id'],'',true);
|
||||
$app_dir = Link::vfs_path($props['entry']['app'],$props['entry']['id'],'',true);
|
||||
|
||||
foreach($arr['uploaded'] as $file)
|
||||
{
|
||||
|
@ -1,50 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* EGroupware - eTemplates for Application filemanager
|
||||
* http://www.egroupware.org
|
||||
* generated by soetemplate::dump4setup() 2013-04-20 21:19
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @package filemanager
|
||||
* @subpackage setup
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
$templ_version=1;
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.file','template' => '','lang' => '','group' => '0','version' => '1.7.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:3:"tab";s:5:"label";s:54:"General|Permissions|Extended ACL|Preview|Custom fields";s:4:"name";s:38:"tabs=general|perms|eacl|preview|custom";s:4:"span";s:3:"all";}}i:3;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";}i:2;a:3:{s:4:"type";s:6:"button";s:4:"name";s:13:"button[apply]";s:5:"label";s:5:"Apply";}i:3;a:4:{s:4:"type";s:10:"buttononly";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:7:"onclick";s:15:"window.close();";}}i:2;a:6:{s:4:"type";s:10:"buttononly";s:5:"label";s:9:"Superuser";s:5:"align";s:5:"right";s:4:"help";s:48:"Enter setup user and password to get root rights";s:7:"onclick";s:121:"set_style_by_class(\'fieldset\',\'superuser\',\'display\',\'inline\'); document.getElementById(form::name(\'sudo[user]\')).focus();";s:4:"name";s:4:"sudo";}}}i:4;a:1:{s:1:"A";a:5:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:5:"label";s:29:"Enter setup user and password";i:1;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"User";s:4:"size";s:13:",,,sudo[user]";}s:1:"B";a:2:{s:4:"type";s:4:"text";s:4:"name";s:10:"sudo[user]";}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:8:"Password";s:4:"size";s:15:",,,sudo[passwd]";}s:1:"B";a:2:{s:4:"type";s:6:"passwd";s:4:"name";s:12:"sudo[passwd]";}}i:3;a:2:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Submit";s:4:"name";s:13:"button[setup]";}}}s:7:"options";a:0:{}s:4:"rows";i:3;s:4:"cols";i:2;}s:4:"span";s:10:",superuser";}}}s:4:"rows";i:4;s:4:"cols";i:1;}}','size' => '','style' => '.eaclAccount select,.eaclRights select { width: 160px; }
|
||||
.superuser {
|
||||
position: absolute;
|
||||
top: 130px;
|
||||
left: 120px;
|
||||
width: 200px;
|
||||
background-color: white;
|
||||
z-index: 1;
|
||||
display: none;
|
||||
}','modified' => '1223224423',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.file.custom','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:1:{s:2:"c1";s:4:",top";}i:1;a:1:{s:1:"A";a:1:{s:4:"type";s:12:"customfields";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:18:"450,300,,,10,,auto";}}','size' => '450,300,,,10,,auto','style' => '','modified' => '1223224487',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.file.eacl','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:4:{s:2:"c1";s:4:",top";s:2:"c2";s:7:",bottom";s:2:"h2";s:11:",!@is_owner";s:2:"h1";s:3:"200";}i:1;a:3:{s:1:"A";a:5:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:4:"span";s:3:"all";s:5:"label";s:28:"Extended access control list";i:1;a:7:{s:4:"type";s:4:"grid";s:4:"size";s:14:"100%,,,,,,auto";s:4:"data";a:3:{i:0;a:7:{s:1:"A";s:2:"80";s:1:"B";s:2:"80";s:1:"D";s:2:"16";s:2:"h2";s:4:",!@1";s:1:"C";s:3:"20%";s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";}i:1;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Owner";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Rights";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:9:"Inherited";}s:1:"D";a:1:{s:4:"type";s:5:"label";}}i:2;a:4:{s:1:"A";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";}s:1:"B";a:3:{s:4:"type";s:6:"select";s:4:"name";s:14:"${row}[rights]";s:8:"readonly";s:1:"1";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[path]";}s:1:"D";a:5:{s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"name";s:39:"delete[$row_cont[ino]-$row_cont[owner]]";s:7:"onclick";s:43:"return confirm(\'Delete this extended ACL\');";}}}s:4:"name";s:4:"eacl";s:4:"rows";i:2;s:4:"cols";i:4;s:7:"options";a:2:{i:0;s:4:"100%";i:6;s:4:"auto";}}}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}}i:2;a:3:{s:1:"A";a:5:{s:4:"type";s:14:"select-account";s:4:"size";s:15:"select one,both";s:4:"name";s:11:"eacl[owner]";s:4:"span";s:12:",eaclAccount";s:5:"label";s:5:"Owner";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"name";s:12:"eacl[rights]";s:4:"span";s:11:",eaclRights";s:5:"label";s:6:"Rights";s:4:"help";s:67:"You can only grant additional rights, you can NOT take rights away!";}s:1:"C";a:3:{s:4:"type";s:6:"button";s:5:"label";s:3:"Add";s:4:"name";s:12:"button[eacl]";}}}s:4:"rows";i:2;s:4:"cols";i:3;s:4:"size";s:12:"450,300,,,10";s:7:"options";a:3:{i:0;s:3:"450";i:1;s:3:"300";i:4;s:2:"10";}}}','size' => '450,300,,,10','style' => '','modified' => '1207724932',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.file.general','template' => '','lang' => '','group' => '0','version' => '1.7.002','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:10:{i:0;a:4:{s:1:"A";s:2:"80";s:2:"h1";s:2:"60";s:2:"h3";s:10:",!@is_link";s:2:"h6";s:9:",@is_link";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:5:"image";s:4:"name";s:4:"icon";s:4:"span";s:9:",mimeHuge";s:5:"align";s:6:"center";}s:1:"B";a:4:{s:4:"type";s:8:"vfs-name";s:4:"name";s:4:"name";s:6:"needed";s:1:"1";s:4:"span";s:9:",fileName";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"hrule";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Link";s:4:"size";s:10:",,,symlink";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"span";s:9:",fileName";s:4:"name";s:7:"symlink";s:8:"readonly";s:1:"1";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:4:"name";s:4:"mime";}}i:5;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:9:"Directory";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:4:"name";s:3:"dir";}}i:6;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Size";}s:1:"B";a:3:{s:4:"type";s:8:"vfs-size";s:4:"name";s:4:"size";s:4:"size";s:1:"1";}}i:7;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Created";}s:1:"B";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:5:"ctime";s:8:"readonly";s:1:"1";}}i:8;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Modified";}s:1:"B";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:5:"mtime";s:8:"readonly";s:1:"1";}}i:9;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:10:",,,comment";s:5:"label";s:7:"Comment";}s:1:"B";a:3:{s:4:"type";s:8:"textarea";s:4:"name";s:7:"comment";s:4:"span";s:8:",comment";}}}s:4:"rows";i:9;s:4:"cols";i:2;s:4:"size";s:12:"450,300,,,10";s:7:"options";a:3:{i:0;s:3:"450";i:1;s:3:"300";i:4;s:2:"10";}}}','size' => '450,300,,,10','style' => '','modified' => '1204554817',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.file.perms','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:4:{i:0;a:1:{s:2:"h3";s:9:",!@is_dir";}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:5:"label";s:12:"Accessrights";i:1;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:6:{i:0;a:3:{s:1:"A";s:2:"80";s:2:"h5";s:2:",1";s:2:"h4";s:8:",@is_dir";}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Owner";}s:1:"B";a:2:{s:4:"type";s:6:"select";s:4:"name";s:12:"perms[owner]";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Group";}s:1:"B";a:2:{s:4:"type";s:6:"select";s:4:"name";s:12:"perms[group]";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Other";}s:1:"B";a:2:{s:4:"type";s:6:"select";s:4:"name";s:12:"perms[other]";}}i:4;a:2:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:5:"label";s:10:"Executable";s:4:"name";s:17:"perms[executable]";}}i:5;a:2:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:5:"label";s:43:"Only owner can rename or delete the content";s:4:"name";s:13:"perms[sticky]";}}}s:4:"rows";i:5;s:4:"cols";i:2;s:7:"options";a:0:{}}}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:5:"label";s:5:"Owner";i:1;a:5:{s:4:"type";s:4:"grid";s:7:"options";a:0:{}s:4:"data";a:3:{i:0;a:1:{s:1:"A";s:2:"80";}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"User";}s:1:"B";a:4:{s:4:"type";s:14:"select-account";s:4:"size";s:13:"root,accounts";s:4:"name";s:3:"uid";s:5:"label";s:12:"@ro_uid_root";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Group";}s:1:"B";a:4:{s:4:"type";s:14:"select-account";s:4:"size";s:11:"root,groups";s:4:"name";s:3:"gid";s:5:"label";s:12:"@ro_gid_root";}}}s:4:"rows";i:2;s:4:"cols";i:2;}}}i:3;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"checkbox";s:5:"label";s:43:"Modify all Subdirectories and their content";s:4:"name";s:11:"modify_subs";}}}s:4:"rows";i:3;s:4:"cols";i:1;s:4:"size";s:12:"450,300,,,10";s:7:"options";a:3:{i:0;s:3:"450";i:1;s:3:"300";i:4;s:2:"10";}}}','size' => '450,300,,,10','style' => '','modified' => '1204567746',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.file.preview','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:4:{i:0;a:5:{s:2:"c1";s:4:",top";s:2:"h1";s:16:",!@mime=/^image/";s:2:"h3";s:22:",@mime=/^(image|text)/";s:2:"h2";s:18:"280,!@text_content";s:2:"c2";s:4:",top";}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:5:"image";s:4:"name";s:4:"link";s:4:"span";s:13:",previewImage";}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"textarea";s:4:"name";s:12:"text_content";s:4:"span";s:12:",previewText";s:8:"readonly";s:1:"1";}}i:3;a:1:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"No preview available";}}}s:4:"rows";i:3;s:4:"cols";i:1;s:4:"size";s:18:"450,300,,,10,,auto";s:7:"options";a:4:{i:0;s:3:"450";i:1;s:3:"300";i:6;s:4:"auto";i:4;s:2:"10";}}}','size' => '450,300,,,10,,auto','style' => '','modified' => '1204567479',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.index','template' => '','lang' => '','group' => '0','version' => '1.9.003','data' => 'a:2:{i:0;a:3:{s:4:"name";s:3:"msg";s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";}i:1;a:3:{s:4:"name";s:2:"nm";s:4:"type";s:9:"nextmatch";s:4:"size";s:53:"filemanager.index.rows,,filemanager.index.header_left";}}','size' => '','style' => 'input[type=\'file\'] {
|
||||
width: 50ex
|
||||
}','modified' => '1365608331',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.index.header_left','template' => '','lang' => '','group' => '0','version' => '1.9.002','data' => 'a:1:{i:0;a:16:{s:4:"span";s:3:"all";s:4:"type";s:4:"hbox";s:4:"size";s:2:"13";i:1;a:4:{s:5:"label";s:2:"Up";s:7:"onclick";s:33:"app.filemanager.change_dir(\'..\');";s:4:"type";s:5:"image";s:4:"name";s:4:"goup";}i:2;a:4:{s:5:"label";s:25:"Go to your home directory";s:7:"onclick";s:32:"app.filemanager.change_dir(\'~\');";s:4:"type";s:5:"image";s:4:"name";s:6:"gohome";}i:3;a:6:{s:5:"label";s:4:"Path";s:8:"onchange";s:12:"return true;";s:4:"name";s:4:"path";s:4:"size";s:2:"80";s:4:"type";s:8:"vfs-name";s:4:"span";s:8:",address";}i:4;a:4:{s:5:"label";s:5:"Go to";s:4:"name";s:10:"button[go]";s:4:"type";s:6:"button";s:4:"size";s:9:"key_enter";}i:5;a:2:{s:4:"type";s:5:"image";s:4:"name";s:15:"buttonseparator";}i:6;a:6:{s:5:"label";s:13:"Edit settings";s:7:"onclick";s:28:"app.filemanager.editprefs();";s:4:"name";s:12:"button[edit]";s:4:"type";s:10:"buttononly";s:4:"size";s:4:"edit";s:4:"help";s:39:"Rename, change permissions or ownership";}i:7;a:5:{s:5:"label";s:16:"Create directory";s:7:"onclick";s:28:"app.filemanager.createdir();";s:4:"name";s:17:"button[createdir]";s:4:"type";s:10:"buttononly";s:4:"size";s:35:"button_createdir,createdir_disabled";}i:8;a:5:{s:5:"label";s:13:"Create a link";s:7:"onclick";s:26:"app.filemanager.symlink();";s:4:"name";s:15:"button[symlink]";s:4:"type";s:10:"buttononly";s:4:"size";s:18:"link,link_disabled";}i:9;a:4:{s:7:"onclick";s:31:"app.filemanager.paste(\'paste\');";s:4:"name";s:13:"button[paste]";s:4:"size";s:28:"editpaste,editpaste_disabled";s:4:"type";s:10:"buttononly";}i:10;a:4:{s:7:"onclick";s:35:"app.filemanager.paste(\'linkpaste\');";s:4:"name";s:17:"button[linkpaste]";s:4:"size";s:28:"linkpaste,linkpaste_disabled";s:4:"type";s:10:"buttononly";}i:11;a:4:{s:7:"onclick";s:35:"app.filemanager.paste(\'mailpaste\');";s:4:"name";s:17:"button[mailpaste]";s:4:"size";s:28:"mailpaste,mailpaste_disabled";s:4:"type";s:10:"buttononly";}i:12;a:4:{s:5:"label";s:11:"File a file";s:7:"onclick";s:171:"window.open(egw::link(\'/index.php\',\'menuaction=stylite.stylite_filemanager.upload\'),\'_blank\',\'dependent=yes,width=550,height=350,scrollbars=yes,status=yes\'); return false;";s:4:"type";s:6:"button";s:4:"size";s:6:"upload";}i:13;a:3:{s:4:"name";s:6:"upload";s:4:"type";s:4:"file";s:4:"help";s:42:"Select file to upload in current directory";}}}','size' => '','style' => '','modified' => '1365608384',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.index.rows','template' => '','lang' => '','group' => '0','version' => '1.7.002','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:6:{s:2:"c1";s:2:"th";s:2:"c2";s:20:"row $row_cont[class]";s:1:"B";s:3:"30%";s:1:"D";s:3:"120";s:1:"E";s:3:"120";s:1:"K";s:2:"70";}i:1;a:11:{s:1:"A";a:4:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Type";s:4:"name";s:4:"mime";s:5:"align";s:6:"center";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Size";s:4:"name";s:4:"size";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Modified";s:4:"name";s:5:"mtime";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Created";s:4:"name";s:5:"ctime";}s:1:"F";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:11:"Permissions";s:4:"name";s:4:"mode";}s:1:"G";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:3:"uid";s:5:"label";s:5:"Owner";}s:1:"H";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:3:"gid";s:5:"label";s:5:"Group";}s:1:"I";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:7:"Comment";s:4:"name";s:7:"comment";}s:1:"J";a:3:{s:4:"type";s:22:"nextmatch-customfields";s:8:"readonly";s:1:"1";s:4:"name";s:12:"customfields";}s:1:"K";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,0,0";i:1;a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:7:"Actions";s:4:"name";s:14:"legacy_actions";}i:2;a:8:{s:4:"type";s:6:"button";s:4:"size";s:5:"check";s:5:"label";s:9:"Check all";s:4:"name";s:9:"check_all";s:4:"help";s:9:"Check all";s:7:"onclick";s:98:"egw_globalObjectManager.getObjectById(\'filemanager.index.rows\').toggleAllSelected(); return false;";s:6:"needed";s:1:"1";s:5:"align";s:5:"right";}}}i:2;a:11:{s:1:"A";a:3:{s:4:"type";s:8:"vfs-mime";s:4:"name";s:4:"$row";s:5:"align";s:6:"center";}s:1:"B";a:4:{s:4:"type";s:8:"vfs-name";s:4:"name";s:12:"${row}[name]";s:7:"no_lang";s:1:"1";s:8:"readonly";s:1:"1";}s:1:"C";a:3:{s:4:"type";s:8:"vfs-size";s:4:"name";s:12:"${row}[size]";s:5:"align";s:5:"right";}s:1:"D";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:13:"${row}[mtime]";s:8:"readonly";s:1:"1";}s:1:"E";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:13:"${row}[ctime]";s:8:"readonly";s:1:"1";}s:1:"F";a:2:{s:4:"type";s:8:"vfs-mode";s:4:"name";s:12:"${row}[mode]";}s:1:"G";a:3:{s:4:"type";s:7:"vfs-uid";s:4:"name";s:11:"${row}[uid]";s:7:"no_lang";s:1:"1";}s:1:"H";a:3:{s:4:"type";s:7:"vfs-gid";s:4:"name";s:11:"${row}[gid]";s:7:"no_lang";s:1:"1";}s:1:"I";a:2:{s:4:"type";s:5:"label";s:4:"name";s:15:"${row}[comment]";}s:1:"J";a:3:{s:4:"type";s:17:"customfields-list";s:4:"name";s:4:"$row";s:4:"span";s:13:",customfields";}s:1:"K";a:7:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"4";i:1;a:6:{s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:5:"label";s:13:"Edit settings";s:4:"name";s:21:"edit[$row_cont[path]]";s:4:"help";s:39:"Rename, change permissions or ownership";s:7:"onclick";s:192:"window.open(egw::link(\'/index.php\',\'menuaction=filemanager.filemanager_ui.file&path=$row_cont[path]\'),\'fileprefs\',\'dependent=yes,width=495,height=425,scrollbars=yes,status=yes\'); return false;";}i:2;a:5:{s:4:"type";s:10:"buttononly";s:4:"size";s:12:"mail_post_to";s:4:"name";s:21:"mail[$row_cont[path]]";s:7:"onclick";s:43:"open_mail(\'$row_cont[path]\'); return false;";s:5:"align";s:6:"center";}i:3;a:7:{s:4:"type";s:6:"button";s:4:"name";s:23:"delete[$row_cont[path]]";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"help";s:29:"Delete this file or directory";s:7:"onclick";s:48:"return confirm(\'Delete this file or directory\');";s:5:"align";s:6:"center";}s:5:"align";s:5:"right";i:4;a:4:{s:4:"type";s:8:"checkbox";s:4:"name";s:9:"checked[]";s:5:"align";s:5:"right";s:4:"size";s:17:""$row_cont[path]"";}}}}s:4:"rows";i:2;s:4:"cols";i:11;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1259329664',);
|
||||
|
||||
$templ_data[] = array('name' => 'filemanager.search','template' => '','lang' => '','group' => '0','version' => '1.3.001','data' => 'a:4:{i:0;a:9:{s:4:"type";s:8:"groupbox";s:4:"name";s:10:"debuginfos";s:4:"size";s:1:"4";s:5:"label";s:10:"Debuginfos";s:8:"disabled";s:1:"1";i:1;a:3:{s:4:"type";s:8:"textarea";s:4:"name";s:7:"message";s:8:"readonly";s:1:"1";}i:2;a:1:{s:4:"type";s:5:"label";}i:3;a:1:{s:4:"type";s:5:"label";}i:4;a:1:{s:4:"type";s:5:"label";}}i:1;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:2:{s:1:"C";s:3:"120";s:1:"D";s:3:"120";}i:1;a:5:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:12:"searchstring";s:4:"name";s:17:"searchstringlabel";}s:1:"B";a:3:{s:4:"type";s:4:"text";s:4:"span";s:1:"2";s:4:"name";s:12:"searchstring";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:3:{s:4:"type";s:6:"button";s:5:"label";s:12:"start search";s:4:"name";s:12:"start_search";}s:1:"E";a:1:{s:4:"type";s:5:"label";}}i:2;a:5:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:9:"mime type";}s:1:"B";a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:8:"checkall";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:5:"label";s:3:"All";s:4:"name";s:8:"alllabel";}s:1:"D";a:4:{s:4:"type";s:5:"label";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"checkbox";s:5:"label";s:5:"files";s:4:"name";s:14:"checkonlyfiles";}}}s:4:"rows";i:1;s:4:"cols";i:1;}s:1:"E";a:1:{s:4:"type";s:5:"label";}}i:3;a:5:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:14:"checkonlyfiles";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:5:"label";s:5:"files";s:4:"name";s:9:"filelabel";}s:1:"D";a:4:{s:4:"type";s:6:"button";s:5:"label";s:12:"clear search";s:4:"name";s:12:"clear_search";s:7:"onclick";s:71:"menuaction=filemanager.uifilemanager.index&action=search&actioncd=clear";}s:1:"E";a:1:{s:4:"type";s:5:"label";}}i:4;a:5:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:13:"checkonlydirs";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:5:"label";s:9:"directory";s:4:"name";s:8:"dirlabel";}s:1:"D";a:4:{s:4:"type";s:8:"checkbox";s:5:"label";s:5:"Debug";s:4:"name";s:5:"debug";s:8:"disabled";s:1:"1";}s:1:"E";a:1:{s:4:"type";s:5:"label";}}i:5;a:5:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:15:"created between";s:4:"name";s:12:"createdlabel";}s:1:"B";a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:13:"searchcreated";}s:1:"C";a:3:{s:4:"type";s:4:"date";s:4:"name";s:15:"datecreatedfrom";s:4:"size";s:2:",8";}s:1:"D";a:3:{s:4:"type";s:4:"date";s:4:"name";s:13:"datecreatedto";s:4:"size";s:2:",8";}s:1:"E";a:4:{s:4:"type";s:8:"textarea";s:4:"name";s:17:"searchcreatedtext";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";}}i:6;a:5:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:16:"modified between";s:4:"name";s:13:"modifiedlabel";}s:1:"B";a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:14:"searchmodified";}s:1:"C";a:3:{s:4:"type";s:4:"date";s:4:"name";s:16:"datemodifiedfrom";s:4:"size";s:2:",8";}s:1:"D";a:3:{s:4:"type";s:4:"date";s:4:"name";s:14:"datemodifiedto";s:4:"size";s:2:",8";}s:1:"E";a:4:{s:4:"type";s:8:"textarea";s:4:"name";s:18:"searchmodifiedtext";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";}}}s:4:"rows";i:6;s:4:"cols";i:5;}i:2;a:1:{s:4:"type";s:5:"hrule";}i:3;a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:4:"rows";s:4:"name";s:2:"nm";}}','size' => '','style' => '','modified' => '1173101430',);
|
||||
|
||||
$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.9.002','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:8:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"6";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:2:{s:4:"type";s:6:"hidden";s:4:"name";s:4:"path";}i:6;a:6:{s:4:"type";s:6:"button";s:4:"name";s:17:"button[createdir]";s:4:"size";s:35:"button_createdir,createdir_disabled";s:5:"label";s:16:"Create directory";s:7:"onclick";s:129:"var dir = prompt(egw::lang(\'New directory\')); if (!dir) return false; document.getElementById(form::name(\'path\')).value+=\'/\'+dir;";s:4:"span";s:10:",createDir";}}}i:2;a:1:{s:1:"A";a:7:{s:4:"type";s:4:"grid";s:4:"size";s:14:"100%,,,,,,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:4:"$row";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:2:{i:0;s:4:"100%";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;}
|
||||
.createDir img {padding-right:30px;}','modified' => '1341261799',);
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
$setup_info['filemanager']['name'] = 'filemanager';
|
||||
$setup_info['filemanager']['title'] = 'Filemanager';
|
||||
$setup_info['filemanager']['version'] = '14.1';
|
||||
$setup_info['filemanager']['version'] = '16.1';
|
||||
$setup_info['filemanager']['app_order'] = 6;
|
||||
$setup_info['filemanager']['enable'] = 1;
|
||||
$setup_info['filemanager']['index'] = 'filemanager.filemanager_ui.index&ajax=true';
|
||||
@ -32,10 +32,6 @@ $setup_info['filemanager']['hooks']['search_link'] = 'filemanager_hooks::search_
|
||||
|
||||
/* Dependencies for this app to work */
|
||||
$setup_info['filemanager']['depends'][] = array(
|
||||
'appname' => 'phpgwapi',
|
||||
'versions' => array('14.1')
|
||||
);
|
||||
$setup_info['filemanager']['depends'][] = array(
|
||||
'appname' => 'etemplate',
|
||||
'versions' => array('14.1')
|
||||
'appname' => 'api',
|
||||
'versions' => array('16.1')
|
||||
);
|
||||
|
@ -1,75 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* eGroupWare - Filemanager - test script
|
||||
* EGroupware - Filemanager - test script
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @package filemanager
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @copyright (c) 2009-13 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @copyright (c) 2009-16 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
use EGroupware\Api;
|
||||
use EGroupware\Api\Vfs;
|
||||
|
||||
$GLOBALS['egw_info']['flags'] = array(
|
||||
'currentapp' => 'filemanager'
|
||||
);
|
||||
include('../header.inc.php');
|
||||
|
||||
if (!($path = egw_cache::getSession('filemanger','test')))
|
||||
if (!($path = Api\Cache::getSession('filemanger','test')))
|
||||
{
|
||||
$path = '/home/'.$GLOBALS['egw_info']['user']['account_lid'];
|
||||
}
|
||||
if (isset($_REQUEST['path'])) $path = $_REQUEST['path'];
|
||||
echo html::form("<p>Path: ".html::input('path',$path,'text','size="40"').
|
||||
html::submit_button('',lang('Submit'))."</p>\n",array(),'','','','','GET');
|
||||
echo Api\Html::form("<p>Path: ".Api\Html::input('path',$path,'text','size="40"').
|
||||
Api\Html::submit_button('',lang('Submit'))."</p>\n",array(),'','','','','GET');
|
||||
|
||||
if (isset($path) && !empty($path))
|
||||
{
|
||||
if ($path[0] != '/')
|
||||
{
|
||||
throw new egw_exception_wrong_userinput('Not an absolute path!');
|
||||
throw new Api\Exception\WrongUserinput('Not an absolute path!');
|
||||
}
|
||||
egw_cache::setSession('filemanger','test',$path);
|
||||
Api\Cache::setSession('filemanger','test',$path);
|
||||
|
||||
echo "<h2>";
|
||||
foreach(explode('/',$path) as $n => $part)
|
||||
{
|
||||
$p .= ($p != '/' ? '/' : '').$part;
|
||||
echo ($n > 1 ? ' / ' : '').html::a_href($n ? $part : ' / ','/filemanager/test.php',array('path'=>$p));
|
||||
echo ($n > 1 ? ' / ' : '').Api\Html::a_href($n ? $part : ' / ','/filemanager/test.php',array('path'=>$p));
|
||||
}
|
||||
echo "</h2>\n";
|
||||
|
||||
echo "<p><b>egw_vfs::propfind('$path')</b>=".array2string(egw_vfs::propfind($path))."</p>\n";
|
||||
echo "<p><b>egw_vfs::resolve_url('$path')</b>=".array2string(egw_vfs::resolve_url($path))."</p>\n";
|
||||
echo "<p><b>egw_vfs::propfind('$path')</b>=".array2string(Vfs::propfind($path))."</p>\n";
|
||||
echo "<p><b>egw_vfs::resolve_url('$path')</b>=".array2string(Vfs::resolve_url($path))."</p>\n";
|
||||
|
||||
$is_dir = egw_vfs::is_dir($path);
|
||||
$is_dir = Vfs::is_dir($path);
|
||||
echo "<p><b>is_dir('$path')</b>=".array2string($is_dir)."</p>\n";
|
||||
|
||||
$time = microtime(true);
|
||||
$stat = egw_vfs::stat($path);
|
||||
$stat = Vfs::stat($path);
|
||||
$stime = number_format(1000*(microtime(true)-$time),1);
|
||||
|
||||
$time = microtime(true);
|
||||
if ($is_dir)// && ($d = egw_vfs::opendir($path)))
|
||||
$time2 = microtime(true);
|
||||
if ($is_dir)// && ($d = Vfs::opendir($path)))
|
||||
{
|
||||
$files = array();
|
||||
//while(($file = readdir($d)))
|
||||
foreach(egw_vfs::scandir($path) as $file)
|
||||
foreach(Vfs::scandir($path) as $file)
|
||||
{
|
||||
if (egw_vfs::is_readable($fpath=egw_vfs::concat($path,$file)))
|
||||
if (Vfs::is_readable($fpath=Vfs::concat($path,$file)))
|
||||
{
|
||||
$file = html::a_href($file,'/filemanager/test.php',array('path'=>$fpath));
|
||||
$file = Api\Html::a_href($file,'/filemanager/test.php',array('path'=>$fpath));
|
||||
}
|
||||
$file .= ' ('.egw_vfs::mime_content_type($fpath).')';
|
||||
$file .= ' ('.Vfs::mime_content_type($fpath).')';
|
||||
$files[] = $file;
|
||||
}
|
||||
//closedir($d);
|
||||
$time = number_format(1000*(microtime(true)-$time),1);
|
||||
echo "<p>".($files ? 'Directory' : 'Empty directory')." took $time ms</p>\n";
|
||||
$time2f = number_format(1000*(microtime(true)-$time2),1);
|
||||
echo "<p>".($files ? 'Directory' : 'Empty directory')." took $time2f ms</p>\n";
|
||||
if($files) echo '<ol><li>'.implode("</li>\n<li>",$files).'</ol>'."\n";
|
||||
}
|
||||
|
||||
echo "<p><b>stat('$path')</b> took $stime ms (mode = ".(isset($stat['mode'])?sprintf('%o',$stat['mode']).' = '.egw_vfs::int2mode($stat['mode']):'NULL').')';
|
||||
echo "<p><b>stat('$path')</b> took $stime ms (mode = ".(isset($stat['mode'])?sprintf('%o',$stat['mode']).' = '.Vfs::int2mode($stat['mode']):'NULL').')';
|
||||
if (is_array($stat))
|
||||
{
|
||||
_debug_array($stat);
|
||||
@ -79,15 +82,15 @@ if (isset($path) && !empty($path))
|
||||
echo "<p>".array2string($stat)."</p>\n";
|
||||
}
|
||||
|
||||
echo "<p><b>egw_vfs::is_readable('$path')</b>=".array2string(egw_vfs::is_readable($path))."</p>\n";
|
||||
echo "<p><b>egw_vfs::is_writable('$path')</b>=".array2string(egw_vfs::is_writable($path))."</p>\n";
|
||||
echo "<p><b>egw_vfs::is_readable('$path')</b>=".array2string(Vfs::is_readable($path))."</p>\n";
|
||||
echo "<p><b>egw_vfs::is_writable('$path')</b>=".array2string(Vfs::is_writable($path))."</p>\n";
|
||||
|
||||
echo "<p><b>is_link('$path')</b>=".array2string(egw_vfs::is_link($path))."</p>\n";
|
||||
echo "<p><b>readlink('$path')</b>=".array2string(egw_vfs::readlink($path))."</p>\n";
|
||||
$time = microtime(true);
|
||||
$lstat = egw_vfs::lstat($path);
|
||||
$time = number_format(1000*(microtime(true)-$time),1);
|
||||
echo "<p><b>lstat('$path')</b> took $time ms (mode = ".(isset($lstat['mode'])?sprintf('%o',$lstat['mode']).' = '.egw_vfs::int2mode($lstat['mode']):'NULL').')';
|
||||
echo "<p><b>is_link('$path')</b>=".array2string(Vfs::is_link($path))."</p>\n";
|
||||
echo "<p><b>readlink('$path')</b>=".array2string(Vfs::readlink($path))."</p>\n";
|
||||
$time3 = microtime(true);
|
||||
$lstat = Vfs::lstat($path);
|
||||
$time3f = number_format(1000*(microtime(true)-$time3),1);
|
||||
echo "<p><b>lstat('$path')</b> took $time3f ms (mode = ".(isset($lstat['mode'])?sprintf('%o',$lstat['mode']).' = '.Vfs::int2mode($lstat['mode']):'NULL').')';
|
||||
if (is_array($lstat))
|
||||
{
|
||||
_debug_array($lstat);
|
||||
@ -98,9 +101,9 @@ if (isset($path) && !empty($path))
|
||||
}
|
||||
if (!$is_dir && $stat)
|
||||
{
|
||||
echo "<p><b>egw_vfs::mime_content_type('$path')</b>=".array2string(egw_vfs::mime_content_type($path))."</p>\n";
|
||||
echo "<p><b>filesize(egw_vfs::PREFIX.'$path')</b>=".array2string(filesize(egw_vfs::PREFIX.$path))."</p>\n";
|
||||
echo "<p><b>bytes(file_get_contents(egw_vfs::PREFIX.'$path'))</b>=".array2string(bytes(file_get_contents(egw_vfs::PREFIX.$path)))."</p>\n";
|
||||
echo "<p><b>egw_vfs::mime_content_type('$path')</b>=".array2string(Vfs::mime_content_type($path))."</p>\n";
|
||||
echo "<p><b>filesize(Vfs::PREFIX.'$path')</b>=".array2string(filesize(Vfs::PREFIX.$path))."</p>\n";
|
||||
echo "<p><b>bytes(file_get_contents(Vfs::PREFIX.'$path'))</b>=".array2string(bytes(file_get_contents(Vfs::PREFIX.$path)))."</p>\n";
|
||||
}
|
||||
}
|
||||
$GLOBALS['egw']->common->egw_footer();
|
||||
$GLOBALS['egw']->framework->footer();
|
||||
|
Loading…
Reference in New Issue
Block a user