summaryrefslogtreecommitdiff
path: root/plugins/mark_button/init.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mark_button/init.php')
-rw-r--r--plugins/mark_button/init.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/plugins/mark_button/init.php b/plugins/mark_button/init.php
new file mode 100644
index 000000000..971b12932
--- /dev/null
+++ b/plugins/mark_button/init.php
@@ -0,0 +1,43 @@
+<?php
+class Mark_Button extends Plugin {
+ private $host;
+
+ function init($host) {
+ $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 = "";
+ $id = $line["id"];
+
+ if (get_pref("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;
+ }
+
+ function api_version() {
+ return 2;
+ }
+
+}
+?>