]> git.wh0rd.org - tt-rss.git/blobdiff - classes/feeds.php
implement support for multiple pub/mark buttons, add plugin which adds a separate...
[tt-rss.git] / classes / feeds.php
index ff6b864e5da4890c5e034371e62d9bd593fa9de8..521aec708a47476cf37441859660032cdb61b637 100644 (file)
@@ -143,6 +143,10 @@ class Feeds extends Handler_Protected {
 
                //$reply .= "</h2";
 
+               foreach ($pluginhost->get_hooks($pluginhost::HOOK_HEADLINE_TOOLBAR_BUTTON) as $p) {
+                        echo $p->hook_headline_toolbar_button($feed_id, $is_cat);
+               }
+
                return $reply;
        }
 
@@ -339,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 = "<img id=\"FMPIC-$id\"
+                               if (sql_bool_to_bool($line["marked"])) {
+                                       $marked_pic = "<img
                                                src=\"images/mark_set.svg\"
                                                class=\"markedPic\" alt=\"Unstar article\"
-                                               onclick='javascript:toggleMark($id)'>";
+                                               onclick='toggleMark($id)'>";
+                                       $class .= " marked";
                                } else {
-                                       $marked_pic = "<img id=\"FMPIC-$id\"
+                                       $marked_pic = "<img
                                                src=\"images/mark_unset.svg\"
                                                class=\"markedPic\" alt=\"Star article\"
-                                               onclick='javascript:toggleMark($id)'>";
+                                               onclick='toggleMark($id)'>";
                                }
 
-                               if ($line["published"] == "t" || $line["published"] == "1") {
-                                       $published_pic = "<img id=\"FPPIC-$id\" src=\"images/pub_set.svg\"
-                                               class=\"markedPic\"
-                                               alt=\"Unpublish article\" onclick='javascript:togglePub($id)'>";
+                               if (sql_bool_to_bool($line["published"])) {
+                                       $published_pic = "<img src=\"images/pub_set.svg\"
+                                               class=\"pubPic\"
+                                                       alt=\"Unpublish article\" onclick='togglePub($id)'>";
+                                       $class .= " published";
                                } else {
-                                       $published_pic = "<img id=\"FPPIC-$id\" src=\"images/pub_unset.svg\"
-                                               class=\"markedPic\"
-                                               alt=\"Publish article\" onclick='javascript:togglePub($id)'>";
+                                       $published_pic = "<img src=\"images/pub_unset.svg\"
+                                               class=\"pubPic\"
+                                               alt=\"Publish article\" onclick='togglePub($id)'>";
                                }
 
 #                              $content_link = "<a target=\"_blank\" href=\"".$line["link"]."\">" .
@@ -453,7 +456,7 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\"
                                                        type=\"checkbox\" onclick=\"toggleSelectRow2(this)\"
-                                                       id=\"RCHK-$id\">";
+                                                       class='rchk'>";
 
                                        $reply['content'] .= "$marked_pic";
                                        $reply['content'] .= "$published_pic";
@@ -559,7 +562,7 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\"
                                                        type=\"checkbox\" onclick=\"toggleSelectRow2(this, false, true)\"
-                                                       id=\"RCHK-$id\">";
+                                                       class='rchk'>";
 
                                        $reply['content'] .= "$marked_pic";
                                        $reply['content'] .= "$published_pic";
@@ -702,6 +705,9 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<div style=\"float : right\">";
 
+//                                     $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);
                                        }
@@ -735,7 +741,7 @@ class Feeds extends Handler_Protected {
                                        break;
                                default:
                                        if ($feed < LABEL_BASE_INDEX) {
-                                               $message = __("No articles found to display. You can assign articles to labels manually (see the Actions menu above) or use a filter.");
+                                               $message = __("No articles found to display. You can assign articles to labels manually from article header context menu (applies to all selected articles) or use a filter.");
                                        } else {
                                                $message = __("No articles found to display.");
                                        }
@@ -792,7 +798,7 @@ class Feeds extends Handler_Protected {
                $feed = db_escape_string($this->link, $_REQUEST["feed"]);
                $method = db_escape_string($this->link, $_REQUEST["m"]);
                $view_mode = db_escape_string($this->link, $_REQUEST["view_mode"]);
-               $limit = (int) get_pref($this->link, "DEFAULT_ARTICLE_LIMIT");
+               $limit = 30;
                @$cat_view = $_REQUEST["cat"] == "true";
                @$next_unread_feed = db_escape_string($this->link, $_REQUEST["nuf"]);
                @$offset = db_escape_string($this->link, $_REQUEST["skip"]);
@@ -862,12 +868,15 @@ class Feeds extends Handler_Protected {
                $override_order = false;
 
                switch ($order_by) {
-                       case "date_reverse":
-                               $override_order = "date_entered, updated";
-                               break;
-                       case "feed_dates":
-                               $override_order = "updated DESC";
-                               break;
+               case "title":
+                       $override_order = "ttrss_entries.title";
+                       break;
+               case "date_reverse":
+                       $override_order = "date_entered, updated";
+                       break;
+               case "feed_dates":
+                       $override_order = "updated DESC";
+                       break;
                }
 
                if ($_REQUEST["debug"]) $timing_info = print_checkpoint("04", $timing_info);