]> git.wh0rd.org - tt-rss.git/blob - plugins/mark_button/init.php
4cf1c5949db0b7a1c4c7adf3dc407ed9ec6f3451
[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 $id = $line["id"];
22
23 if (get_pref($this->link, "COMBINED_DISPLAY_MODE")) {
24 if (sql_bool_to_bool($line["marked"])) {
25 $marked_pic = "<img
26 src=\"images/mark_set.svg\"
27 class=\"markedPic\" alt=\"Unstar article\"
28 onclick='toggleMark($id)'>";
29 } else {
30 $marked_pic = "<img
31 src=\"images/mark_unset.svg\"
32 class=\"markedPic\" alt=\"Star article\"
33 onclick='toggleMark($id)'>";
34 }
35 }
36
37 return $marked_pic;
38 }
39 }
40 ?>