You are here

function mp3player_player_list in MP3 Player 7.2

Same name and namespace in other branches
  1. 6.2 mp3player.module \mp3player_player_list()
  2. 6 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 108
mp3player main module file.

Code

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