Add settings for user country and countrlist option based on admin setting

This commit is contained in:
Miles Lott 2001-06-22 01:15:14 +00:00
parent 467ec28d2b
commit ae9b96d242
3 changed files with 66 additions and 0 deletions

View File

@ -12,6 +12,33 @@
/* $Id$ */
function country_set($config)
{
global $phpgw;
$country = array(
'user_choice' => 'User Choice',
'force_select' => 'Force Selectbox'
);
while (list ($key, $value) = each ($country))
{
if ($config['countrylist'] == $key)
{
$selected = ' selected';
}
else
{
$selected = '';
}
$descr = lang($value);
$out .= '<option value="' . $key . '"' . $selected . '>' . $descr . '</option>' . "\n";
}
return $out;
}
function force_theme($config)
{
global $phpgw;

View File

@ -16,6 +16,7 @@
$phpgw_info["flags"] = array("nonavbar" => True, "noheader" => True);
}
$phpgw_info["flags"]["currentapp"] = "preferences";
$phpgw_info["flags"]["enable_sbox_class"] = True;
include("../header.inc.php");
@ -195,6 +196,35 @@
?>
</td>
</tr>
<tr>
<?php $selected[$phpgw_info['user']['preferences']['common']['country']] = ' selected'; ?>
<td><?php echo lang('country'); ?></td>
<td>
<?php
echo $phpgw->sbox->form_select($phpgw_info['user']['preferences']['common']['country'],'settings[country]');
?>
</select>
</td>
</tr>
<?php if ($phpgw_info['server']['countrylist'] == 'user_choice'){ ?>
<tr>
<?php $selected_country[$phpgw_info['user']['preferences']['common']['countrylist']] = ' selected'; ?>
<td><?php echo lang('Country Selection') . ':'; ?><br></td>
<td>
<select name="settings[countrylist]">
<?php
$country = array('use_select' => lang('Use Selectbox'), 'use_text' => lang('Use Text Entry'));
while (list ($key, $value) = each ($country)){
echo '<option value="'.$key.'" '.$selected_country[$key].'>'.$value.'</option>';
}
?>
</select>
</td>
</tr>
<?php } ?>
<tr>
<?php $selected[$phpgw_info["user"]["preferences"]["common"]["lang"]] = " selected"; ?>
<td><?php echo lang("language"); ?></td>

View File

@ -29,6 +29,15 @@
</td>
</tr>
<tr bgcolor="{row_on}">
<td>{lang_Country_Selection} ({lang_Text_Entry}/{lang_SelectBox}):</td>
<td>
<select name="newsettings[countrylist]">
{hook_country_set}
</select>
</td>
</tr>
<tr bgcolor="{row_on}">
<td>{lang_Interface}/{lang_Template_Selection}:</td>
<td>