tt-rss/plugins/mark_button/init.php
Andrew Dolgov 21ce7d9ec0 update phpmd ruleset to use (subset) of cleancode
fix various minor issues reported by static analysis
remove redundant php closing tag from several more files
2017-04-26 20:57:36 +03:00

42 lines
807 B
PHP

<?php
class Mark_Button extends Plugin {
private $host;
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
}
function about() {
return array(1.0,
"Bottom un/star button for the combined mode",
"fox");
}
function hook_article_button($line) {
$marked_pic = "";
$id = $line["id"];
if (get_pref("COMBINED_DISPLAY_MODE")) {
if (sql_bool_to_bool($line["marked"])) {
$marked_pic = "<img
src=\"images/mark_set.png\"
class=\"markedPic\" alt=\"Unstar article\"
onclick='toggleMark($id)'>";
} else {
$marked_pic = "<img
src=\"images/mark_unset.png\"
class=\"markedPic\" alt=\"Star article\"
onclick='toggleMark($id)'>";
}
}
return $marked_pic;
}
function api_version() {
return 2;
}
}