summaryrefslogtreecommitdiff
path: root/plugins/mark_button
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-09 16:13:32 +0400
committerAndrew Dolgov <[email protected]>2013-04-09 16:13:32 +0400
commit035d7a5a8fae5620e9b6121a5b5fa270184096ba (patch)
treee0f53083d161256e5862765e61753a307b370cf6 /plugins/mark_button
parentaf4204def22268eab0bc42e92955d78dc15f822b (diff)
implement support for multiple pub/mark buttons, add plugin which adds a separate mark button to article botton in combined mode (closes #382)
Diffstat (limited to 'plugins/mark_button')
-rw-r--r--plugins/mark_button/init.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/mark_button/init.php b/plugins/mark_button/init.php
new file mode 100644
index 000000000..9227a5d17
--- /dev/null
+++ b/plugins/mark_button/init.php
@@ -0,0 +1,39 @@
+<?php
+class Mark_Button extends Plugin {
+ private $link;
+ private $host;
+
+ function init($host) {
+ $this->link = $host->get_link();
+ $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 = "";
+
+ if (get_pref($this->link, "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;
+ }
+}
+?>