From 955fa303be52d2d48a625ba1e0c4a16fe3121513 Mon Sep 17 00:00:00 2001 From: jengo Date: Sun, 26 Aug 2001 04:32:28 +0000 Subject: [PATCH] _finally_ merged my dual pass and default preference changes --- preferences/inc/hook_preferences.inc.php | 14 +-- preferences/inc/hook_settings.inc.php | 108 ++++++++++++++++++ preferences/templates/default/preferences.tpl | 52 +++++++++ 3 files changed, 165 insertions(+), 9 deletions(-) create mode 100755 preferences/inc/hook_settings.inc.php create mode 100644 preferences/templates/default/preferences.tpl diff --git a/preferences/inc/hook_preferences.inc.php b/preferences/inc/hook_preferences.inc.php index 8cf6f9646a..6adef442fb 100644 --- a/preferences/inc/hook_preferences.inc.php +++ b/preferences/inc/hook_preferences.inc.php @@ -10,18 +10,14 @@ * option) any later version. * \**************************************************************************/ - /* $Id$ */ -{ + /* $Id$ */ -//Do not modify below this line - // Actual content - $title = $appname; if ($phpgw->acl->check('changepassword',1)) { $file['Change your Password'] = $phpgw->link('/preferences/changepassword.php'); } - $file['change your settings'] = $phpgw->link('/preferences/settings.php'); + $file['change your settings'] = $phpgw->link('/preferences/preferences.php','appname=preferences'); - display_section($appname,$title,$file); -} -?> + display_section('Preferences','Preferences',$file); + +?> \ No newline at end of file diff --git a/preferences/inc/hook_settings.inc.php b/preferences/inc/hook_settings.inc.php new file mode 100755 index 0000000000..c6d3e068ec --- /dev/null +++ b/preferences/inc/hook_settings.inc.php @@ -0,0 +1,108 @@ +common->list_templates(); + while (list($var,$value) = each($templates)) + { + $_templates[$var] = $templates[$var]['title']; + } + + $themes = $phpgw->common->list_themes(); + while (list(,$value) = each($themes)) + { + $_themes[$value] = $value; + } + + create_input_box('Max matches per page','maxmatchs'); + create_select_box('Interface/Template Selection','template_set',$_templates); + create_select_box('Theme (colors/fonts) Selection','theme',$_themes); + + $navbar_format = array( + 'icons' => lang('Icons only'), + 'icons_and_text' => lang('Icons and text'), + 'text' => lang('Text only') + ); + create_select_box('Show navigation bar as','navbar_format',$navbar_format); + + for ($i = -23; $i<24; $i++) + { + $timezone_offset[$i] = $i; + } + create_select_box('Time zone offset','timezone_offset',$timezone_offset); + + $date_formats = array( + 'm/d/Y' => 'm/d/Y', + 'm-d-Y' => 'm-d-Y', + 'm.d.Y' => 'm.d.Y', + 'Y/d/m' => 'Y/d/m', + 'Y-d-m' => 'Y-d-m', + 'Y.d.m' => 'Y.d.m', + 'Y/m/d' => 'Y/m/d', + 'Y-m-d' => 'Y-m-d', + 'Y.m.d' => 'Y.m.d', + 'd/m/Y' => 'd/m/Y', + 'd-m-Y' => 'd-m-Y', + 'd.m.Y' => 'd.m.Y' + ); + create_select_box('Date format','dateformat',$date_formats); + + $time_formats = array( + '12' => '12 hour', + '24' => '24 hour' + ); + create_select_box('Time format','timeformat',$time_formats); + + $sbox = createobject('phpgwapi.sbox'); + create_select_box('Country','country',$sbox->country_array); + + $db2 = $phpgw->db; + $phpgw->db->query("select distinct lang from lang",__LINE__,__FILE__); + while ($phpgw->db->next_record()) + { +// $phpgw_info['installed_langs'][$phpgw->db->f('lang')] = $phpgw->db->f('lang'); + + $db2->query("select lang_name from languages where lang_id = '" + . $phpgw->db->f('lang') . "'",__LINE__,__FILE__); + $db2->next_record(); + + // When its not in the phpgw_langauges table, it will show ??? in the field + // otherwise + if ($db2->f('lang_name')) + { + $langs[$phpgw->db->f('lang')] = $db2->f('lang_name'); + } + } + create_select_box('Language','lang',$langs); + + // preference.php handles this function + if (is_admin()) + { + // The 'True' is *NOT* being used as a constant, don't change it + $yes_and_no = array( + 'True' => 'Yes', + '' => 'No' + ); + create_select_box('Show current users on navigation bar','show_currentusers',$yes_and_no); + } + + reset($phpgw_info['user']['apps']); + while (list($permission) = each($phpgw_info['user']['apps'])) + { + if ($phpgw_info['apps'][$permission]['status'] != 2) + { + $user_apps[$permission] = $permission; + } + } + create_select_box('Default application','default_app',$user_apps); + + create_input_box('Currency','currency'); diff --git a/preferences/templates/default/preferences.tpl b/preferences/templates/default/preferences.tpl new file mode 100644 index 0000000000..88465b5cad --- /dev/null +++ b/preferences/templates/default/preferences.tpl @@ -0,0 +1,52 @@ + +{lang_title} +

+ +

+ + + + + +
+ + + + + +
+ + + + +   + {lang_user} + {lang_global} + {lang_default} + +{rows} + + + + + {row_name} + {row_user} + {row_global} + {row_default} + + + + + +   + {lang_user} + +{rows} + + + + + {row_name} + {row_user} + +