diff --git a/addressbook/inc/hook_preferences.inc.php b/addressbook/inc/hook_preferences.inc.php
index 25fa152422..843dff0e87 100644
--- a/addressbook/inc/hook_preferences.inc.php
+++ b/addressbook/inc/hook_preferences.inc.php
@@ -27,17 +27,17 @@
section_start(ucfirst($appname),$imgpath);
- echo ''
- . lang('Preferences') . '
';
+ section_item($phpgw->link('/addressbook/preferences.php'),
+ lang('Preferences'));
- echo ''
- . lang('Grant Access') . '
';
+ section_item($phpgw->link('/preferences/acl_preferences.php','acl_app='.$appname),
+ lang('Grant Access'));
- echo ''
- . lang('Edit Categories') . '
';
+ section_item($phpgw->link('/preferences/categories.php','cats_app='.$appname),
+ lang('Edit Categories'));
- echo ''
- . lang('Edit custom fields') . '';
+ section_item($phpgw->link('/addressbook/fields.php'),
+ lang('Edit custom fields'));
section_end();
}
diff --git a/calendar/inc/hook_preferences.inc.php b/calendar/inc/hook_preferences.inc.php
index 5d1806323b..a22085c0aa 100644
--- a/calendar/inc/hook_preferences.inc.php
+++ b/calendar/inc/hook_preferences.inc.php
@@ -33,14 +33,14 @@
section_start(ucfirst($appname),$imgpath);
- echo '' . lang('Calendar preferences')
- . '
';
+ section_item($phpgw->link('/calendar/preferences.php'),
+ lang('Calendar preferences'));
- echo ''
- . lang('Grant Calendar Access') . '
';
+ section_item($phpgw->link('/preferences/acl_preferences.php','acl_app='.$appname),
+ lang('Grant Calendar Access'));
- echo ''
- . lang('Edit Categories') . '';
+ section_item($phpgw->link('/preferences/categories.php','cats_app='.$appname),
+ lang('Edit Categories'));
section_end();
}
diff --git a/preferences/inc/hook_preferences.inc.php b/preferences/inc/hook_preferences.inc.php
index 72014c74d0..39c2b02383 100644
--- a/preferences/inc/hook_preferences.inc.php
+++ b/preferences/inc/hook_preferences.inc.php
@@ -12,32 +12,34 @@
/* $Id$ */
{
- echo "
\n"; - $imgfile = $phpgw->common->get_image_dir("preferences")."/" . $appname .".gif"; - if (file_exists($imgfile)) { - $imgpath = $phpgw->common->get_image_path("preferences")."/" . $appname .".gif"; - } else { - $imgfile = $phpgw->common->get_image_dir("preferences")."/navbar.gif"; - if (file_exists($imgfile)) { - $imgpath = $phpgw->common->get_image_path("preferences")."/navbar.gif"; - } else { - $imgpath = ""; - } - } - section_start("Account Preferences",$imgpath); - - - // Actual content - if ($phpgw->acl->check('changepassword',1)) { - echo "link('/preferences/changepassword.php') . "\">" - . lang("change your password") . ""; + echo "
\n";
+ $imgfile = $phpgw->common->get_image_dir("preferences")."/" . $appname .".gif";
+ if (file_exists($imgfile))
+ {
+ $imgpath = $phpgw->common->get_image_path("preferences")."/" . $appname .".gif";
+ } else
+ {
+ $imgfile = $phpgw->common->get_image_dir("preferences")."/navbar.gif";
+ if (file_exists($imgfile))
+ {
+ $imgpath = $phpgw->common->get_image_path("preferences")."/navbar.gif";
+ } else
+ {
+ $imgpath = "";
+ }
}
- echo "
link('/preferences/settings.php') . "\">"
- . lang("change your settings") . "";
-// echo "
link("changeprofile.php") . "\">"
-// . lang("change your profile") . "";
+
+ section_start("Account Preferences",$imgpath);
- section_end();
+ // Actual content
+ if ($phpgw->acl->check('changepassword',1))
+ {
+ section_item($phpgw->link('/preferences/changepassword.php'), lang("change your password"));
+ }
+
+ section_item($phpgw->link('/preferences/settings.php'), lang('change your settings'));
+
+ section_end();
}
?>
diff --git a/preferences/index.php b/preferences/index.php
index cdd59f799f..3513f40485 100755
--- a/preferences/index.php
+++ b/preferences/index.php
@@ -14,33 +14,62 @@
$phpgw_info['flags']['currentapp'] = 'preferences';
include('../header.inc.php');
+
+ $pref_tpl = new Template($phpgw->common->get_tpl_dir('preferences'));
+ $pref_tpl->set_file(array(
+ 'T_icon_cell' => 'index_icon_cell.tpl',
+ 'T_link_cell' => 'index_link_cell.tpl',
+ 'index_out' => 'index.tpl',
+ ));
+ // initialize
+
// This func called by the includes to dump a row header
function section_start($name='',$icon='')
{
- global $phpgw,$phpgw_info;
- //echo "
'; - echo ' | ' . $name . ' | '; + $pref_tpl->set_var('V_icon_cell',' '); } - echo '||
';
+
+ // prepare an iteration variable for section_item to know when to add a + $loopnum = 1; } + function section_item($pref_link='',$pref_text='') + { + global $phpgw,$phpgw_info, $loopnum, $pref_tpl; + if ($loopnum > 1) + { + $pref_tpl->set_var('insert_br',' '); + } + else + { + $pref_tpl->set_var('insert_br',''); + } + + $pref_tpl->set_var('pref_link',$pref_link); + $pref_tpl->set_var('pref_text',$pref_text); + $pref_tpl->parse('V_link_cell','T_link_cell',True); + $loopnum = $loopnum + 1; + } + function section_end() { - echo ' |
+ {V_icon_cell} + | ++ {app_name} + | +
+ {V_link_cell} + | +