diff options
author | Andrew Dolgov <[email protected]> | 2021-02-16 14:42:27 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-16 14:42:27 +0300 |
commit | d7127cead362ba00b0defd93b2091ce15aeae2f3 (patch) | |
tree | 63c0c9f5f092e3f5161a26cee4775a0584321f7c | |
parent | 1f43d7916cda16e9680b9087bda1f52934e8f25b (diff) |
feed debugger: use hidden helpers; add button helpers
-rwxr-xr-x | classes/feeds.php | 14 | ||||
-rwxr-xr-x | include/controls.php | 8 |
2 files changed, 15 insertions, 7 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index aa1f889e0..400c302d6 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -697,12 +697,12 @@ class Feeds extends Handler_Protected { <div class="container"> <h1>Feed Debugger: <?= "$feed_id: " . $this->_get_title($feed_id) ?></h1> <div class="content"> - <form method="post" action=""> - <input type="hidden" name="op" value="feeds"> - <input type="hidden" name="method" value="updatedebugger"> - <input type="hidden" name="csrf_token" value="<?= $csrf_token ?>"> - <input type="hidden" name="action" value="do_update"> - <input type="hidden" name="feed_id" value="<?= $feed_id ?>"> + <form method="post" action="" dojoType="dijit.form.Form"> + <?= \Controls\hidden_tag("op", "feeds") ?> + <?= \Controls\hidden_tag("method", "updatedebugger") ?> + <?= \Controls\hidden_tag("csrf_token", $csrf_token) ?> + <?= \Controls\hidden_tag("action", "do_update") ?> + <?= \Controls\hidden_tag("feed_id", (string)$feed_id) ?> <fieldset> <label> @@ -719,7 +719,7 @@ class Feeds extends Handler_Protected { <label class="checkbox"><input dojoType="dijit.form.CheckBox" type="checkbox" name="force_rehash" value="1" <?= $rehash_checked ?>> Force rehash</label> </fieldset> - <button type="submit" dojoType="dijit.form.Button" class="alt-primary">Continue</button> + <?= \Controls\submit_tag("Continue") ?> </form> <hr> diff --git a/include/controls.php b/include/controls.php index 34a4af1f2..78f02233f 100755 --- a/include/controls.php +++ b/include/controls.php @@ -1,6 +1,14 @@ <?php namespace Controls; + function button_tag(string $value, string $type, $attributes = "") { + return "<button dojoType=\"dijit.form.Button\" $attributes type=\"$type\">".htmlspecialchars($value)."</button>"; + } + + function submit_tag(string $value, $attributes = "") { + return button_tag($value, "submit", "class=\"alt-primary\" $attributes"); + } + function select_tag(string $name, $value, array $values, string $attributes = "", string $id = "") { $dojo_type = strpos($attributes, "dojoType") === false ? "dojoType='fox.form.Select'" : ""; |