diff options
author | Andrew Dolgov <[email protected]> | 2012-07-09 20:48:34 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-07-09 20:48:34 +0400 |
commit | 749b56bdace4245edb19447ae9f63a52c21d11c8 (patch) | |
tree | c13252ecbd85d42726b4315d44e244df92767544 /include | |
parent | f360b02886e55c34737e930277b6b5d840c73566 (diff) |
experimental article attachment ui based on dijit dropdown
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/functions.php b/include/functions.php index 29b5d4677..06939c636 100644 --- a/include/functions.php +++ b/include/functions.php @@ -4718,13 +4718,16 @@ 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(); @@ -4736,8 +4739,6 @@ array_push($entries, $entry); } - $rv .= "<div class=\"postEnclosures\">"; - if (!get_pref($link, "STRIP_IMAGES")) { if ($always_display_enclosures || !preg_match("/<img/i", $article_content)) { @@ -4750,20 +4751,19 @@ $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; |