From 035d7a5a8fae5620e9b6121a5b5fa270184096ba Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 9 Apr 2013 16:13:32 +0400 Subject: implement support for multiple pub/mark buttons, add plugin which adds a separate mark button to article botton in combined mode (closes #382) --- plugins/mark_button/init.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 plugins/mark_button/init.php (limited to 'plugins') 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 @@ +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 = "\"Unstar"; + } else { + $marked_pic = "\"Star"; + } + } + + return $marked_pic; + } +} +?> -- cgit v1.2.3