diff options
author | Andrew Dolgov <[email protected]> | 2021-02-12 14:31:36 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-12 14:31:36 +0300 |
commit | 8f8675a26abf86ff6a77bc750096b77491d71213 (patch) | |
tree | b6eb5ee57a46ecd1a5caa70bbf93caabbcc721cd /include | |
parent | 699186f430bb28059d7ade7a15259f1ec10ff8f3 (diff) |
* filters: remove duplicate code, overall cleanup
* check if some tres exist before trying to reload them
Diffstat (limited to 'include')
-rwxr-xr-x | include/controls.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/controls.php b/include/controls.php index 78a5feb77..8f49e99c5 100755 --- a/include/controls.php +++ b/include/controls.php @@ -35,15 +35,23 @@ function print_select_hash($id, $default, $values, $attributes = "", $name = "") print "</select>"; } +function format_hidden($name, $value) { + return "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"$name\" value=\"$value\">"; +} + function print_hidden($name, $value) { - print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"$name\" value=\"$value\">"; + print format_hidden($name, $value); } -function print_checkbox($id, $checked, $value = "", $attributes = "") { +function format_checkbox($id, $checked, $value = "", $attributes = "") { $checked_str = $checked ? "checked" : ""; $value_str = $value ? "value=\"$value\"" : ""; - print "<input dojoType=\"dijit.form.CheckBox\" id=\"$id\" $value_str $checked_str $attributes name=\"$id\">"; + return "<input dojoType=\"dijit.form.CheckBox\" id=\"$id\" $value_str $checked_str $attributes name=\"$id\">"; +} + +function print_checkbox($id, $checked, $value = "", $attributes = "") { + print format_checkbox($id, $checked, $value, $attributes); } function print_button($type, $value, $attributes = "") { |