]> git.wh0rd.org Git - tt-rss.git/commitdiff
add some print_checkbox/print_button calls; rename some plugin preference pane titles
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Fri, 10 Feb 2017 11:57:25 +0000 (14:57 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Fri, 10 Feb 2017 11:57:25 +0000 (14:57 +0300)
include/functions.php
plugins/af_psql_trgm/init.php
plugins/af_readability/init.php
plugins/af_redditimgur/init.php
plugins/af_zz_imgproxy/init.php

index 072779615ec1f07c5ebc1c3ba1d379aa625e583b..cdd783cdc826b08defa7ac48fe6406bb36b31e42 100644 (file)
                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" : "";
+               $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 = "") {
index 63c52bf2d0d50a59ee0338371b9be60d12ecbc49..8c92be1ab8799873f1d636a65bcc736972140904 100644 (file)
@@ -134,8 +134,6 @@ class Af_Psql_Trgm extends Plugin {
                        if (!$similarity) $similarity = '0.75';
                        if (!$min_title_length) $min_title_length = '32';
 
-                       $enable_globally_checked = $enable_globally ? "checked" : "";
-
                        print "<form dojoType=\"dijit.form.Form\">";
 
                        print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
@@ -174,15 +172,13 @@ class Af_Psql_Trgm extends Plugin {
                                placeholder=\"32\"
                                required=\"1\" name=\"min_title_length\" value=\"$min_title_length\"></td></tr>";
                        print "<tr><td width=\"40%\">" . __("Enable for all feeds:") . "</td>";
-                       print "<td>
-                               <input dojoType=\"dijit.form.CheckBox\"
-                               $enable_globally_checked name=\"enable_globally\"></td></tr>";
+                       print "<td>";
+                       print_checkbox("enable_globally", $enable_globally);
+                       print "</td></tr>";
 
                        print "</table>";
 
-                       print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" .
-                               __("Save") . "</button>";
-
+                       print "<p>"; print_button("submit", __("Save"));
                        print "</form>";
 
                        $enabled_feeds = $this->host->get($this, "enabled_feeds");
index a4cb892af0ee9b05374ec59bb112b4164e9109de..9557a9791eaa891679dcc6b67f300d0b78ea0aa1 100755 (executable)
@@ -36,7 +36,7 @@ class Af_Readability extends Plugin {
        function hook_prefs_tab($args) {
                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.");
 
@@ -61,15 +61,11 @@ class Af_Readability extends Plugin {
                print_hidden("plugin", "af_readability");
 
                $enable_share_anything = $this->host->get($this, "enable_share_anything");
-               $enable_share_anything_checked = $enable_share_anything ? "checked" : "";
 
-               print "<input dojoType=\"dijit.form.CheckBox\"
-                       $enable_share_anything_checked name=\"enable_share_anything\" id=\"enable_share_anything\">
-                       <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_checkbox("enable_share_anything", $enable_share_anything);
+               print "&nbsp;<label for=\"enable_share_anything\">" . __("Use Readability for pages shared via bookmarklet.") . "</label>";
 
+               print "<p>"; print_button("submit", __("Save"));
                print "</form>";
 
                $enabled_feeds = $this->host->get($this, "enabled_feeds");
index b5b4cca346e7b6d2719bc45fc59b5af93b6f9835..aa3ef59bb3ba807203baa138e15849e8cb685e15 100755 (executable)
@@ -22,13 +22,10 @@ class Af_RedditImgur extends Plugin {
        function hook_prefs_tab($args) {
                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_checked = $enable_readability ? "checked" : "";
-
                $enable_content_dupcheck = $this->host->get($this, "enable_content_dupcheck");
-               $enable_content_dupcheck_checked = $enable_content_dupcheck ? "checked" : "";
 
                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/>";
 
-               print "<input dojoType=\"dijit.form.CheckBox\" id=\"enable_readability\"
-                       $enable_readability_checked name=\"enable_readability\">&nbsp;";
-
-               print "<label for=\"enable_readability\">" . __("Extract missing content using Readability") . "</label>";
+               print_checkbox("enable_readability", $enable_readability);
+               print "&nbsp;<label for=\"enable_readability\">" . __("Extract missing content using Readability") . "</label>";
 
                print "<br/>";
 
-               print "<input dojoType=\"dijit.form.CheckBox\" id=\"enable_content_dupcheck\"
-                       $enable_content_dupcheck_checked name=\"enable_content_dupcheck\">&nbsp;";
-
-               print "<label for=\"enable_content_dupcheck\">" . __("Enable additional duplicate checking") . "</label>";
-               print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".
-                       __("Save")."</button>";
-
+               print_checkbox("enable_content_dupcheck", $enable_content_dupcheck);
+               print "&nbsp;<label for=\"enable_content_dupcheck\">" . __("Enable additional duplicate checking") . "</label>";
+               print "<p>"; print_button("submit", __("Save"));
                print "</form>";
 
                print "</div>";
index 67ca6c30f6718fb74eba0b714313291937de2d72..9449a518b0800e3d228f2be855715f57376d659b 100644 (file)
@@ -139,7 +139,7 @@ class Af_Zz_ImgProxy extends Plugin {
        function hook_prefs_tab($args) {
                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\">";