2001-08-26 06:32:28 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare - Preferences *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* 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$ */
|
|
|
|
|
2001-09-01 22:01:05 +02:00
|
|
|
$templates = $GLOBALS['phpgw']->common->list_templates();
|
2001-08-26 06:32:28 +02:00
|
|
|
while (list($var,$value) = each($templates))
|
|
|
|
{
|
|
|
|
$_templates[$var] = $templates[$var]['title'];
|
|
|
|
}
|
|
|
|
|
2001-09-01 22:01:05 +02:00
|
|
|
$themes = $GLOBALS['phpgw']->common->list_themes();
|
2001-08-26 06:32:28 +02:00
|
|
|
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++)
|
|
|
|
{
|
2002-01-17 04:38:03 +01:00
|
|
|
$tz_offset[$i] = $i;
|
2001-08-26 06:32:28 +02:00
|
|
|
}
|
2002-01-17 04:38:03 +01:00
|
|
|
create_select_box('Time zone offset','tz_offset',$tz_offset);
|
2001-08-26 06:32:28 +02:00
|
|
|
|
|
|
|
$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(
|
2003-03-18 12:28:50 +01:00
|
|
|
'12' => lang('12 hour'),
|
|
|
|
'24' => lang('24 hour')
|
2001-08-26 06:32:28 +02:00
|
|
|
);
|
|
|
|
create_select_box('Time format','timeformat',$time_formats);
|
|
|
|
|
|
|
|
$sbox = createobject('phpgwapi.sbox');
|
|
|
|
create_select_box('Country','country',$sbox->country_array);
|
|
|
|
|
2001-09-01 22:01:05 +02:00
|
|
|
$db2 = $GLOBALS['phpgw']->db;
|
2002-02-17 20:31:50 +01:00
|
|
|
$GLOBALS['phpgw']->db->query("select distinct lang from phpgw_lang",__LINE__,__FILE__);
|
2001-09-01 22:01:05 +02:00
|
|
|
while ($GLOBALS['phpgw']->db->next_record())
|
2001-08-26 06:32:28 +02:00
|
|
|
{
|
|
|
|
// $phpgw_info['installed_langs'][$phpgw->db->f('lang')] = $phpgw->db->f('lang');
|
|
|
|
|
2002-02-17 20:31:50 +01:00
|
|
|
$db2->query("select lang_name from phpgw_languages where lang_id = '"
|
2001-09-01 22:01:05 +02:00
|
|
|
. $GLOBALS['phpgw']->db->f('lang') . "'",__LINE__,__FILE__);
|
2001-08-26 06:32:28 +02:00
|
|
|
$db2->next_record();
|
|
|
|
|
2001-09-01 22:01:05 +02:00
|
|
|
// When its not in the phpgw_languages table, it will show ??? in the field
|
2001-08-26 06:32:28 +02:00
|
|
|
// otherwise
|
|
|
|
if ($db2->f('lang_name'))
|
|
|
|
{
|
2001-09-01 22:01:05 +02:00
|
|
|
$langs[$GLOBALS['phpgw']->db->f('lang')] = $db2->f('lang_name');
|
2001-08-26 06:32:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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(
|
2003-03-18 12:28:50 +01:00
|
|
|
'True' => lang('Yes'),
|
|
|
|
'' => lang('No')
|
2001-08-26 06:32:28 +02:00
|
|
|
);
|
|
|
|
create_select_box('Show current users on navigation bar','show_currentusers',$yes_and_no);
|
|
|
|
}
|
|
|
|
|
2001-09-01 22:01:05 +02:00
|
|
|
reset($GLOBALS['phpgw_info']['user']['apps']);
|
2003-03-18 12:28:50 +01:00
|
|
|
while (list($app) = each($GLOBALS['phpgw_info']['user']['apps']))
|
2001-08-26 06:32:28 +02:00
|
|
|
{
|
2003-03-18 12:28:50 +01:00
|
|
|
if ($GLOBALS['phpgw_info']['apps'][$app]['status'] != 2 && $app)
|
2001-08-26 06:32:28 +02:00
|
|
|
{
|
2003-03-18 12:28:50 +01:00
|
|
|
$user_apps[$app] = $GLOBALS['phpgw_info']['apps'][$app]['title'] ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app);
|
2001-08-26 06:32:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
create_select_box('Default application','default_app',$user_apps);
|
|
|
|
|
|
|
|
create_input_box('Currency','currency');
|