}
function save() {
- $enable_share_anything = checkbox_to_sql_bool($_POST["enable_share_anything"]) == "true";
+ $enable_share_anything = checkbox_to_sql_bool($_POST["enable_share_anything"]);
$this->host->set($this, "enable_share_anything", $enable_share_anything);
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.");
}
</script>";
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pluginhandler\">";
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"save\">";
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"plugin\" value=\"af_readability\">";
+ print_hidden("op", "pluginhandler");
+ print_hidden("method", "save");
+ 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");
"<img src='images/pub_set.png'
style='vertical-align : middle'> <a href='#'
onclick='editFeed($f)'>".
- getFeedTitle($f) . "</a></li>";
+ Feeds::getFeedTitle($f) . "</a></li>";
}
print "</ul>";
}
$enabled_feeds = $this->host->get($this, "enabled_feeds");
if (!is_array($enabled_feeds)) $enabled_feeds = array();
- $enable = checkbox_to_sql_bool($_POST["af_readability_enabled"]) == 'true';
+ $enable = checkbox_to_sql_bool($_POST["af_readability_enabled"]);
$key = array_search($feed_id, $enabled_feeds);
if ($enable) {
$this->host->set($this, "enabled_feeds", $enabled_feeds);
}
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
function hook_article_filter_action($article, $action) {
return $this->process_article($article);
}
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT);
- @$result = curl_exec($ch);
+ @curl_exec($ch);
$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
if (strpos($content_type, "text/html") === FALSE)
}
}
-?>