1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 01:25:56 +00:00

* filters: remove duplicate code, overall cleanup

* check if some tres exist before trying to reload them
This commit is contained in:
Andrew Dolgov
2021-02-12 14:31:36 +03:00
parent 699186f430
commit 8f8675a26a
7 changed files with 256 additions and 441 deletions

View File

@@ -35,15 +35,23 @@ function print_select_hash($id, $default, $values, $attributes = "", $name = "")
print "</select>";
}
function print_hidden($name, $value) {
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"$name\" value=\"$value\">";
function format_hidden($name, $value) {
return "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"$name\" value=\"$value\">";
}
function print_checkbox($id, $checked, $value = "", $attributes = "") {
function print_hidden($name, $value) {
print format_hidden($name, $value);
}
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 = "") {