]> git.wh0rd.org - tt-rss.git/commitdiff
tweak the enclosure dropdown display a little bit for less-readable urls
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Tue, 17 Jan 2017 11:04:00 +0000 (14:04 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Tue, 17 Jan 2017 11:04:00 +0000 (14:04 +0300)
include/functions2.php

index 6b6f5aa560b630d393b28f42c44e738fad2dcf78..4535e62670a9d4217b4c20681d7464bfc6b706ac 100644 (file)
 
                                if (!$ctype) $ctype = __("unknown type");
 
-                               $filename = substr($url, strrpos($url, "/")+1);
+                               //$filename = substr($url, strrpos($url, "/")+1);
+                               $filename = basename($url);
 
                                $player = format_inline_player($url, $ctype);
 
 
                        foreach ($entries as $entry) {
                                if ($entry["title"])
-                                       $title = "&mdash; " . truncate_string($entry["title"], 30);
+                                       $title = " &mdash; " . truncate_string($entry["title"], 30);
                                else
                                        $title = "";
 
+                               if ($entry["filename"])
+                                       $filename = truncate_middle(htmlspecialchars($entry["filename"]), 60);
+                               else
+                                       $filename = "";
+
                                $rv .= "<div onclick='window.open(\"".htmlspecialchars($entry["url"])."\")'
-                                       dojoType=\"dijit.MenuItem\">".htmlspecialchars($entry["filename"])."$title</div>";
+                                       dojoType=\"dijit.MenuItem\">".$filename . $title."</div>";
 
                        };