]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | class Mark_Button extends Plugin { | |
3 | private $host; | |
4 | ||
5 | function init($host) { | |
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 = ""; | |
19 | $id = $line["id"]; | |
20 | ||
21 | if (get_pref( "COMBINED_DISPLAY_MODE")) { | |
22 | if (sql_bool_to_bool($line["marked"])) { | |
23 | $marked_pic = "<img | |
24 | src=\"images/mark_set.svg\" | |
25 | class=\"markedPic\" alt=\"Unstar article\" | |
26 | onclick='toggleMark($id)'>"; | |
27 | } else { | |
28 | $marked_pic = "<img | |
29 | src=\"images/mark_unset.svg\" | |
30 | class=\"markedPic\" alt=\"Star article\" | |
31 | onclick='toggleMark($id)'>"; | |
32 | } | |
33 | } | |
34 | ||
35 | return $marked_pic; | |
36 | } | |
37 | } | |
38 | ?> |