]> git.wh0rd.org - tt-rss.git/blame - plugins/mark_button/init.php
feedbrowser hack
[tt-rss.git] / plugins / mark_button / init.php
CommitLineData
035d7a5a
AD
1<?php
2class Mark_Button extends Plugin {
035d7a5a
AD
3 private $host;
4
5 function init($host) {
035d7a5a
AD
6 $this->host = $host;
7
8 $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
9 }
10
11 function about() {
12 return array(1.0,
13 "Bottom un/star button for the combined mode",
14 "fox");
15 }
16
17 function hook_article_button($line) {
18 $marked_pic = "";
1666e955 19 $id = $line["id"];
035d7a5a 20
a42c55f0 21 if (get_pref("COMBINED_DISPLAY_MODE")) {
035d7a5a
AD
22 if (sql_bool_to_bool($line["marked"])) {
23 $marked_pic = "<img
2f20dd58 24 src=\"images/mark_set.png\"
035d7a5a
AD
25 class=\"markedPic\" alt=\"Unstar article\"
26 onclick='toggleMark($id)'>";
27 } else {
28 $marked_pic = "<img
84700dc2 29 src=\"images/mark_unset.png\"
035d7a5a
AD
30 class=\"markedPic\" alt=\"Star article\"
31 onclick='toggleMark($id)'>";
32 }
33 }
34
35 return $marked_pic;
36 }
106a3de9
AD
37
38 function api_version() {
39 return 2;
40 }
41
035d7a5a 42}