Exemplo n.º 1
0
		$tz_offset[$i] = $i . ' ' . lang('hours').': ' . date($format,$t);
	}
	create_select_box('Time zone offset','tz_offset',$tz_offset,
		'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.');
*/
$timezone_identifiers = DateTimeZone::listIdentifiers();
$timezone = array();
foreach ($timezone_identifiers as $identifier) {
    $timezone[$identifier] = $identifier;
}
create_select_box('Time zone', 'timezone', $timezone, 'A time zone is a region of the earth that has uniform standard time, usually referred to as the local time. By convention, time zones compute their local time as an offset from UTC');
$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', 'd.m.Y' => 'd.m.Y', 'd-M-Y' => 'd-M-Y');
create_select_box('Date format', 'dateformat', $date_formats, 'How should phpGroupWare display dates for you.');
$time_formats = array('12' => lang('12 hour'), '24' => lang('24 hour'));
create_select_box('Time format', 'timeformat', $time_formats, 'Do you prefer a 24 hour time format, or a 12 hour one with am/pm attached.');
create_select_box('Country', 'country', phpgwapi_country::get_translated_list(), 'In which country are you. This is used to set certain defaults for you.');
$langs = $GLOBALS['phpgw']->translation->get_installed_langs();
foreach ($langs as $key => $name) {
    $trans = lang($name);
    if ($trans != $name . '*') {
        $langs[$key] = $trans;
    }
}
create_select_box('Language', 'lang', $langs, '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.');
// preference.php handles this function
if (is_admin()) {
    create_check_box('Show number of current users', 'show_currentusers', 'Should the number of active sessions be displayed for you all the time.');
}
reset($GLOBALS['phpgw_info']['user']['apps']);
while (list($app) = each($GLOBALS['phpgw_info']['user']['apps'])) {
    if ($GLOBALS['phpgw_info']['apps'][$app]['status'] != 2 && $app) {
Exemplo n.º 2
0
    /**
     * Create a select box filled with countries
     *
     * @param string $selected the currently selected country
     * @param string $name the name of the select box element in the form, used for both the id and name attributes
     * @return string the html for a select box form element
     */
    public static function country_select($selected, $name = null)
    {
        if (is_null($name)) {
            $name = 'country';
        }
        $selected = trim($selected);
        $slctd = $selected ? '' : ' selected';
        $lang_select1 = lang('Select One');
        $select = <<<HTML
\t\t\t\t<select name="{$name}">
\t\t\t\t\t<option value="  "{$selected}>{$lang_select1}</option>

HTML;
        foreach (phpgwapi_country::get_translated_list() as $code => $country) {
            $slctd = $code == $selected ? ' selected' : '';
            $select .= <<<HTML
\t\t\t\t\t<option value="{$code}"{$slctd}>{$country}</option>

HTML;
        }
        $select .= <<<HTML
\t\t\t\t</select>
HTML;
        return $select;
    }