diff options
author | Andrew Dolgov <[email protected]> | 2021-02-16 15:05:32 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-16 15:05:32 +0300 |
commit | af4b3e7df06e50e956e9fda281935a7483f5673a (patch) | |
tree | 77fc2ba8a4ecdeb40b8c57e1ec12d0550379439f /include | |
parent | 22fc6871e8eca507578381bda6d6683d2082810b (diff) |
login form: use control helpers
Diffstat (limited to 'include')
-rwxr-xr-x | include/controls.php | 4 | ||||
-rwxr-xr-x | include/login_form.php | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/include/controls.php b/include/controls.php index 78f02233f..b351a9449 100755 --- a/include/controls.php +++ b/include/controls.php @@ -64,12 +64,12 @@ name=\"".htmlspecialchars($name)."\" value=\"".htmlspecialchars($value)."\">"; } - function checkbox_tag(string $name, bool $checked, string $value = "", string $attributes = "", string $id = "") { + function checkbox_tag(string $name, bool $checked = false, string $value = "", string $attributes = "", string $id = "") { $is_checked = $checked ? "checked" : ""; $value_str = $value ? "value=\"".htmlspecialchars($value)."\"" : ""; return "<input dojoType='dijit.form.CheckBox' name=\"".htmlspecialchars($name)."\" - $value_str $is_checked $attributes name=\"".htmlspecialchars($id)."\">"; + $value_str $is_checked $attributes id=\"".htmlspecialchars($id)."\">"; } function select_feeds_cats(string $name, int $default_id = null, string $attributes = "", diff --git a/include/login_form.php b/include/login_form.php index 798efa624..e4eb52a51 100755 --- a/include/login_form.php +++ b/include/login_form.php @@ -141,8 +141,8 @@ <fieldset class="narrow"> <label> </label> - <label id="bw_limit_label"><input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" - type="checkbox" onchange="UtilityApp.bwLimitChange(this)"> + <label id="bw_limit_label"> + <?= \Controls\checkbox_tag("safe_mode", false, "", "onchange='UtilityApp.bwLimitChange(this)'", 'bw_limit') ?> <?= __("Use less traffic") ?></label> </fieldset> @@ -153,9 +153,10 @@ <fieldset class="narrow"> <label> </label> - <label id="safe_mode_label"><input dojoType="dijit.form.CheckBox" name="safe_mode" id="safe_mode" - type="checkbox"> - <?= __("Safe mode") ?></label> + <label id="safe_mode_label"> + <?= \Controls\checkbox_tag("safe_mode") ?> + <?= __("Safe mode") ?> + </label> </fieldset> <div dojoType="dijit.Tooltip" connectId="safe_mode_label" position="below" style="display:none"> @@ -166,7 +167,7 @@ <fieldset class="narrow"> <label> </label> <label> - <input dojoType="dijit.form.CheckBox" name="remember_me" id="remember_me" type="checkbox"> + <?= \Controls\checkbox_tag("remember_me") ?> <?= __("Remember me") ?> </label> </fieldset> @@ -177,7 +178,7 @@ <fieldset class="align-right"> <label> </label> - <button dojoType="dijit.form.Button" type="submit" class="alt-primary"><?= __('Log in') ?></button> + <?= \Controls\submit_tag(__('Log in')) ?> </fieldset> </form> |