You are here

function mp3player_player_settings in MP3 Player 6.2

Same name and namespace in other branches
  1. 6 mp3player.module \mp3player_player_settings()
  2. 7.2 mp3player.module \mp3player_player_settings()

Returns a string of audio player settings.

1 call to mp3player_player_settings()
theme_mp3player in ./mp3player.module
Setup theme function for the MP3 Player.

File

./mp3player.module, line 594
mp3player main module file.

Code

function mp3player_player_settings($pid = 1) {
  $players = mp3player_players();
  $player = $players[$pid];
  unset($player['pid']);
  unset($player['name']);
  if ($player['transparentpagebg'] == 'no') {
    $player['pagebg'] = 'FFFFFF';
  }
  $settings = array();
  foreach ($player as $key => $value) {
    $settings[] = '"' . $key . '":"' . $value . '"';
  }
  $out = array(
    'AudioPlayer.setup("' . base_path() . libraries_get_path('audio-player') . '/player.swf", {',
  );
  $out[] = implode(',', $settings);
  $out[] = '});';
  return implode($out);
}