You are here

function mp3player_player_list in MP3 Player 6

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

Return formatted list of mp3 players.

1 string reference to 'mp3player_player_list'
mp3player_menu in ./mp3player.module
Implementation of hook_menu().

File

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

Code

function mp3player_player_list() {
  $header = array(
    t('Player Name'),
    t('Actions'),
  );
  $rows = array();
  foreach (mp3player_players() as $player) {
    $row = array();
    $row[] = l($player['name'], 'admin/settings/mp3player/player/' . $player['pid']);
    $links = array();
    $links[] = l(t('Edit'), 'admin/settings/mp3player/player/' . $player['pid']);
    if ($player['name'] != 'Default') {
      $links[] = l(t('Delete'), 'admin/settings/mp3player/player/' . $player['pid'] . '/delete');
    }
    $row[] = implode('    ', $links);
    $rows[] = $row;
  }
  $output = theme('table', $header, $rows);
  return $output;
}