- Add a 'language' input type to the config editor

- Change config[default_language] type to langauge, no more people messing it
  up by typing in "English" or "American".
This commit is contained in:
dave 2009-02-05 09:14:41 +00:00
parent c0e5a2cb91
commit 0f763de1ac
3 changed files with 12 additions and 1 deletions

View File

@ -296,6 +296,14 @@ function config_editor($category, $year, $array_name, $self)
if($c > 5) print("</td></tr></table>");
break;
case 'language':
print("<select name=\"$name\">");
foreach($config['languages'] as $k=>$lang) {
$sel = ($config['default_language'] == $k) ? 'selected=selected' : '';
print("<option $sel value=\"$k\">$lang</option>");
}
print("</select>");
break;
default:
print("<input size=\"$size\" type=\"text\" name=\"$name\" value=\"$val\">\n");

View File

@ -1 +1 @@
122
123

3
db/db.update.123.sql Normal file
View File

@ -0,0 +1,3 @@
ALTER TABLE `config` CHANGE `type` `type` ENUM( '', 'yesno', 'number', 'text', 'enum', 'multisel', 'language' ) NOT NULL ;
UPDATE config SET `type`='language' WHERE `var`='default_language';