"- show filemanager prefs only if user has access to prefs app

- returning settings instead of using global var
- docu upate"
This commit is contained in:
Ralf Becker 2009-05-29 10:48:19 +00:00
parent 613e56e8b7
commit 31ad0b0480

View File

@ -58,12 +58,14 @@ class filemanager_hooks
} }
display_sidebox(self::$appname,$title,$file); display_sidebox(self::$appname,$title,$file);
} }
self::preferences(self::$appname); if ($GLOBALS['egw_info']['user']['apps']['preferences']) self::preferences(self::$appname);
if ($GLOBALS['egw_info']['user']['apps']['admin']) self::admin(self::$appname); if ($GLOBALS['egw_info']['user']['apps']['admin']) self::admin(self::$appname);
} }
/** /**
* Entries for filemanagers's admin menu * Entries for filemanagers's admin menu
*
* @param string|array $location ='admin' hook name or params
*/ */
static function admin($location = 'admin') static function admin($location = 'admin')
{ {
@ -81,6 +83,11 @@ class filemanager_hooks
} }
} }
/**
* Entries for filemanagers's preferences menu
*
* @param string|array $location ='preferences' hook name or params
*/
static function preferences($location = 'preferences') static function preferences($location = 'preferences')
{ {
$file = array( $file = array(
@ -96,6 +103,11 @@ class filemanager_hooks
} }
} }
/**
* Settings for preferences
*
* @return array with settings
*/
static function settings() static function settings()
{ {
$config = config::read(self::$appname); $config = config::read(self::$appname);
@ -113,7 +125,7 @@ class filemanager_hooks
'yes' => lang('Yes') 'yes' => lang('Yes')
); );
$GLOBALS['settings'] = array( $settings = array(
'showbase' => array( 'showbase' => array(
'type' => 'select', 'type' => 'select',
'name' => 'showbase', 'name' => 'showbase',
@ -133,19 +145,10 @@ class filemanager_hooks
'xmlrpc' => True, 'xmlrpc' => True,
'amin' => False 'amin' => False
), ),
# 'show_upload_boxes' => array(
# 'type' => 'select',
# 'label' => 'Default number of upload fields to show',
# 'name' => 'show_upload_boxes',
# 'values' => $upload_boxes,
# 'help' => 'How many upload slots should be available for uploading files? (The boxes are displayed at the bottom of the file listing)',
# 'xmlrpc' => True,
# 'admin' => False
# ),
); );
for ($i=1; $i <= self::$foldercount; $i++) for ($i=1; $i <= self::$foldercount; $i++)
{ {
$GLOBALS['settings']['folderlink'.$i] = array( $settings['folderlink'.$i] = array(
'type' => 'input', 'type' => 'input',
'name' => 'folderlink'.$i, 'name' => 'folderlink'.$i,
'size' => 60, 'size' => 60,
@ -155,6 +158,6 @@ class filemanager_hooks
'amin' => False 'amin' => False
); );
} }
return true; return $settings;
} }
} }