mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 23:27:17 +02:00
Move inline event handlers to <script>
This commit is contained in:
@@ -176,13 +176,15 @@ function html_select($name, $options, $value = "", $onchange = true, $labelled_b
|
||||
* @param array
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function select_input($attrs, $options, $value = "", $placeholder = "") {
|
||||
return ($options
|
||||
? "<select$attrs><option value=''>$placeholder" . optionlist($options, $value, true) . "</select>"
|
||||
: "<input$attrs size='10' value='" . h($value) . "' placeholder='$placeholder'>"
|
||||
);
|
||||
function select_input($attrs, $options, $value = "", $onchange = "", $placeholder = "") {
|
||||
$tag = ($options ? "select" : "input");
|
||||
return "<$tag$attrs" . ($options
|
||||
? "><option value=''>$placeholder" . optionlist($options, $value, true) . "</select>"
|
||||
: " size='10' value='" . h($value) . "' placeholder='$placeholder'>"
|
||||
) . ($onchange ? "<script>qsl('$tag').onchange = $onchange;</script>" : "");
|
||||
}
|
||||
|
||||
/** Get onclick confirmation
|
||||
|
Reference in New Issue
Block a user