]> git.wh0rd.org - tt-rss.git/commitdiff
experimental article attachment ui based on dijit dropdown
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 9 Jul 2012 16:48:34 +0000 (20:48 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 9 Jul 2012 16:48:34 +0000 (20:48 +0400)
include/functions.php

index 29b5d4677b11e8281bf756561b94042f42749bfd..06939c636e958647c7b95e2edadcaa62c3fbf871 100644 (file)
 
                                if (!$ctype) $ctype = __("unknown type");
 
-#                              $filename = substr($url, strrpos($url, "/")+1);
+                               $filename = substr($url, strrpos($url, "/")+1);
 
-                               $entry = format_inline_player($link, $url, $ctype);
+#                              $player = format_inline_player($link, $url, $ctype);
 
 #                              $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
 #                                      $filename . " (" . $ctype . ")" . "</a>";
 
+                               $entry = "<div onclick=\"window.open('".htmlspecialchars($url)."')\"
+                                       dojoType=\"dijit.MenuItem\">$filename ($ctype)</div>";
+
                                array_push($entries_html, $entry);
 
                                $entry = array();
                                array_push($entries, $entry);
                        }
 
-                       $rv .= "<div class=\"postEnclosures\">";
-
                        if (!get_pref($link, "STRIP_IMAGES")) {
                                if ($always_display_enclosures ||
                                                        !preg_match("/<img/i", $article_content)) {
                                                                $rv .= "<p><img
                                                                alt=\"".htmlspecialchars($entry["filename"])."\"
                                                                src=\"" .htmlspecialchars($entry["url"]) . "\"/></p>";
+
                                                }
                                        }
                                }
                        }
 
-                       if (count($entries) == 1) {
-                               $rv .= __("Attachment:") . " ";
-                       } else {
-                               $rv .= __("Attachments:") . " ";
-                       }
+                       $rv .= "<div dojoType=\"dijit.form.DropDownButton\">".
+                               "<span>" . __('Attachments')."</span>";
+                       $rv .= "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
 
-                       $rv .= join(", ", $entries_html);
+                       foreach ($entries_html as $entry) { $rv .= $entry; };
 
-                       $rv .= "</div>";
+                       $rv .= "</div></div>";
                }
 
                return $rv;