]> git.wh0rd.org - tt-rss.git/blob - plugins/mark_button/init.php
implement support for multiple pub/mark buttons, add plugin which adds a separate...
[tt-rss.git] / plugins / mark_button / init.php
1 <?php
2 class Mark_Button extends Plugin {
3 private $link;
4 private $host;
5
6 function init($host) {
7 $this->link = $host->get_link();
8 $this->host = $host;
9
10 $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
11 }
12
13 function about() {
14 return array(1.0,
15 "Bottom un/star button for the combined mode",
16 "fox");
17 }
18
19 function hook_article_button($line) {
20 $marked_pic = "";
21
22 if (get_pref($this->link, "COMBINED_DISPLAY_MODE")) {
23 if (sql_bool_to_bool($line["marked"])) {
24 $marked_pic = "<img
25 src=\"images/mark_set.svg\"
26 class=\"markedPic\" alt=\"Unstar article\"
27 onclick='toggleMark($id)'>";
28 } else {
29 $marked_pic = "<img
30 src=\"images/mark_unset.svg\"
31 class=\"markedPic\" alt=\"Star article\"
32 onclick='toggleMark($id)'>";
33 }
34 }
35
36 return $marked_pic;
37 }
38 }
39 ?>