]> git.wh0rd.org - tt-rss.git/blobdiff - classes/feeds.php
add a %d articles selected element
[tt-rss.git] / classes / feeds.php
index ed0785c092af25f17457ac1f735ec9aa62dcea73..c7b7a83e6acefe67d7e08221ec8fa2a0f792fe93 100644 (file)
@@ -9,18 +9,6 @@ class Feeds extends Handler_Protected {
                return array_search($method, $csrf_ignored) !== false;
        }
 
-       private function make_gradient($end, $class) {
-               $start = $class == "even" ? "#f0f0f0" : "#ffffff";
-
-               return "style='background: linear-gradient(left , $start 6%, $end 100%);
-                       background: -o-linear-gradient(left , $start 6%, $end 100%);
-                       background: -moz-linear-gradient(left , $start 6%, $end 100%);
-                       background: -webkit-linear-gradient(left , $start 6%, $end 100%);
-                       background: -ms-linear-gradient(left , $start 6%, $end 100%);
-                       background: -webkit-gradient(linear, left top, right top,
-                               color-stop(0.06, $start), color-stop(1, $end));'";
-       }
-
        private function format_headline_subtoolbar($feed_site_url, $feed_title,
                        $feed_id, $is_cat, $search,
                        $search_mode, $view_mode, $error) {
@@ -61,6 +49,7 @@ class Feeds extends Handler_Protected {
                // right part
 
                $reply .= "<span class='r'>";
+               $reply .= "<span id='selected_prompt'></span>";
                $reply .= "<span id='feed_title'>";
 
                if ($feed_site_url) {
@@ -304,7 +293,6 @@ class Feeds extends Handler_Protected {
                                $feed_id = $line["feed_id"];
                                $label_cache = $line["label_cache"];
                                $labels = false;
-                               $label_row_style = "";
 
                                if ($label_cache) {
                                        $label_cache = json_decode($label_cache, true);
@@ -319,22 +307,6 @@ class Feeds extends Handler_Protected {
 
                                if (!is_array($labels)) $labels = get_article_labels($this->link, $id);
 
-                               if (count($labels) > 0) {
-                                       for ($i = 0; $i < min(4, count($labels)); $i++) {
-                                               $bg = rgb2hsl(_color_unpack($labels[$i][3]));
-
-                                               if ($bg && $bg[1] > 0) {
-                                                       $bg[1] = 0.1;
-                                                       $bg[2] = 1;
-
-                                                       $bg = _color_pack(hsl2rgb($bg));
-                                                       $label_row_style = $this->make_gradient($bg, $class);;
-
-                                                       break;
-                                               }
-                                       }
-                               }
-
                                $labels_str = "<span id=\"HLLCTR-$id\">";
                                $labels_str .= format_article_labels($labels, $id);
                                $labels_str .= "</span>";
@@ -343,34 +315,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"]."\">" .
@@ -415,7 +386,7 @@ class Feeds extends Handler_Protected {
                                $entry_author = $line["author"];
 
                                if ($entry_author) {
-                                       $entry_author = " - $entry_author";
+                                       $entry_author = " &mdash; $entry_author";
                                }
 
                                $has_feed_icon = feed_has_icon($feed_id);
@@ -451,7 +422,7 @@ class Feeds extends Handler_Protected {
                                        $mouseover_attrs = "onmouseover='postMouseIn(event, $id)'
                                                onmouseout='postMouseOut($id)'";
 
-                                       $reply['content'] .= "<div class='hl $class' id='RROW-$id' $label_row_style $mouseover_attrs>";
+                                       $reply['content'] .= "<div class='hl $class' id='RROW-$id' $mouseover_attrs>";
 
                                        $reply['content'] .= "<div class='hlLeft'>";
 
@@ -679,6 +650,10 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<div class=\"cdmFooter\">";
 
+                                       foreach ($pluginhost->get_hooks($pluginhost::HOOK_ARTICLE_LEFT_BUTTON) as $p) {
+                                               $reply['content'] .= $p->hook_article_left_button($line);
+                                       }
+
                                        $tags_str = format_tags_string($line["tags"], $id);
 
                                        $reply['content'] .= "<img src='images/tag.png' alt='Tags' title='Tags'>
@@ -706,6 +681,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);
                                        }