public function BulkForm::views_form_submit

Implements \Drupal\system\Plugin\views\field\BulkFormBase::views_form_submit().

Overrides BulkFormBase::views_form_submit

File

drupal/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.php, line 103
Contains \Drupal\action\Plugin\views\field\BulkForm.

Class

BulkForm
Defines a actions-based bulk operation form element.

Namespace

Drupal\action\Plugin\views\field

Code

public function views_form_submit(&$form, &$form_state) {
  parent::views_form_submit($form, $form_state);
  if ($form_state['step'] == 'views_form_views_form') {
    $count = count(array_filter($form_state['values'][$this->options['id']]));
    $action = $this->actions[$form_state['values']['action']];
    if ($count) {
      drupal_set_message(format_plural($count, '%action was applied to @count item.', '%action was applied to @count items.', array(
        '%action' => $action
          ->label(),
      )));
    }
  }
}