[eGroupWare-svn] r56025 - in /trunk/filemanager: ./ inc/ setup/
[email protected] Thu, 05 May 2016 07:20:08 -0000
| Newsgroups | gmane.comp.web.egroupware.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: ralfbecker
Date: Thu May 5 09:20:07 2016
New Revision: 56025
URL: http://svn.stylite.de/viewvc/egroupware?rev=56025&view=rev
Log:
use new api in filemanager
Removed:
trunk/filemanager/setup/etemplates.inc.php
Modified:
trunk/filemanager/cli.php
trunk/filemanager/inc/class.filemanager_admin.inc.php
trunk/filemanager/inc/class.filemanager_hooks.inc.php
trunk/filemanager/inc/class.filemanager_merge.inc.php
trunk/filemanager/inc/class.filemanager_select.inc.php
trunk/filemanager/inc/class.filemanager_shares.inc.php
trunk/filemanager/inc/class.filemanager_ui.inc.php
trunk/filemanager/setup/setup.inc.php
trunk/filemanager/test.php
Modified: trunk/filemanager/cli.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/cli.php?rev=56025&r1=56024&r2=56025&view=diff
==============================================================================
--- trunk/filemanager/cli.php (original)
+++ trunk/filemanager/cli.php Thu May 5 09:20:07 2016
@@ -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
@@ -12,6 +12,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
@@ -190,16 +193,16 @@
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 @@
}
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 @@
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 @@
}
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 @@
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 @@
$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 @@
{
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 @@
{
$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 @@
$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 @@
{
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 @@
{
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 @@
// 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 @@
$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 @@
}
if ($argc == 1)
{
- foreach(egw_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' : '-');
+ foreach(Vfs::get_eacl($url) as $acl)
+ {
+ $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 @@
{
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;
- }
- }
- }
- if (!egw_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";
+ case 'x': $argv[1] |= Vfs::EXECUTABLE; break;
+ case 'w': $argv[1] |= Vfs::WRITABLE; break;
+ case 'r': $argv[1] |= Vfs::READABLE; break;
+ }
+ }
+ }
+ 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";
}
}
@@ -629,7 +632,7 @@
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 @@
if (class_exists('egw_vfs'))
{
- $perms = egw_vfs::int2mode($stat['mode']);
+ $perms = Vfs::int2mode($stat['mode']);
}
else
{
@@ -680,7 +683,7 @@
$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 @@
{
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 @@
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 @@
}
$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 @@
{
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 _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 @@
}
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);
}
Modified: trunk/filemanager/inc/class.filemanager_admin.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/inc/class.filemanager_admin.inc.php?rev=56025&r1=56024&r2=56025&view=diff
==============================================================================
--- trunk/filemanager/inc/class.filemanager_admin.inc.php (original)
+++ trunk/filemanager/inc/class.filemanager_admin.inc.php Thu May 5 09:20:07 2016
@@ -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 @@
// 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 @@
}
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 @@
}
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 @@
$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 @@
!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 @@
{
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);
Modified: trunk/filemanager/inc/class.filemanager_hooks.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/inc/class.filemanager_hooks.inc.php?rev=56025&r1=56024&r2=56025&view=diff
==============================================================================
--- trunk/filemanager/inc/class.filemanager_hooks.inc.php (original)
+++ trunk/filemanager/inc/class.filemanager_hooks.inc.php Thu May 5 09:20:07 2016
@@ -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 @@
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 @@
// 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 @@
// 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 @@
}
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['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['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');
display_sidebox(self::$appname,$title,$file);
}
if ($GLOBALS['egw_info']['user']['apps']['admin']) self::admin(self::$appname);
@@ -93,10 +98,10 @@
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 @@
*/
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 @@
'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 @@
'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 @@
/**
* 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 @@
'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',
Modified: trunk/filemanager/inc/class.filemanager_merge.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/inc/class.filemanager_merge.inc.php?rev=56025&r1=56024&r2=56025&view=diff
==============================================================================
--- trunk/filemanager/inc/class.filemanager_merge.inc.php (original)
+++ trunk/filemanager/inc/class.filemanager_merge.inc.php Thu May 5 09:20:07 2016
@@ -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 @@
$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 @@
public function filemanager_replacements($id,$prefix='', &$content = null)
{
$info = array();
- $file = egw_vfs::lstat($id,true);
-
- $file['mtime'] = egw_time::to($file['mtime']);
- $file['ctime'] = egw_time::to($file['ctime']);
-
- $file['name'] = egw_vfs::basename($id);
- $file['dir'] = egw_vfs::decodePath(egw_vfs::dirname($id));
+ $file = Vfs::lstat($id,true);
+
+ $file['mtime'] = Api\DateTime::to($file['mtime']);
+ $file['ctime'] = Api\DateTime::to($file['ctime']);
+
+ $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)))
- {
- $file['symlink'] = egw_vfs::readlink($id);
+ if (($file['is_link'] = Vfs::is_link($id)))
+ {
+ $file['symlink'] = Vfs::readlink($id);
}
// Custom fields
if($content && strpos($content, '#') !== 0)
@@ -123,7 +127,7 @@
// 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 @@
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 @@
// 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 @@
}
}
}
- $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 @@
$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 @@
}
/**
- * 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 @@
}
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 @@
echo "</table>\n";
- common::egw_footer();
+ $GLOBALS['egw']->framework->footer();
}
}
Modified: trunk/filemanager/inc/class.filemanager_select.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/inc/class.filemanager_select.inc.php?rev=56025&r1=56024&r2=56025&view=diff
==============================================================================
--- trunk/filemanager/inc/class.filemanager_select.inc.php (original)
+++ trunk/filemanager/inc/class.filemanager_select.inc.php Thu May 5 09:20:07 2016
@@ -1,14 +1,21 @@
<?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 @@
// 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 @@
$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 @@
{
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 @@
{
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 @@
{
//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']);
-
- $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);
+ $content['name'] = Vfs::encodePathComponent($content['file_upload']['name']);
+ $to_path = Vfs::concat($content['path'],$content['name']);
+
+ $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 @@
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 @@
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 @@
}
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'))
- {
- $response = egw_json_response::get();
+ if(Api\Json\Response::isJSONResponse() && !($content['method'] == 'ckeditor_return'))
+ {
+ $response = Api\Json\Response::get();
if($js)
{
$response->script($js);
@@ -205,10 +212,10 @@
}
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 @@
//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 @@
// 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 @@
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 @@
++$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 @@
{
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 @@
}
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 @@
// 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 @@
{
$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']);
Modified: trunk/filemanager/inc/class.filemanager_shares.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/inc/class.filemanager_shares.inc.php?rev=56025&r1=56024&r2=56025&view=diff
==============================================================================
--- trunk/filemanager/inc/class.filemanager_shares.inc.php (original)
+++ trunk/filemanager/inc/class.filemanager_shares.inc.php Thu May 5 09:20:07 2016
@@ -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 @@
{
$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 @@
);
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);
}
}
Modified: trunk/filemanager/inc/class.filemanager_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/inc/class.filemanager_ui.inc.php?rev=56025&r1=56024&r2=56025&view=diff
==============================================================================
--- trunk/filemanager/inc/class.filemanager_ui.inc.php (original)
+++ trunk/filemanager/inc/class.filemanager_ui.inc.php Thu May 5 09:20:07 2016
@@ -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 @@
// 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 @@
$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 @@
*/
function listview(array $content=null,$msg=null)
{
- $tpl = new Api\Etemplate('filemanager.index');
-
- if($msg) egw_framework::message($msg);
+ $tpl = new Etemplate('filemanager.index');
+
+ 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 @@
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 @@
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 @@
$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 @@
{
// 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 @@
*/
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 @@
$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 @@
}
}
}
- 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 @@
$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 @@
}
}
}
- 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 @@
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)
{
Modified: trunk/filemanager/setup/setup.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/setup/setup.inc.php?rev=56025&r1=56024&r2=56025&view=diff
==============================================================================
--- trunk/filemanager/setup/setup.inc.php (original)
+++ trunk/filemanager/setup/setup.inc.php Thu May 5 09:20:07 2016
@@ -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 @@
/* Dependencies for this app to work */
$setup_info['filemanager']['depends'][] = array(
- 'appname' => 'phpgwapi',
- 'versions' => array('14.1')
+ 'appname' => 'api',
+ 'versions' => array('16.1')
);
-$setup_info['filemanager']['depends'][] = array(
- 'appname' => 'etemplate',
- 'versions' => array('14.1')
-);
Modified: trunk/filemanager/test.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/test.php?rev=56025&r1=56024&r2=56025&view=diff
==============================================================================
--- trunk/filemanager/test.php (original)
+++ trunk/filemanager/test.php Thu May 5 09:20:07 2016
@@ -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 @@
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 (!$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();
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z