| 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 |
| 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', |
| 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') == '') { |
| 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; |
| 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 |
/** |
/** |