af_redditimgur: cleanup markup

This commit is contained in:
Andrew Dolgov 2021-02-17 13:35:10 +03:00
parent 91049335eb
commit 7587f2cdc6
1 changed files with 45 additions and 44 deletions

View File

@ -31,20 +31,21 @@ class Af_RedditImgur 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\"
title=\"<i class='material-icons'>extension</i> ".__('Reddit content settings (af_redditimgur)')."\">";
$enable_readability = $this->host->get($this, "enable_readability"); $enable_readability = $this->host->get($this, "enable_readability");
$enable_content_dupcheck = $this->host->get($this, "enable_content_dupcheck"); $enable_content_dupcheck = $this->host->get($this, "enable_content_dupcheck");
$reddit_to_teddit = $this->host->get($this, "reddit_to_teddit"); $reddit_to_teddit = $this->host->get($this, "reddit_to_teddit");
?>
if (version_compare(PHP_VERSION, '5.6.0', '<')) { <div dojoType="dijit.layout.AccordionPane"
print_error("Readability requires PHP version 5.6."); title="<i class='material-icons'>extension</i> <?= __('Reddit content settings (af_redditimgur)') ?>">
}
print "<form dojoType='dijit.form.Form'>"; <form dojoType='dijit.form.Form'>
print "<script type='dojo/method' event='onSubmit' args='evt'> <?= \Controls\hidden_tag("op", "pluginhandler") ?>
<?= \Controls\hidden_tag("method", "save") ?>
<?= \Controls\hidden_tag("plugin", "af_redditimgur") ?>
<script type='dojo/method' event='onSubmit' args='evt'>
evt.preventDefault(); evt.preventDefault();
if (this.validate()) { if (this.validate()) {
console.log(dojo.objectToQuery(this.getValues())); console.log(dojo.objectToQuery(this.getValues()));
@ -54,37 +55,37 @@ class Af_RedditImgur extends Plugin {
Notify.info(transport.responseText); Notify.info(transport.responseText);
} }
}); });
//this.reset();
} }
</script>"; </script>
print \Controls\hidden_tag("op", "pluginhandler"); <fieldset class='narrow'>
print \Controls\hidden_tag("method", "save"); <label class='checkbox'>
print \Controls\hidden_tag("plugin", "af_redditimgur"); <?= \Controls\checkbox_tag("enable_readability", $enable_readability) ?>
<?= __("Extract missing content using Readability (requires af_readability)") ?>
</label>
</fieldset>
print "<fieldset class='narrow'>"; <fieldset class='narrow'>
print "<label class='checkbox'>"; <label class='checkbox'>
print \Controls\checkbox_tag("enable_readability", $enable_readability); <?= \Controls\checkbox_tag("enable_content_dupcheck", $enable_content_dupcheck) ?>
print " " . __("Extract missing content using Readability (requires af_readability)") . "</label>"; <?= __("Enable additional duplicate checking") ?>
print "</fieldset>"; </label>
</fieldset>
print "<fieldset class='narrow'>"; <fieldset class='narrow'>
print "<label class='checkbox'>"; <label class='checkbox'>
print \Controls\checkbox_tag("enable_content_dupcheck", $enable_content_dupcheck); <?= \Controls\checkbox_tag("reddit_to_teddit", $reddit_to_teddit) ?>
print " " . __("Enable additional duplicate checking") . "</label>"; <?= T_sprintf("Rewrite Reddit URLs to %s",
print "</fieldset>"; "<a target=\"_blank\" href=\"https://teddit.net/about\">Teddit</a>") ?>
</label>
</fieldset>
print "<fieldset class='narrow'>"; <hr/>
print "<label class='checkbox'>"; <?= \Controls\submit_tag(__("Save")) ?>
print \Controls\checkbox_tag("reddit_to_teddit", $reddit_to_teddit); </form>
print " " . T_sprintf("Rewrite Reddit URLs to %s", </div>
"<a target=\"_blank\" href=\"https://teddit.net/about\">Teddit</a>") . "</label>";
print "<hr/>"; <?php
print \Controls\submit_tag(__("Save"));
print "</form>";
print "</div>";
} }
function save() { function save() {