From af026d125ecf298bdae7270c74befeb48943712c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 29 May 2009 10:51:39 +0000 Subject: [PATCH] - showing preferences only if user has rights from preferences app (gives 'permission denied' if user clicks on it otherwise) - docu update --- .../inc/class.filemanager_hooks.inc.php | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/filemanager/inc/class.filemanager_hooks.inc.php b/filemanager/inc/class.filemanager_hooks.inc.php index 7509965e76..02e178141f 100644 --- a/filemanager/inc/class.filemanager_hooks.inc.php +++ b/filemanager/inc/class.filemanager_hooks.inc.php @@ -58,12 +58,14 @@ class filemanager_hooks } 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); } /** * Entries for filemanagers's admin menu + * + * @param string|array $location ='admin' hook name or params */ 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') { $file = array( @@ -96,6 +103,11 @@ class filemanager_hooks } } + /** + * Settings for preferences + * + * @return boolean true + */ static function settings() { $config = config::read(self::$appname); @@ -113,7 +125,7 @@ class filemanager_hooks 'yes' => lang('Yes') ); - $GLOBALS['settings'] = array( + $GLOBALS['settings'] = array( 'showbase' => array( 'type' => 'select', 'name' => 'showbase', @@ -133,15 +145,6 @@ class filemanager_hooks 'xmlrpc' => True, '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++) {