forked from science-ation/science-ation
- 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:
parent
c0e5a2cb91
commit
0f763de1ac
@ -296,6 +296,14 @@ function config_editor($category, $year, $array_name, $self)
|
|||||||
if($c > 5) print("</td></tr></table>");
|
if($c > 5) print("</td></tr></table>");
|
||||||
|
|
||||||
break;
|
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:
|
default:
|
||||||
print("<input size=\"$size\" type=\"text\" name=\"$name\" value=\"$val\">\n");
|
print("<input size=\"$size\" type=\"text\" name=\"$name\" value=\"$val\">\n");
|
||||||
|
@ -1 +1 @@
|
|||||||
122
|
123
|
||||||
|
3
db/db.update.123.sql
Normal file
3
db/db.update.123.sql
Normal 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';
|
Loading…
x
Reference in New Issue
Block a user