add some print_checkbox/print_button calls; rename some plugin preference pane titles

This commit is contained in:
Andrew Dolgov 2017-02-10 14:57:25 +03:00
parent 51198e7e40
commit dc8bd8a640
5 changed files with 18 additions and 34 deletions

View File

@ -667,10 +667,11 @@
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"$name\" value=\"$value\">"; print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"$name\" value=\"$value\">";
} }
function print_checkbox($id, $checked, $attributes = "") { function print_checkbox($id, $checked, $value = "", $attributes = "") {
$checked_str = $checked ? "checked" : ""; $checked_str = $checked ? "checked" : "";
$value_str = $value ? "value=\"$value\"" : "";
print "<input dojoType=\"dijit.form.CheckBox\" id=\"$id\" $checked_str $attributes name=\"$id\">"; print "<input dojoType=\"dijit.form.CheckBox\" id=\"$id\" $value_str $checked_str $attributes name=\"$id\">";
} }
function print_button($type, $value, $attributes = "") { function print_button($type, $value, $attributes = "") {

View File

@ -134,8 +134,6 @@ class Af_Psql_Trgm extends Plugin {
if (!$similarity) $similarity = '0.75'; if (!$similarity) $similarity = '0.75';
if (!$min_title_length) $min_title_length = '32'; if (!$min_title_length) $min_title_length = '32';
$enable_globally_checked = $enable_globally ? "checked" : "";
print "<form dojoType=\"dijit.form.Form\">"; print "<form dojoType=\"dijit.form.Form\">";
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\"> print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
@ -174,15 +172,13 @@ class Af_Psql_Trgm extends Plugin {
placeholder=\"32\" placeholder=\"32\"
required=\"1\" name=\"min_title_length\" value=\"$min_title_length\"></td></tr>"; required=\"1\" name=\"min_title_length\" value=\"$min_title_length\"></td></tr>";
print "<tr><td width=\"40%\">" . __("Enable for all feeds:") . "</td>"; print "<tr><td width=\"40%\">" . __("Enable for all feeds:") . "</td>";
print "<td> print "<td>";
<input dojoType=\"dijit.form.CheckBox\" print_checkbox("enable_globally", $enable_globally);
$enable_globally_checked name=\"enable_globally\"></td></tr>"; print "</td></tr>";
print "</table>"; print "</table>";
print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" . print "<p>"; print_button("submit", __("Save"));
__("Save") . "</button>";
print "</form>"; print "</form>";
$enabled_feeds = $this->host->get($this, "enabled_feeds"); $enabled_feeds = $this->host->get($this, "enabled_feeds");

View File

@ -36,7 +36,7 @@ class Af_Readability 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=\"".__('af_readability settings')."\">"; print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Readability settings (af_readability)')."\">";
print_notice("Enable the plugin for specific feeds in the feed editor."); print_notice("Enable the plugin for specific feeds in the feed editor.");
@ -61,15 +61,11 @@ class Af_Readability extends Plugin {
print_hidden("plugin", "af_readability"); print_hidden("plugin", "af_readability");
$enable_share_anything = $this->host->get($this, "enable_share_anything"); $enable_share_anything = $this->host->get($this, "enable_share_anything");
$enable_share_anything_checked = $enable_share_anything ? "checked" : "";
print "<input dojoType=\"dijit.form.CheckBox\" print_checkbox("enable_share_anything", $enable_share_anything);
$enable_share_anything_checked name=\"enable_share_anything\" id=\"enable_share_anything\"> print "&nbsp;<label for=\"enable_share_anything\">" . __("Use Readability for pages shared via bookmarklet.") . "</label>";
<label for=\"enable_share_anything\">" . __("Use Readability for pages shared via bookmarklet.") . "</label>";
print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".
__("Save")."</button>";
print "<p>"; print_button("submit", __("Save"));
print "</form>"; print "</form>";
$enabled_feeds = $this->host->get($this, "enabled_feeds"); $enabled_feeds = $this->host->get($this, "enabled_feeds");

View File

@ -22,13 +22,10 @@ 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 id=\"af_redditimgur_prefs\" dojoType=\"dijit.layout.AccordionPane\" title=\"".__('af_redditimgur settings')."\">"; print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Reddit content settings (af_redditimgur)')."\">";
$enable_readability = $this->host->get($this, "enable_readability"); $enable_readability = $this->host->get($this, "enable_readability");
$enable_readability_checked = $enable_readability ? "checked" : "";
$enable_content_dupcheck = $this->host->get($this, "enable_content_dupcheck"); $enable_content_dupcheck = $this->host->get($this, "enable_content_dupcheck");
$enable_content_dupcheck_checked = $enable_content_dupcheck ? "checked" : "";
print "<form dojoType=\"dijit.form.Form\">"; print "<form dojoType=\"dijit.form.Form\">";
@ -53,20 +50,14 @@ class Af_RedditImgur extends Plugin {
print "<p>" . __("Uses Readability (full-text-rss) implementation by <a target='_blank' href='https://bitbucket.org/fivefilters/'>FiveFilters.org</a>"); print "<p>" . __("Uses Readability (full-text-rss) implementation by <a target='_blank' href='https://bitbucket.org/fivefilters/'>FiveFilters.org</a>");
print "<p/>"; print "<p/>";
print "<input dojoType=\"dijit.form.CheckBox\" id=\"enable_readability\" print_checkbox("enable_readability", $enable_readability);
$enable_readability_checked name=\"enable_readability\">&nbsp;"; print "&nbsp;<label for=\"enable_readability\">" . __("Extract missing content using Readability") . "</label>";
print "<label for=\"enable_readability\">" . __("Extract missing content using Readability") . "</label>";
print "<br/>"; print "<br/>";
print "<input dojoType=\"dijit.form.CheckBox\" id=\"enable_content_dupcheck\" print_checkbox("enable_content_dupcheck", $enable_content_dupcheck);
$enable_content_dupcheck_checked name=\"enable_content_dupcheck\">&nbsp;"; print "&nbsp;<label for=\"enable_content_dupcheck\">" . __("Enable additional duplicate checking") . "</label>";
print "<p>"; print_button("submit", __("Save"));
print "<label for=\"enable_content_dupcheck\">" . __("Enable additional duplicate checking") . "</label>";
print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".
__("Save")."</button>";
print "</form>"; print "</form>";
print "</div>"; print "</div>";

View File

@ -139,7 +139,7 @@ class Af_Zz_ImgProxy 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=\"".__('af_zz_imgproxy Settings')."\">"; print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Image proxy settings (af_zz_imgproxy)')."\">";
print "<form dojoType=\"dijit.form.Form\">"; print "<form dojoType=\"dijit.form.Form\">";