]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
add hack to support arbitrary key descriptions for hotkeys
[tt-rss.git] / include / functions.php
index 7dc109460270cf479ff0071662aa77d51938300c..ac3a8861e0cc33c633ca60f9d330e118dc3b2e3e 100644 (file)
                $params["hotkeys"] = get_hotkeys_map($link);
 
                $params["csrf_token"] = $_SESSION["csrf_token"];
+               $params["widescreen"] = (int) $_SESSION["widescreen"];
 
                return $params;
        }
                                "article_scroll_down" => __("Scroll down"),
                                "article_scroll_up" => __("Scroll up"),
                                "select_article_cursor" => __("Select article under cursor"),
-                               "email_article" => __("Email article")),
+                               "email_article" => __("Email article"),
+                               "toggle_widescreen" => __("Toggle widescreen mode")),
                        __("Article selection") => array(
                                "select_all" => __("Select all articles"),
                                "select_unread" => __("Select unread"),
                                "j" => "prev_feed",
                                "n" => "next_article",
                                "p" => "prev_article",
-                               "(38)" => "prev_article",
-                               "(40)" => "next_article",
-                               "/" => "search_dialog",
+                               "(38)|up" => "prev_article",
+                               "(40)|down" => "next_article",
+                               "(191)|/" => "search_dialog",
 //                     "article" => array(
                                "s" => "toggle_mark",
                                "S" => "toggle_publ",
                                "c n" => "catchup_above",
                                "N" => "article_scroll_down",
                                "P" => "article_scroll_up",
+                               "a W" => "toggle_widescreen",
                                "e" => "email_article",
 //                     "article_selection" => array(
                                "a a" => "select_all",
                                "g t" => "goto_tagcloud",
                                "g P" => "goto_prefs",
 //                     "other" => array(
-                               "(9)" => "select_article_cursor", // tab
+                               "(9)|tab" => "select_article_cursor", // tab
                                "c l" => "create_label",
                                "c f" => "create_filter",
                                "c s" => "collapse_sidebar",
-                               "(191)" => "help_dialog",
                        );
 
                global $pluginhost;
 
                                $id = 'AUDIO-' . uniqid();
 
-                               $entry .= "<audio id=\"$id\"\">
-                                       <source src=\"$url\"></source>
+                               $entry .= "<audio id=\"$id\"\" controls>
+                                       <source type=\"$ctype\" src=\"$url\"></source>
                                        </audio>";
 
                                $entry .= "<span onclick=\"player(this)\"
                                                value=\"lib/button/musicplayer.swf?song_url=$url\" />
                                        </object>";
                        }
+
+                       if ($entry) $entry .= "&nbsp;" . basename($url);
+
+                       return $entry;
+
                }
 
-               $filename = substr($url, strrpos($url, "/")+1);
+               return "";
+
+/*             $filename = substr($url, strrpos($url, "/")+1);
 
                $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
-                       $filename . " (" . $ctype . ")" . "</a>";
+                       $filename . " (" . $ctype . ")" . "</a>"; */
 
-               return $entry;
        }
 
        function format_article($link, $id, $mark_as_read = true, $zoom_mode = false, $owner_uid = false) {
 
                        $entries_html = array();
                        $entries = array();
+                       $entries_inline = array();
 
                        foreach ($result as $line) {
 
 
                                $filename = substr($url, strrpos($url, "/")+1);
 
-#                              $player = format_inline_player($link, $url, $ctype);
+                               $player = format_inline_player($link, $url, $ctype);
+
+                               if ($player) array_push($entries_inline, $player);
 
 #                              $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
 #                                      $filename . " (" . $ctype . ")" . "</a>";
                                }
                        }
 
+                       if (count($entries_inline) > 0) {
+                               $rv .= "<hr clear='both'/>";
+                               foreach ($entries_inline as $entry) { $rv .= $entry; };
+                               $rv .= "<hr clear='both'/>";
+                       }
+
                        $rv .= "<br/><div dojoType=\"dijit.form.DropDownButton\">".
                                "<span>" . __('Attachments')."</span>";
                        $rv .= "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";