summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-01-15 11:23:27 +0400
committerAndrew Dolgov <[email protected]>2013-01-15 11:23:27 +0400
commitca3bca990d4592dbccb5cce709675d302e52ae60 (patch)
treeeb8799bfe709f97fba45d5386a50eff77284d373 /include
parent6effae6dd8709230b91c3bed10d4eae476ef2f48 (diff)
fix inline flash/html5 audio player
Diffstat (limited to 'include')
-rw-r--r--include/functions.php27
1 files changed, 21 insertions, 6 deletions
diff --git a/include/functions.php b/include/functions.php
index 1ae5430c1..b46e1a28c 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -2987,8 +2987,8 @@
$id = 'AUDIO-' . uniqid();
- $entry .= "<audio id=\"$id\"\">
- <source src=\"$url\"></source>
+ $entry .= "<audio id=\"$id\"\" controls>
+ <source type=\"$ctype\" src=\"$url\"></source>
</audio>";
$entry .= "<span onclick=\"player(this)\"
@@ -3004,14 +3004,20 @@
value=\"lib/button/musicplayer.swf?song_url=$url\" />
</object>";
}
+
+ if ($entry) $entry .= "&nbsp;" . basename($url);
+
+ return $entry;
+
}
- $filename = substr($url, strrpos($url, "/")+1);
+ return "";
+
+/* $filename = substr($url, strrpos($url, "/")+1);
$entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
- $filename . " (" . $ctype . ")" . "</a>";
+ $filename . " (" . $ctype . ")" . "</a>"; */
- return $entry;
}
function format_article($link, $id, $mark_as_read = true, $zoom_mode = false, $owner_uid = false) {
@@ -4608,6 +4614,7 @@
$entries_html = array();
$entries = array();
+ $entries_inline = array();
foreach ($result as $line) {
@@ -4618,7 +4625,9 @@
$filename = substr($url, strrpos($url, "/")+1);
-# $player = format_inline_player($link, $url, $ctype);
+ $player = format_inline_player($link, $url, $ctype);
+
+ if ($player) array_push($entries_inline, $player);
# $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
# $filename . " (" . $ctype . ")" . "</a>";
@@ -4655,6 +4664,12 @@
}
}
+ if (count($entries_inline) > 0) {
+ $rv .= "<hr clear='both'/>";
+ foreach ($entries_inline as $entry) { $rv .= $entry; };
+ $rv .= "<hr clear='both'/>";
+ }
+
$rv .= "<br/><div dojoType=\"dijit.form.DropDownButton\">".
"<span>" . __('Attachments')."</span>";
$rv .= "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";