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 = "") {
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\">
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");
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.");
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 " <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");
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\">";
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\"> ";
-
- print "<label for=\"enable_readability\">" . __("Extract missing content using Readability") . "</label>";
+ print_checkbox("enable_readability", $enable_readability);
+ print " <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\"> ";
-
- 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 " <label for=\"enable_content_dupcheck\">" . __("Enable additional duplicate checking") . "</label>";
+ print "<p>"; print_button("submit", __("Save"));
print "</form>";
print "</div>";
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\">";