function picture_mapping_action_confirm_submit

Form submission handler for picture_action_confirm().

File

drupal/core/modules/picture/picture_mapping.admin.inc, line 95
Administration functions to maintain picture mappings.

Code

function picture_mapping_action_confirm_submit($form, &$form_state) {
  $picture_mapping = $form_state['picture_mapping'];
  $action = $form_state['values']['action'];
  $picture_mapping
    ->{$action}();
  $verb = '';
  switch ($action) {
    case 'delete':
      $verb = 'deleted';
      break;
  }
  drupal_set_message(t('Picture mapping %label has been @action.', array(
    '%label' => $picture_mapping
      ->label(),
    '@action' => $verb,
  )));
  watchdog('picture', 'Picture mapping %label has been @action.', array(
    '%label' => $picture_mapping
      ->label(),
    '@action' => $verb,
  ), WATCHDOG_NOTICE);
  $form_state['redirect'] = 'admin/config/media/picturemapping';
}