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) --- classes/feeds.php | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'classes/feeds.php') diff --git a/classes/feeds.php b/classes/feeds.php index ed0785c09..521aec708 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -343,34 +343,33 @@ class Feeds extends Handler_Protected { array_push($topmost_article_ids, $id); } - if ($line["unread"] == "t" || $line["unread"] == "1") { + if (sql_bool_to_bool($line["unread"])) { $class .= " Unread"; ++$num_unread; - $is_unread = true; - } else { - $is_unread = false; } - if ($line["marked"] == "t" || $line["marked"] == "1") { - $marked_pic = "\"Unstar"; + onclick='toggleMark($id)'>"; + $class .= " marked"; } else { - $marked_pic = "\"Star"; + onclick='toggleMark($id)'>"; } - if ($line["published"] == "t" || $line["published"] == "1") { - $published_pic = "\"Unpublish"; + if (sql_bool_to_bool($line["published"])) { + $published_pic = "\"Unpublish"; + $class .= " published"; } else { - $published_pic = "\"Publish"; + $published_pic = "\"Publish"; } # $content_link = "" . @@ -706,6 +705,9 @@ class Feeds extends Handler_Protected { $reply['content'] .= "
"; +// $reply['content'] .= "$marked_pic"; +// $reply['content'] .= "$published_pic"; + foreach ($pluginhost->get_hooks($pluginhost::HOOK_ARTICLE_BUTTON) as $p) { $reply['content'] .= $p->hook_article_button($line); } -- cgit v1.2.3