]> git.wh0rd.org - tt-rss.git/commitdiff
mobile: add view mode selection dropbox
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 30 Mar 2008 05:49:28 +0000 (06:49 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 30 Mar 2008 05:49:28 +0000 (06:49 +0100)
mobile/functions.php

index 99afe10c69ce556167e7af01b4d590c0851c6685..fe9dab4ed2375602b30f34c986a190219ba14b2f 100644 (file)
                $subop = $_GET["subop"];
                $catchup_op = $_GET["catchup_op"];
 
-               if (!$view_mode) $view_mode = "Adaptive";
+               if (!$view_mode) {
+                       if ($_SESSION["mobile:viewmode"]) {
+                               $view_mode = $_SESSION["mobile:viewmode"];
+                       } else {                        
+                               $view_mode = "adaptive";
+                       }
+               }
+
+               $_SESSION["mobile:viewmode"] = $view_mode;
+
                if (!$limit) $limit = 30;
                if (!$feed) $feed = 0;
 
                print "<a href=\"tt-rss.php\">Back</a>, ";
                print "<a href=\"tt-rss.php?go=sform&aid=$feed&ic=$cat_view\">Search</a>, ";
                print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=ForceUpdate\">Update</a>";
+
 #              print "Mark as read: ";
 #              print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=MarkAsRead\">Page</a>, ";
 #              print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=MarkAllRead\">Feed</a>";
 
                print ")</span>";
-               
+
+               print "&nbsp;" . __('View:');
+
+               print "<form style=\"display : inline\" method=\"GET\" action=\"tt-rss.php\">";
+
+               /* print "<select name=\"viewmode\">
+                       <option selected value=\"adaptive\"> " . __('Adaptive') . "</option>
+                       <option value=\"all_articles\">" . __('All Articles') . "</option>
+                       <option value=\"marked\">" . __('Starred') . "</option>
+                       <option value=\"unread\">" . __('Unread') . "</option>
+                       </select>"; */
+
+               $sel_values = array(
+                       "adaptive" => __("Adaptive"),
+                       "all_articles" => __("All Articles"),
+                       "unread" => __("Unread"),
+                       "marked" => __("Starred"));
+
+               print_select_hash("viewmode", $view_mode, $sel_values);
+
+               print "<input type=\"hidden\" name=\"id\" value=\"$feed\">
+               <input type=\"hidden\" name=\"go\" value=\"vf\">
+               <input type=\"submit\" value=\"".__('Refresh')."\">";
+               print "</form>";
+
                print "</div>";
        
                if (db_num_rows($result) > 0) {