aboutsummaryrefslogtreecommitdiff
path: root/mod/zaudio/views/default
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-30 01:02:24 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-30 01:02:24 +0000
commite0122437519ae90315808119341faa114fec1e5b (patch)
treef11c7199f81d7e883d620e775cfcf0b559972bb1 /mod/zaudio/views/default
parent1b4f39fcced81c3dffd62d5c56e77d1c4cee9c1e (diff)
downloadelgg-e0122437519ae90315808119341faa114fec1e5b.tar.gz
elgg-e0122437519ae90315808119341faa114fec1e5b.tar.bz2
Updated the zaudio plugin for 1.8
git-svn-id: http://code.elgg.org/elgg/trunk@7475 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/zaudio/views/default')
-rw-r--r--mod/zaudio/views/default/file/specialcontent/audio/mp3.php30
-rw-r--r--mod/zaudio/views/default/file/specialcontent/audio/mpeg.php29
-rw-r--r--mod/zaudio/views/default/file/specialcontent/audio/mpg.php29
-rw-r--r--mod/zaudio/views/default/zaudio/audioplayer.php23
-rw-r--r--mod/zaudio/views/default/zaudio/css.php10
5 files changed, 48 insertions, 73 deletions
diff --git a/mod/zaudio/views/default/file/specialcontent/audio/mp3.php b/mod/zaudio/views/default/file/specialcontent/audio/mp3.php
index 080cb8f20..11d09708a 100644
--- a/mod/zaudio/views/default/file/specialcontent/audio/mp3.php
+++ b/mod/zaudio/views/default/file/specialcontent/audio/mp3.php
@@ -1,27 +1,7 @@
<?php
-
- /**
- * ZAudio - a simple mp3 player
- * A simple plugin to play mp3 files on the page
- * http://wpaudioplayer.com/license
- * http://wpaudioplayer.com/standalone
- * @package ElggZAudio
- **/
-
-?>
-<!-- include the audioplayer js code -->
-<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>mod/zaudio/audioplayer/audio-player.js"></script>
-<!-- set up the player -->
-<script type="text/javascript">
- AudioPlayer.setup("<?php echo elgg_get_site_url(); ?>mod/zaudio/audioplayer/player.swf", {
- width: 290
- });
-</script>
+/**
+ * ZAudio file view override
+ * @package ElggZAudio
+ */
-<div style="margin:10px 0 10px 0;">
-<p id="audioplayer_1">Alternative content</p>
- <script type="text/javascript">
- AudioPlayer.embed("audioplayer_1", {soundFile: "<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>"});
- </script>
-</div>
- \ No newline at end of file
+echo elgg_view('zaudio/audioplayer', array('file_guid' => $vars['entity']->getGUID()));
diff --git a/mod/zaudio/views/default/file/specialcontent/audio/mpeg.php b/mod/zaudio/views/default/file/specialcontent/audio/mpeg.php
index 6cb39f250..11d09708a 100644
--- a/mod/zaudio/views/default/file/specialcontent/audio/mpeg.php
+++ b/mod/zaudio/views/default/file/specialcontent/audio/mpeg.php
@@ -1,26 +1,7 @@
<?php
-
- /**
- * ZAudio - a simple mp3 player
- * A simple plugin to play mp3 files on the page
- * http://wpaudioplayer.com/license
- * http://wpaudioplayer.com/standalone
- * @package ElggZAudio
- **/
-
-?>
-<!-- include the audioplayer js code -->
-<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>mod/zaudio/audioplayer/audio-player.js"></script>
-<!-- set up the player -->
-<script type="text/javascript">
- AudioPlayer.setup("<?php echo elgg_get_site_url(); ?>mod/zaudio/audioplayer/player.swf", {
- width: 290
- });
-</script>
+/**
+ * ZAudio file view override
+ * @package ElggZAudio
+ */
-<div style="margin:10px 0 10px 0;">
-<p id="audioplayer_1">Alternative content</p>
- <script type="text/javascript">
- AudioPlayer.embed("audioplayer_1", {soundFile: "<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>"});
- </script>
-</div> \ No newline at end of file
+echo elgg_view('zaudio/audioplayer', array('file_guid' => $vars['entity']->getGUID()));
diff --git a/mod/zaudio/views/default/file/specialcontent/audio/mpg.php b/mod/zaudio/views/default/file/specialcontent/audio/mpg.php
index 6cb39f250..11d09708a 100644
--- a/mod/zaudio/views/default/file/specialcontent/audio/mpg.php
+++ b/mod/zaudio/views/default/file/specialcontent/audio/mpg.php
@@ -1,26 +1,7 @@
<?php
-
- /**
- * ZAudio - a simple mp3 player
- * A simple plugin to play mp3 files on the page
- * http://wpaudioplayer.com/license
- * http://wpaudioplayer.com/standalone
- * @package ElggZAudio
- **/
-
-?>
-<!-- include the audioplayer js code -->
-<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>mod/zaudio/audioplayer/audio-player.js"></script>
-<!-- set up the player -->
-<script type="text/javascript">
- AudioPlayer.setup("<?php echo elgg_get_site_url(); ?>mod/zaudio/audioplayer/player.swf", {
- width: 290
- });
-</script>
+/**
+ * ZAudio file view override
+ * @package ElggZAudio
+ */
-<div style="margin:10px 0 10px 0;">
-<p id="audioplayer_1">Alternative content</p>
- <script type="text/javascript">
- AudioPlayer.embed("audioplayer_1", {soundFile: "<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>"});
- </script>
-</div> \ No newline at end of file
+echo elgg_view('zaudio/audioplayer', array('file_guid' => $vars['entity']->getGUID()));
diff --git a/mod/zaudio/views/default/zaudio/audioplayer.php b/mod/zaudio/views/default/zaudio/audioplayer.php
new file mode 100644
index 000000000..f46d15e2c
--- /dev/null
+++ b/mod/zaudio/views/default/zaudio/audioplayer.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * ZAudio audio player
+ * @package ElggZAudio
+ */
+
+$js_url = elgg_get_site_url() . 'mod/zaudio/audioplayer/audio-player.js';
+elgg_register_js($js_url, 'zaudio');
+
+$swf_url = elgg_get_site_url() . 'mod/zaudio/audioplayer/player.swf';
+$mp3_url = elgg_get_site_url() . "mod/file/download.php?file_guid={$vars['file_guid']}";
+
+?>
+<script type="text/javascript">
+ AudioPlayer.setup("<?php echo $swf_url; ?>", {width: 290});
+</script>
+
+<div class="zaudio">
+ <p id="zaudioplayer"></p>
+ <script type="text/javascript">
+ AudioPlayer.embed("zaudioplayer", {soundFile: "<?php echo $mp3_url; ?>"});
+ </script>
+</div> \ No newline at end of file
diff --git a/mod/zaudio/views/default/zaudio/css.php b/mod/zaudio/views/default/zaudio/css.php
new file mode 100644
index 000000000..86cc4aadb
--- /dev/null
+++ b/mod/zaudio/views/default/zaudio/css.php
@@ -0,0 +1,10 @@
+<?php
+/**
+ * ZAudio CSS
+ * @package ElggZAudio
+ */
+?>
+/* ZAudio */
+.zaudio {
+ margin: 10px 0;
+}