You are here

function skinr_ui_multiple_delete_confirm_submit in Skinr 8.2

Same name and namespace in other branches
  1. 7.2 skinr_ui.admin.inc \skinr_ui_multiple_delete_confirm_submit()

Form submission handler for skinr_ui_multiple_delete_confirm().

1 string reference to 'skinr_ui_multiple_delete_confirm_submit'
skinr_ui_multiple_delete_confirm in skinr_ui/skinr_ui.admin.inc
Form builder for the confirmation form when deleting multiple Skinr settings.

File

skinr_ui/skinr_ui.admin.inc, line 408
Admin page callbacks for the Skinr UI module.

Code

function skinr_ui_multiple_delete_confirm_submit($form, &$form_state) {
  if ($form_state['values']['confirm']) {
    entity_delete_multiple('skin', array_keys($form_state['values']['skins']));
    $count = count($form_state['values']['skins']);
    if ($count == 1) {
      \Drupal::logger('skinr')
        ->notice('Deleted 1 skin configuration.');
    }
    else {
      \Drupal::logger('skinr')
        ->notice('Deleted @count skin configurations.', array(
        '@count' => $count,
      ));
    }
    drupal_set_message(format_plural($count, 'Deleted 1 skin configuration.', 'Deleted @count skin configurations.'));
  }
  $form_state['redirect'] = 'admin/structure/skinr';
}