You are here

function mp3player_players in MP3 Player 7.2

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

Return list of all available players along with settings.

10 calls to mp3player_players()
filefieldmp3player_field_formatter_info in filefieldmp3player/filefieldmp3player.module
Implementation of hook_field_formatter_info().
filefieldmp3player_field_formatter_settings_form in filefieldmp3player/filefieldmp3player.module
Implements hook_field_formatter_settings_form().
filefieldmp3player_field_formatter_settings_summary in filefieldmp3player/filefieldmp3player.module
Implements hook_field_formatter_settings_summary().
mp3player_player_delete in ./mp3player.module
Form to delete a player.
mp3player_player_delete_submit in ./mp3player.module
Delete a player.

... See full list

1 string reference to 'mp3player_players'
mp3player_player_form_submit in ./mp3player.module
Add a new player.

File

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

Code

function mp3player_players($pid = NULL) {
  $players = array();
  $result = db_select('mp3player_players', 'm')
    ->fields('m')
    ->execute();
  while ($player = $result
    ->fetchAssoc()) {
    $players[$player['pid']] = $player;
  }
  if ($pid && array_key_exists($pid, $players)) {
    return $players[$pid];
  }
  return $players;
}