/[drupal]/contributions/modules/mp3player/mp3player.module
ViewVC logotype

Diff of /contributions/modules/mp3player/mp3player.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.11, Sun Jul 19 16:24:04 2009 UTC revision 1.1.2.12, Mon Oct 12 22:36:23 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: mp3player.module,v 1.1.2.8 2009/02/16 21:31:03 starnox Exp $  // $Id$
3    
4  /**  /**
5   * @file   * @file
# Line 541  function mp3player_player_edit($form_sta Line 541  function mp3player_player_edit($form_sta
541        '#title' => t('Check Policy'),        '#title' => t('Check Policy'),
542        '#default_value' => $player['checkpolicy'],        '#default_value' => $player['checkpolicy'],
543        '#options' => array('no' => t('No'), 'yes' => t('Yes')),        '#options' => array('no' => t('No'), 'yes' => t('Yes')),
544        '#description' => t('Tells Flash to look for a policy file when loading mp3 files (this allows Flash to read ID3 tags from files hosted on a different domain.'),        '#description' => t('Tells Flash to look for a policy file when loading mp3 files (this allows Flash to read ID3 tags from files hosted on a different domain).'),
545      );      );
546      $form['options']['rtl'] = array(      $form['options']['rtl'] = array(
547        '#type' => 'select',        '#type' => 'select',
# Line 870  function mp3player_init() { Line 870  function mp3player_init() {
870    if(!file_exists(drupal_get_path('module', 'mp3player').'/mp3player/audio-player.js') || !file_exists(drupal_get_path('module', 'mp3player').'/mp3player/player.swf')) {    if(!file_exists(drupal_get_path('module', 'mp3player').'/mp3player/audio-player.js') || !file_exists(drupal_get_path('module', 'mp3player').'/mp3player/player.swf')) {
871      drupal_set_message(t('%file1 or %file2 were not found in %directory, download the <a href="http://wpaudioplayer.com/download">standalone WordPress Audio Player</a>.', array('%file1' => 'audio-player.js', '%file2' => 'player.swf', '%directory' => '/'.drupal_get_path('module', 'mp3player').'/mp3player/')), 'error');      drupal_set_message(t('%file1 or %file2 were not found in %directory, download the <a href="http://wpaudioplayer.com/download">standalone WordPress Audio Player</a>.', array('%file1' => 'audio-player.js', '%file2' => 'player.swf', '%directory' => '/'.drupal_get_path('module', 'mp3player').'/mp3player/')), 'error');
872    }    }
873    
874    drupal_add_js(drupal_get_path('module', 'mp3player').'/mp3player/audio-player.js');    drupal_add_js(drupal_get_path('module', 'mp3player').'/mp3player/audio-player.js');
875      drupal_add_js(drupal_get_path('module', 'mp3player').'/mp3player.js');
876    
877    //If cache isn't set, set it.    //If cache isn't set, set it.
878    if(cache_get('mp3player_default') == '') {    if(cache_get('mp3player_default') == '') {
# Line 1133  function mp3player_theme() { Line 1134  function mp3player_theme() {
1134   * Setup theme function for the MP3 Player.   * Setup theme function for the MP3 Player.
1135   */   */
1136  function theme_mp3player($player = 'Default', $file = NULL, $title = NULL, $artist = NULL, $description = NULL) {  function theme_mp3player($player = 'Default', $file = NULL, $title = NULL, $artist = NULL, $description = NULL) {
1137    global $mp3_player_id;    static $mp3_player_id;
1138    $mp3_player_id++;    $mp3_player_id++;
1139    
1140    $extras = NULL;    $extras = NULL;
# Line 1165  function theme_mp3player($player = 'Defa Line 1166  function theme_mp3player($player = 'Defa
1166      $audio_url = $file;      $audio_url = $file;
1167    }    }
1168    
1169    return '<p id="mp3player_'.$mp3_player_id.'">'.t("It look's like you don't have Adobe Flash Player installed. <a href='http://get.adobe.com/flashplayer/'>Get it now.</a>").'</p>'. $description .'<script type="text/javascript">AudioPlayer.embed("mp3player_'.$mp3_player_id.'", {soundFile: "'. $audio_url .'"'.$extras.'});</script>';    //Add JS for player
1170      drupal_add_js(
1171        array('mp3player' =>
1172          array(
1173            'mp3player_' . $mp3_player_id => array(
1174              'extras' => $extras,
1175              'audio_url' => $audio_url,
1176            ),
1177          ),
1178        ),
1179        'setting'
1180      );
1181    
1182      return '<p id="mp3player_'.$mp3_player_id.'" class="mp3player">'.t("You may need: <a href='http://get.adobe.com/flashplayer/'>Adobe Flash Player</a>.").'</p>'. $description;
1183  }  }
1184    
1185  /**  /**

Legend:
Removed from v.1.1.2.11  
changed lines
  Added in v.1.1.2.12

  ViewVC Help
Powered by ViewVC 1.1.2