diff options
-rw-r--r-- | mod/zaudio/manifest.xml | 4 | ||||
-rw-r--r-- | mod/zaudio/readme.txt | 2 | ||||
-rw-r--r-- | mod/zaudio/start.php | 29 | ||||
-rw-r--r-- | mod/zaudio/views/default/file/specialcontent/audio/mp3.php | 30 | ||||
-rw-r--r-- | mod/zaudio/views/default/file/specialcontent/audio/mpeg.php | 29 | ||||
-rw-r--r-- | mod/zaudio/views/default/file/specialcontent/audio/mpg.php | 29 | ||||
-rw-r--r-- | mod/zaudio/views/default/zaudio/audioplayer.php | 23 | ||||
-rw-r--r-- | mod/zaudio/views/default/zaudio/css.php | 10 |
8 files changed, 64 insertions, 92 deletions
diff --git a/mod/zaudio/manifest.xml b/mod/zaudio/manifest.xml index 7af57d6d9..7942db747 100644 --- a/mod/zaudio/manifest.xml +++ b/mod/zaudio/manifest.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <plugin_manifest> <field key="author" value="Curverider" /> - <field key="version" value="1.7" /> + <field key="version" value="1.8" /> <field key="description" value="This simple plugin lets users play mp3's in the page." /> <field key="website" value="http://www.elgg.org/" /> <field key="copyright" value="(C) Curverider 2008-2010" /> <field key="licence" value="GNU Public License version 2" /> - <field key="elgg_version" value="2010030101" /> + <field key="elgg_version" value="2010111501" /> <field key="elgg_install_state" value="enabled" /> <field key="admin_interface" value="advanced" /> </plugin_manifest> diff --git a/mod/zaudio/readme.txt b/mod/zaudio/readme.txt index 5776231e6..90279c928 100644 --- a/mod/zaudio/readme.txt +++ b/mod/zaudio/readme.txt @@ -6,4 +6,4 @@ Notes: Instructions: -Drop into mod, enable in the admin planel and use.
\ No newline at end of file +Drop into mod, enable in the admin panel and use.
\ No newline at end of file diff --git a/mod/zaudio/start.php b/mod/zaudio/start.php index 551fd479a..c440456b7 100644 --- a/mod/zaudio/start.php +++ b/mod/zaudio/start.php @@ -1,18 +1,15 @@ <?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 + */ - /** - * 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 - **/ - - function zaudio_init() { - - } - - // Make sure the status initialisation function is called on initialisation - elgg_register_event_handler('init','system','zaudio_init',999); - -?>
\ No newline at end of file +elgg_register_event_handler('init', 'system', 'zaudio_init'); + +function zaudio_init() { + elgg_extend_view('css/elgg', 'zaudio/css'); +} 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; +} |