]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
support media:description for media: enclosures
[tt-rss.git] / include / functions.php
index 56361472ee5f4cc9b280fc6a5fce02932c89d7bf..6bc52e9d95db0cf1969daca91118580b8f7f8b53 100644 (file)
 
                                $url = $line["content_url"];
                                $ctype = $line["content_type"];
+                               $title = $line["title"];
 
                                if (!$ctype) $ctype = __("unknown type");
 
                                $entry["type"] = $ctype;
                                $entry["filename"] = $filename;
                                $entry["url"] = $url;
+                               $entry["title"] = $title;
 
                                array_push($entries, $entry);
                        }
                                                                        $rv .= "<p><a target=\"_blank\"
                                                                        href=\"".htmlspecialchars($entry["url"])."\"
                                                                        >" .htmlspecialchars($entry["url"]) . "</a></p>";
+                                                               }
 
+                                                               if ($entry['title']) {
+                                                                       $rv.= "<div class=\"enclosure_title\">${entry['title']}</div>";
                                                                }
                                                }
                                        }
                                "<option value=''>" . __('Attachments')."</option>";
 
                        foreach ($entries as $entry) {
-                               $rv .= "<option value=\"".htmlspecialchars($entry["url"])."\">" . htmlspecialchars($entry["filename"]) . "</option>";
+                               if ($entry["title"])
+                                       $title = "&mdash; " . truncate_string($entry["title"], 30);
+                               else
+                                       $title = "";
+
+                               $rv .= "<option value=\"".htmlspecialchars($entry["url"])."\">" . htmlspecialchars($entry["filename"]) . "$title</option>";
 
                        };