mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Added disabled param to SelectorOptions()
This commit is contained in:
parent
93514a6787
commit
3292bc580b
@ -147,8 +147,9 @@ function isAssoc($arr)
|
|||||||
* @param string $selected: Selected option (optional)
|
* @param string $selected: Selected option (optional)
|
||||||
* @param string $id: $options is an associative array this should be the key
|
* @param string $id: $options is an associative array this should be the key
|
||||||
* @param string $event: onChange event (optional)
|
* @param string $event: onChange event (optional)
|
||||||
|
* @param string $disabled (optional)
|
||||||
*/
|
*/
|
||||||
function SelectorOptions($name, $options, $selected = null, $id = null, $event = null)
|
function SelectorOptions($name, $options, $selected = null, $id = null, $event = null, $disabled = null)
|
||||||
{
|
{
|
||||||
echo '<select class="form-control" name="'.htmlspecialchars($name, ENT_QUOTES).'"';
|
echo '<select class="form-control" name="'.htmlspecialchars($name, ENT_QUOTES).'"';
|
||||||
if (isset($id)) {
|
if (isset($id)) {
|
||||||
@ -164,8 +165,10 @@ function SelectorOptions($name, $options, $selected = null, $id = null, $event =
|
|||||||
if ($key == $selected) {
|
if ($key == $selected) {
|
||||||
$select = ' selected="selected"';
|
$select = ' selected="selected"';
|
||||||
}
|
}
|
||||||
|
if ($key == $disabled) {
|
||||||
echo '<option value="'.htmlspecialchars($key, ENT_QUOTES).'"'.$select.'>'.
|
$disabled = ' disabled';
|
||||||
|
}
|
||||||
|
echo '<option value="'.htmlspecialchars($key, ENT_QUOTES).'"'.$select.$disabled.'>'.
|
||||||
htmlspecialchars($label, ENT_QUOTES).'</option>' , PHP_EOL;
|
htmlspecialchars($label, ENT_QUOTES).'</option>' , PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user