experimental article attachment ui based on dijit dropdown
This commit is contained in:
parent
f360b02886
commit
749b56bdac
1 changed files with 11 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue