function mp3player_player_delete in MP3 Player 7.2
Same name and namespace in other branches
- 6.2 mp3player.module \mp3player_player_delete()
- 6 mp3player.module \mp3player_player_delete()
Form to delete a player.
1 string reference to 'mp3player_player_delete'
- mp3player_menu in ./
mp3player.module - Implementation of hook_menu().
File
- ./
mp3player.module, line 566 - mp3player main module file.
Code
function mp3player_player_delete($form_state, $pid = NULL) {
$player = mp3player_players($pid);
if (empty($player)) {
drupal_set_message(t('The specified player was not found.'), 'error');
drupal_goto('admin/settings/mp3player');
}
if ($player['name'] == 'Default') {
drupal_set_message(t('You cannot delete the Default player.'), 'error');
drupal_goto('admin/settings/mp3player');
}
$form = array();
$form['pid'] = array(
'#type' => 'value',
'#value' => $pid,
);
return confirm_form($form, t('Are you sure you want to delete the player %name?', array(
'%name' => $player['name'],
)), 'admin/settings/mp3player', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}