Browse Source

tweak the enclosure dropdown display a little bit for less-readable urls

Andrew Dolgov 7 years ago
parent
commit
c606bd5741
1 changed files with 9 additions and 3 deletions
  1. 9 3
      include/functions2.php

+ 9 - 3
include/functions2.php

@@ -1944,7 +1944,8 @@
 
 				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);
 
@@ -2025,12 +2026,17 @@
 
 			foreach ($entries as $entry) {
 				if ($entry["title"])
-					$title = "— " . truncate_string($entry["title"], 30);
+					$title = " — " . 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>";
 
 			};