From 84fe7ae30896681d0178b2309842a2cbb2ce2458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Wei=C3=9F?= Date: Wed, 23 Feb 2005 11:48:59 +0000 Subject: [PATCH] add sideboxmenu --- resources/TODO | 1 - .../class.admin_prefs_sidebox_hooks.inc.php | 79 +++++++++++++++++++ resources/inc/hook_admin.inc.php | 27 ------- resources/setup/etemplates.inc.php | 2 +- resources/setup/setup.inc.php | 5 +- 5 files changed, 84 insertions(+), 30 deletions(-) create mode 100644 resources/inc/class.admin_prefs_sidebox_hooks.inc.php delete mode 100755 resources/inc/hook_admin.inc.php diff --git a/resources/TODO b/resources/TODO index b1727549b2..712dd72219 100644 --- a/resources/TODO +++ b/resources/TODO @@ -17,7 +17,6 @@ TODO: -edit / add add accessories functionality bug: loose html and picture on tab-switch (eTemplate bug --> Ralf) - use eTemplates input validation if only one cat is present --> chose it (eTemplate patch sent!) make some returnmessages js dialogs diff --git a/resources/inc/class.admin_prefs_sidebox_hooks.inc.php b/resources/inc/class.admin_prefs_sidebox_hooks.inc.php new file mode 100644 index 0000000000..7f3d0bae75 --- /dev/null +++ b/resources/inc/class.admin_prefs_sidebox_hooks.inc.php @@ -0,0 +1,79 @@ + * + * Changes for resources by Cornelius Weiß * + * * + * ------------------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id$ */ + +class admin_prefs_sidebox_hooks +{ + function all_hooks($args) + { + $appname = 'resources'; + $location = is_array($args) ? $args['location'] : $args; + + if ($location == 'sidebox_menu') + { + $file = array( + 'resources list' => $GLOBALS['phpgw']->link('/index.php',array( + 'menuaction' => 'resources.ui_resources.index' )), + 'add' => $GLOBALS['phpgw']->link('/index.php',array( + 'menuaction' => 'resources.ui_resources.edit' )) + ); + display_sidebox($appname,$GLOBALS['phpgw_info']['apps']['resources']['title'].' '.lang('Menu'),$file); + } + +/* if ($GLOBALS['phpgw_info']['user']['apps']['preferences'] && $location != 'admin') + { + $file = array( + 'Preferences' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname), + 'Grant Access' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname), + 'Edit Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=' . $appname . '&cats_level=True&global_cats=True') + ); + if ($location == 'preferences') + { + display_section($appname,$file); + } + else + { + display_sidebox($appname,lang('Preferences'),$file); + } + } +*/ + if ($GLOBALS['phpgw_info']['user']['apps']['admin'] && $location != 'preferences') + { + $file = Array( + 'Site configuration' => $GLOBALS['phpgw']->link('/index.php',array( + 'menuaction' => 'resources.ui_resources.admin' )), + 'Global Categories' => $GLOBALS['phpgw']->link('/index.php',array( + 'menuaction' => 'admin.uicategories.index', + 'appname' => $appname, + 'global_cats'=> True)), + 'Configure Access Permissions' => $GLOBALS['phpgw']->link('/index.php', + 'menuaction=resources.ui_acl.acllist') +// 'Custom fields, typ and status' => $GLOBALS['phpgw']->link('/index.php',array( +// 'menuaction' => 'infolog.uicustomfields.edit')), +// 'CSV-Import' => $GLOBALS['phpgw']->link('/infolog/csv_import.php') + ); + if ($location == 'admin') + { + display_section($appname,$file); + } + else + { + display_sidebox($appname,lang('Admin'),$file); + } + } + } +} + +?> diff --git a/resources/inc/hook_admin.inc.php b/resources/inc/hook_admin.inc.php deleted file mode 100755 index 6b2461d2c9..0000000000 --- a/resources/inc/hook_admin.inc.php +++ /dev/null @@ -1,27 +0,0 @@ - * - * -------------------------------------------- * - * This program is free software; you can redistribute it and/or modify it * - * under the terms of the GNU General Public License as published by the * - * Free Software Foundation; either version 2 of the License, or (at your * - * option) any later version. * - \**************************************************************************/ - /* $Id$ */ - -//$file['Site Configuration'] = $GLOBALS['phpgw']->link('/index.php', array(menuaction => 'myapp.uiobj.admin_method'); -//display_section('myapp',$file); - - { - $file = Array - ( - 'Global Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname), - 'Configure Access Permissions' => $GLOBALS['phpgw']->link('/index.php','menuaction=resources.ui_acl.acllist'), -// 'eGW SMF bridge' => $GLOBALS['phpgw']->link('/index.php','menuaction=resources.ui_smfbridge.egw2smf') - //'Configure RSS exports' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiexport.exportlist'), - ); - display_section($appname,$appname,$file); - } -?> diff --git a/resources/setup/etemplates.inc.php b/resources/setup/etemplates.inc.php index f923a5cc45..9a50a423fa 100644 --- a/resources/setup/etemplates.inc.php +++ b/resources/setup/etemplates.inc.php @@ -1,5 +1,5 @@ 'egw@von-und-zu-weiss.de' ); - $setup_info['resources']['hooks'][] = 'admin'; + $setup_info['resources']['hooks']['preferences'] = 'resources.admin_prefs_sidebox_hooks.all_hooks'; + $setup_info['resources']['hooks']['admin'] = 'resources.admin_prefs_sidebox_hooks.all_hooks'; + $setup_info['resources']['hooks']['sidebox_menu'] = 'resources.admin_prefs_sidebox_hooks.all_hooks'; +// $setup_info['resources']['hooks'][] = 'admin'; // $setup_info['resources']['hooks'][] = 'home'; // $setup_info['resources']['hooks'][] = 'sidebox_menu'; // $setup_info['resources']['hooks'][] = 'settings';