From c01925959a66e73feb3e1cc7fd97b7e0d52f3d8c Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Wed, 7 Sep 2005 09:24:13 +0000 Subject: [PATCH] display "grant access" link only when we have NOT user grants disabled --- addressbook/inc/hook_preferences.inc.php | 15 ++++++++------- addressbook/inc/hook_sidebox_menu.inc.php | 11 ++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/addressbook/inc/hook_preferences.inc.php b/addressbook/inc/hook_preferences.inc.php index a25ba9023b..e899cc8bcb 100644 --- a/addressbook/inc/hook_preferences.inc.php +++ b/addressbook/inc/hook_preferences.inc.php @@ -12,14 +12,15 @@ /* $Id$ */ { -// Only Modify the $file and $title variables..... + // Only Modify the $file and $title variables..... $title = $appname; - $file = Array( - 'Preferences' => $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.preferences'), - 'Grant Access' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname), - 'Edit Categories' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app='.$appname . '&cats_level=True&global_cats=True') - ); -//Do not modify below this line + $file = array(); + $file['Preferences'] = $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.preferences'); + if(!$GLOBALS['egw_info']['server']['deny_user_grants_access']) + $file['Grant Access'] = $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname); + $file['Edit Categories'] = $GLOBALS['egw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app='.$appname . '&cats_level=True&global_cats=True'); + + //Do not modify below this line display_section($appname,$title,$file); } ?> diff --git a/addressbook/inc/hook_sidebox_menu.inc.php b/addressbook/inc/hook_sidebox_menu.inc.php index a318b8f07b..3a6be2f890 100644 --- a/addressbook/inc/hook_sidebox_menu.inc.php +++ b/addressbook/inc/hook_sidebox_menu.inc.php @@ -35,11 +35,12 @@ if($GLOBALS['egw_info']['user']['apps']['preferences']) { $menu_title = lang('Preferences'); - $file = Array( - 'Addressbook preferences'=>$GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.preferences'), - 'Grant Access'=>$GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app=addressbook'), - 'Edit Categories' =>$GLOBALS['egw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=addressbook&cats_level=True&global_cats=True') - ); + $file = array(); + $file['Addressbook preferences'] = $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.preferences'); + if(!$GLOBALS['egw_info']['server']['deny_user_grants_access']) + $file['Grant Access'] = $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app=addressbook'); + $file['Edit Categories'] = $GLOBALS['egw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=addressbook&cats_level=True&global_cats=True'); + display_sidebox($appname,$menu_title,$file); }