1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 19:05:55 +00:00

implement support for multiple pub/mark buttons, add plugin which adds a separate mark button to article botton in combined mode (closes #382)

This commit is contained in:
Andrew Dolgov
2013-04-09 16:13:32 +04:00
parent af4204def2
commit 035d7a5a8f
4 changed files with 95 additions and 44 deletions

View File

@@ -0,0 +1,39 @@
<?php
class Mark_Button extends Plugin {
private $link;
private $host;
function init($host) {
$this->link = $host->get_link();
$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 = "";
if (get_pref($this->link, "COMBINED_DISPLAY_MODE")) {
if (sql_bool_to_bool($line["marked"])) {
$marked_pic = "<img
src=\"images/mark_set.svg\"
class=\"markedPic\" alt=\"Unstar article\"
onclick='toggleMark($id)'>";
} else {
$marked_pic = "<img
src=\"images/mark_unset.svg\"
class=\"markedPic\" alt=\"Star article\"
onclick='toggleMark($id)'>";
}
}
return $marked_pic;
}
}
?>