diff --git a/admin/inc/hook_admin.inc.php b/admin/inc/hook_admin.inc.php index 60698e4cf6..244f6ef5a1 100644 --- a/admin/inc/hook_admin.inc.php +++ b/admin/inc/hook_admin.inc.php @@ -1,68 +1,27 @@ \n"; - $imgfile = $phpgw->common->get_image_dir("admin")."/" . $appname .".gif"; - if (file_exists($imgfile)) { - $imgpath = $phpgw->common->get_image_path("admin")."/" . $appname .".gif"; - } else { - $imgfile = $phpgw->common->get_image_dir("admin")."/navbar.gif"; - if (file_exists($imgfile)) { - $imgpath = $phpgw->common->get_image_path("admin")."/navbar.gif"; - } else { - $imgpath = ""; - } - } - - // Show the header for the section - section_start("Administration",$imgpath); -*/ - - echo "

\n"; - $imgfile = $phpgw->common->get_image_dir($appname) . '/' . $appname . '.gif'; - if (file_exists($imgfile)) - { - $imgpath = $phpgw->common->get_image_path($appname) . '/' . $appname . '.gif'; - } - else - { - $imgfile = $phpgw->common->get_image_dir($appname) . '/navbar.gif'; - if (file_exists($imgfile)) - { - $imgpath = $phpgw->common->get_image_path($appname) . '/navbar.gif'; - } - else - { - $imgpath = ''; - } - } - + $imgpath = $phpgw->common->image($appname,'navbar.gif'); section_start(ucfirst($appname),$imgpath); - // actual items in this section - echo '' . lang('User accounts')."
\n"; - echo '' . lang('User groups')."
\n"; - echo "

\n"; - - echo '' . lang('Applications')."
\n"; - echo "

\n"; - - echo '' . lang('Global Categories')."
\n"; - echo "

\n"; - - echo '' . lang('Change main screen message') . "
\n"; - echo "

\n"; - - echo '' . lang('View sessions') . "
\n"; - echo '' . lang('View Access Log') . "
\n"; + section_item($phpgw->link('/admin/accounts.php'),lang('User accounts')); + section_item($phpgw->link('/admin/groups.php'),lang('User groups')); + section_item($phpgw->link('/admin/applications.php'),lang('Applications')); + section_item($phpgw->link('/admin/categories.php'),lang('Global Categories')); + section_item($phpgw->link('/admin/mainscreen_message.php'),lang('Change main screen message')); + section_item($phpgw->link('/admin/currentusers.php'),lang('View sessions')); + section_item($phpgw->link('/admin/accesslog.php'),lang('View Access Log')); section_end(); } diff --git a/admin/index.php b/admin/index.php index d6893b717f..b9590f28a9 100755 --- a/admin/index.php +++ b/admin/index.php @@ -17,64 +17,56 @@ $phpgw_info['flags']['currentapp'] = 'admin'; include('../header.inc.php'); - check_code($cd); + $admin_tpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $admin_tpl->set_file(array( + 'admin' => 'index.tpl', + )); + + $admin_tpl->set_block('admin','list'); + $admin_tpl->set_block('admin','app_row'); + $admin_tpl->set_block('admin','app_row_noicon'); + $admin_tpl->set_block('admin','link_row'); + $admin_tpl->set_block('admin','spacer_row'); + + $admin_tpl->set_var('title',lang('Administration')); // This func called by the includes to dump a row header function section_start($name='',$icon='') { - global $phpgw,$phpgw_info; - echo ''; + global $phpgw, $phpgw_info, $admin_tpl; + + $admin_tpl->set_var('icon_backcolor',$phpgw_info['theme']['row_off']); + $admin_tpl->set_var('link_backcolor',$phpgw_info['theme']['row_off']); + $admin_tpl->set_var('app_name',lang($name)); + $admin_tpl->set_var('app_icon',$icon); if ($icon) { - echo ''; - echo ''; + $admin_tpl->parse('rows','app_row',True); } else { - echo ''; - } - echo ''; - echo '
[Icon]' . lang($name) . '' . $name . '
'; + $admin_tpl->parse('rows','app_row_noicon',True); + } } + function section_item($pref_link='',$pref_text='') + { + global $phpgw, $phpgw_info, $admin_tpl; + + $admin_tpl->set_var('pref_link',$pref_link); + $admin_tpl->set_var('pref_text',$pref_text); + $admin_tpl->parse('rows','link_row',True); + } + function section_end() { - echo '
'; + global $phpgw, $phpgw_info, $admin_tpl; + + $admin_tpl->parse('rows','spacer_row',True); } - // We only want to list applications that are enabled, even if hidden from navbar, plus the common stuff - // (if they can get to the admin page, the admin app is enabled, hence it is shown) + $phpgw->common->hook(); + $admin_tpl->pparse('out','list'); - $phpgw->db->query("SELECT app_name FROM phpgw_applications WHERE app_enabled=1 OR app_enabled=2 ORDER BY app_title",__LINE__,__FILE__); - - // Stuff it in an array in the off chance the admin includes need the db - while ($phpgw->db->next_record()) - { - $apps[] = $phpgw->db->f('app_name'); - } - - for ($i =0; $i < sizeof($apps); $i++) - { - $appname = $apps[$i]; - $f = PHPGW_SERVER_ROOT . '/' . $appname . '/inc/hook_admin.inc.php'; - - if (file_exists($f)) - { - include($f); - echo "

\n"; - } - } - - if ($SHOW_INFO > 0) - { - echo '

' . lang('Hide PHP Information') . ''; - echo "


\n"; - phpinfo(); - echo "
\n"; - } - else - { - echo '

' . lang('PHP Information') . ''; - } $phpgw->common->phpgw_footer(); -?> +?> \ No newline at end of file diff --git a/admin/templates/default/index.tpl b/admin/templates/default/index.tpl new file mode 100755 index 0000000000..1a53ca6d0b --- /dev/null +++ b/admin/templates/default/index.tpl @@ -0,0 +1,33 @@ + +{title} +


+ + + {rows} +
+ + + + + [ {app_name} ] +   {app_name} + + + + + +   {app_name} + + + + + +  • {pref_text} + + + + + +   + + diff --git a/calendar/inc/hook_admin.inc.php b/calendar/inc/hook_admin.inc.php index 7b91aeedd7..4a61693a4f 100755 --- a/calendar/inc/hook_admin.inc.php +++ b/calendar/inc/hook_admin.inc.php @@ -1,22 +1,21 @@ * - * -------------------------------------------- * - * 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$ */ -{ - echo "

"; - $imgpath = $phpgw->common->image($appname,'navbar.gif'); - section_start(ucfirst($appname),$imgpath); + /**************************************************************************\ + * phpGroupWare * + * http://www.phpgroupware.org * + * Written by Joseph Engo * + * -------------------------------------------- * + * 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. * + \**************************************************************************/ - echo '' . lang('Calendar Holiday Management') . ''; + /* $Id$ */ - section_end(); -} -?> + $imgpath = $phpgw->common->image($appname,'navbar.gif'); + section_start(ucfirst($appname),$imgpath); + + section_item($phpgw->link('/calendar/holiday_admin.php'),lang('Calendar Holiday Management')); + + section_end(); +?> \ No newline at end of file