af_proxy_http: markup cleanup

This commit is contained in:
Andrew Dolgov 2021-02-18 12:13:02 +03:00
parent e03d6379a6
commit ee0b66b6bd
1 changed files with 24 additions and 26 deletions

View File

@ -209,39 +209,37 @@ class Af_Proxy_Http extends Plugin {
function hook_prefs_tab($args) { function hook_prefs_tab($args) {
if ($args != "prefFeeds") return; if ($args != "prefFeeds") return;
?>
print "<div dojoType=\"dijit.layout.AccordionPane\" <div dojoType="dijit.layout.AccordionPane"
title=\"<i class='material-icons'>extension</i> ".__('Image proxy settings (af_proxy_http)')."\">"; title="<i class='material-icons'>extension</i> <?= __('Image proxy settings (af_proxy_http)') ?>">
print "<form dojoType=\"dijit.form.Form\">"; <form dojoType="dijit.form.Form">
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\"> <?= \Controls\pluginhandler_tags($this, "save") ?>
<script type="dojo/method" event="onSubmit" args="evt">
evt.preventDefault(); evt.preventDefault();
if (this.validate()) { if (this.validate()) {
console.log(dojo.objectToQuery(this.getValues())); xhrPost("backend.php", this.getValues(), (transport) => {
new Ajax.Request('backend.php', {
parameters: dojo.objectToQuery(this.getValues()),
onComplete: function(transport) {
Notify.info(transport.responseText); Notify.info(transport.responseText);
})
} }
}); </script>
//this.reset();
}
</script>";
print \Controls\pluginhandler_tags($this, "save"); <fieldset>
<label class="checkbox">
<?= \Controls\checkbox_tag("proxy_all", $this->host->get($this, "proxy_all")) ?>
<?= __("Enable proxy for all remote images.") ?>
</label>
</fieldset>
$proxy_all = sql_bool_to_bool($this->host->get($this, "proxy_all")); <hr/>
print \Controls\checkbox_tag("proxy_all", $proxy_all);
print "&nbsp;<label for=\"proxy_all\">" . __("Enable proxy for all remote images.") . "</label><br/>";
print "<hr/>"; <?= \Controls\submit_tag(__("Save")) ?>
</form>
print \Controls\submit_tag(__("Save")); </div>
<?php
print "</form>";
print "</div>";
} }
function save() { function save() {