forked from science-ation/science-ation
Show display and save the "preferred language" field.
This commit is contained in:
parent
2e65273b97
commit
785f5bbf35
@ -418,7 +418,7 @@ function user_save(&$u)
|
||||
'email',
|
||||
'phonehome','phonework','phonecell','fax','organization',
|
||||
'address','address2','city','province','postalcode','sex',
|
||||
'firstaid', 'cpr', 'types');
|
||||
'firstaid', 'cpr', 'types','lang');
|
||||
|
||||
$set = "";
|
||||
foreach($fields as $f) {
|
||||
|
@ -43,6 +43,7 @@
|
||||
'address' => array('name' => 'Address 1'),
|
||||
'address2' => array('name' => 'Address 2'),
|
||||
'city' => array('name' => 'City'),
|
||||
'lang' => array('name' => 'Preferred Language'),
|
||||
'province' => array('name' => $config['provincestate']),
|
||||
'organization' => array('name' => 'Organization'),
|
||||
'sex' => array('name' => 'Gender'),
|
||||
@ -101,7 +102,6 @@ if($eid != $_SESSION['users_id']) {
|
||||
$fields[] = 'password';
|
||||
}
|
||||
|
||||
|
||||
switch($_GET['action']) {
|
||||
case 'save':
|
||||
$users_id = intval($_POST['users_id']);
|
||||
@ -322,6 +322,25 @@ echo "<tr>\n";
|
||||
item($u, 'firstaid');
|
||||
item($u, 'cpr');
|
||||
echo "</tr>";
|
||||
echo "<tr>\n";
|
||||
if(in_array('lang', $fields)) {
|
||||
echo '<td>'.i18n('Preferred Lang').': </td>';
|
||||
echo '<td>';
|
||||
echo "<select name=\"lang\">";
|
||||
echo "<option value=\"\">".i18n("Choose")."</option>\n";
|
||||
foreach($config['languages'] AS $l=>$ln) {
|
||||
if($u['lang']==$l) $sel="selected=\"selected\""; else $sel="";
|
||||
echo "<option value=\"$l\" $sel>".i18n($ln)."</option>\n";
|
||||
}
|
||||
echo "</select>";
|
||||
if(in_array('lang', $required)) echo REQUIREDFIELD;
|
||||
echo '</td>';
|
||||
} else {
|
||||
echo '<td></td><td></td>';
|
||||
}
|
||||
echo "<td></td><td></td>";
|
||||
echo "</tr>";
|
||||
|
||||
|
||||
echo "<tr><td colspan=\"4\"><hr /></td></tr>";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user