[2] | 1 | <?php |
---|
| 2 | /**************************************************************************\ |
---|
| 3 | * phpGroupWare - Preferences * |
---|
| 4 | * http://www.phpgroupware.org * |
---|
| 5 | * -------------------------------------------- * |
---|
| 6 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 7 | * under the terms of the GNU General Public License as published by the * |
---|
| 8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 9 | * option) any later version. * |
---|
| 10 | \**************************************************************************/ |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | $templates = $GLOBALS['phpgw']->common->list_templates(); |
---|
| 14 | while (list($var,$value) = each($templates)) |
---|
| 15 | { |
---|
| 16 | $_templates[$var] = $templates[$var]['title']; |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | $themes = $GLOBALS['phpgw']->common->list_themes(); |
---|
| 20 | while (list(,$value) = each($themes)) |
---|
| 21 | { |
---|
| 22 | $_themes[$value] = $value; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | create_input_box('Max matches per page','maxmatchs', |
---|
| 26 | 'Any listing in phpGW will show you this number of entries or lines per page.<br>To many slow down the page display, to less will cost you the overview.','',3); |
---|
| 27 | create_select_box('Interface/Template Selection','template_set',$_templates, |
---|
| 28 | 'A template defines the layout of phpGroupWare and it contains icons for each application.'); |
---|
| 29 | create_select_box('Theme (colors/fonts) Selection','theme',$_themes, |
---|
| 30 | 'A theme defines the colors and fonts used by the template.'); |
---|
| 31 | |
---|
| 32 | $navbar_format = array( |
---|
| 33 | 'icons' => lang('Icons only'), |
---|
| 34 | 'icons_and_text' => lang('Icons and text'), |
---|
| 35 | 'text' => lang('Text only') |
---|
| 36 | ); |
---|
| 37 | create_select_box('Show navigation bar as','navbar_format',$navbar_format, |
---|
| 38 | 'You can show the applications as icons only, icons with app-name or both.'); |
---|
| 39 | |
---|
| 40 | $format = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; |
---|
| 41 | $format = ($format ? $format : 'Y/m/d') . ', '; |
---|
| 42 | if ($GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'] == '12') |
---|
| 43 | { |
---|
| 44 | $format .= 'h:i a'; |
---|
| 45 | } |
---|
| 46 | else |
---|
| 47 | { |
---|
| 48 | $format .= 'H:i'; |
---|
| 49 | } |
---|
[7655] | 50 | for ($i = -23; $i<24; ++$i) |
---|
[2] | 51 | { |
---|
| 52 | $t = time() + $i * 60*60; |
---|
| 53 | $tz_offset[$i] = $i . ' ' . lang('hours').': ' . date($format,$t); |
---|
| 54 | } |
---|
| 55 | create_select_box('Time zone offset','tz_offset',$tz_offset, |
---|
| 56 | 'How many hours are you in front or after the timezone of the server.<br>If you are in the same time zone as the server select 0 hours, else select your locale date and time.'); |
---|
| 57 | |
---|
| 58 | $date_formats = array( |
---|
| 59 | 'm/d/Y' => 'm/d/Y', |
---|
| 60 | 'm-d-Y' => 'm-d-Y', |
---|
| 61 | 'm.d.Y' => 'm.d.Y', |
---|
| 62 | 'Y/d/m' => 'Y/d/m', |
---|
| 63 | 'Y-d-m' => 'Y-d-m', |
---|
| 64 | 'Y.d.m' => 'Y.d.m', |
---|
| 65 | 'Y/m/d' => 'Y/m/d', |
---|
| 66 | 'Y-m-d' => 'Y-m-d', |
---|
| 67 | 'Y.m.d' => 'Y.m.d', |
---|
| 68 | 'd/m/Y' => 'd/m/Y', |
---|
| 69 | 'd-m-Y' => 'd-m-Y', |
---|
| 70 | 'd.m.Y' => 'd.m.Y', |
---|
| 71 | 'd-M-Y' => 'd-M-Y' |
---|
| 72 | ); |
---|
| 73 | create_select_box('Date format','dateformat',$date_formats, |
---|
| 74 | 'How should phpGroupWare display dates for you.'); |
---|
| 75 | |
---|
| 76 | $time_formats = array( |
---|
| 77 | '12' => lang('12 hour'), |
---|
| 78 | '24' => lang('24 hour') |
---|
| 79 | ); |
---|
| 80 | create_select_box('Time format','timeformat',$time_formats, |
---|
| 81 | 'Do you prefer a 24 hour time format, or a 12 hour one with am/pm attached.'); |
---|
| 82 | |
---|
| 83 | $sbox = createobject('phpgwapi.sbox'); |
---|
| 84 | create_select_box('Country','country',$sbox->country_array, |
---|
| 85 | 'In which country are you. This is used to set certain defaults for you.'); |
---|
| 86 | |
---|
| 87 | $langs = $GLOBALS['phpgw']->translation->get_installed_langs(); |
---|
| 88 | create_select_box('Language','lang',$langs, |
---|
| 89 | 'Select the language of texts and messages within phpGroupWare.<br>Some languages may not contain all messages, in that case you will see an english message.'); |
---|
| 90 | |
---|
| 91 | // preference.php handles this function |
---|
| 92 | if (is_admin()) |
---|
| 93 | { |
---|
| 94 | create_check_box('Show number of current users','show_currentusers', |
---|
| 95 | 'Should the number of active sessions be displayed for you all the time.'); |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | reset($GLOBALS['phpgw_info']['user']['apps']); |
---|
[143] | 99 | $GLOBALS['phpgw_info']['user']['apps']['home'] = lang("Home"); |
---|
[2] | 100 | while (list($app) = each($GLOBALS['phpgw_info']['user']['apps'])) |
---|
| 101 | { |
---|
| 102 | if ($GLOBALS['phpgw_info']['apps'][$app]['status'] != 2 && $app) |
---|
| 103 | { |
---|
| 104 | $user_apps[$app] = $GLOBALS['phpgw_info']['apps'][$app]['title'] ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app); |
---|
| 105 | } |
---|
| 106 | } |
---|
| 107 | create_select_box('Default application','default_app',$user_apps, |
---|
| 108 | "The default application will be started when you enter phpGroupWare or click on the homepage icon.<br>You can also have more than one application showing up on the homepage, if you don't choose a specific application here (has to be configured in the preferences of each application)."); |
---|
| 109 | |
---|
| 110 | create_input_box('Currency','currency', |
---|
| 111 | 'Which currency symbol or name should be used in phpGroupWare.'); |
---|
| 112 | |
---|
| 113 | $account_sels = array( |
---|
| 114 | 'selectbox' => lang('Selectbox'), |
---|
| 115 | 'popup' => lang('Popup with search') |
---|
| 116 | ); |
---|
| 117 | create_select_box('How do you like to select accounts','account_selection',$account_sels, |
---|
| 118 | 'The selectbox shows all available users (can be very slow on big installs with many users). The popup can search users by name or group.'); |
---|
| 119 | |
---|
| 120 | $account_display = array( |
---|
| 121 | 'firstname' => lang('Firstname'). ' '.lang('Lastname'), |
---|
| 122 | 'lastname' => lang('Lastname').', '.lang('Firstname'), |
---|
| 123 | 'username' => lang('username'), |
---|
| 124 | 'firstall' => lang('Firstname').' '.lang('Lastname').' ['.lang('username').']', |
---|
| 125 | 'all' => '['.lang('username').'] '.lang('Lastname').', '.lang('Firstname') |
---|
| 126 | ); |
---|
| 127 | create_select_box('How do you like to display accounts','account_display',$account_display, |
---|
| 128 | 'Set this to your convenience. For security reasons, you might not want to show your Loginname in public.'); |
---|
| 129 | |
---|
| 130 | create_check_box('Show helpmessages by default','show_help', |
---|
| 131 | 'Should this help messages shown up always, when you enter the preferences or only on request.'); |
---|