use formField() instead of plain html for select menus

This commit is contained in:
Uwe Steinmann 2021-09-09 08:19:04 +02:00
parent c376e352b5
commit 40f3cf35c9

View File

@ -133,27 +133,35 @@ $(document).ready( function() {
)
);
if($enableLanguageSelector) {
$html = "<select id=\"languageselector\" class=\"form-control\" name=\"lang\">";
$html .= "<option value=\"\">-";
$options = array();
$options[] = array('', '-');
foreach ($languages as $currLang) {
$html .= "<option value=\"".$currLang."\">".getMLText($currLang)."</option>";
$options[] = array($currLang, getMLText($currLang));
}
$html .= "</select>";
$this->formField(
getMLText("language"),
$html
array(
'element'=>'select',
'name'=>'lang',
'id'=>'languageselector',
'options'=>$options
)
);
}
if($enableThemeSelector) {
$html = "<select id=\"themeselector\" class=\"form-control\" name=\"sesstheme\">";
$html .= "<option value=\"\">-";
$options = array();
$options[] = array('', '-');
foreach ($themes as $currTheme) {
$html .= "<option value=\"".$currTheme."\">".$currTheme;
$options[] = array($currTheme, $currTheme);
}
$html .= "</select>";
$this->formField(
getMLText("theme"),
$html
array(
'element'=>'select',
'name'=>'sesstheme',
'id'=>'themeselector',
'options'=>$options
)
);
}
$this->formSubmit(getMLText('submit_login'));