You are here

function mp3player_player_form_submit in MP3 Player 7.2

Same name and namespace in other branches
  1. 6.2 mp3player.module \mp3player_player_form_submit()

Add a new player.

File

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

Code

function mp3player_player_form_submit($form, &$form_state) {
  $search = array();
  $message = 'New MP3 Player %name added.';
  if (isset($form_state['values']['pid'])) {
    $search = 'pid';
    $message = 'New MP3 Player %name updated';
  }
  drupal_write_record('mp3player_players', $form_state['values'], $search);
  drupal_set_message(t($message, array(
    '%name' => $form_state['values']['name'],
  )));
  $form_state['redirect'] = 'admin/config/media/mp3player';
  drupal_static_reset('mp3player_player_settings');
}