You are here

public function SocialEventManagersViewsBulkOperationsBulkForm::viewsFormValidate in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php \Drupal\social_event_managers\Plugin\views\field\SocialEventManagersViewsBulkOperationsBulkForm::viewsFormValidate()
  2. 8.6 modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php \Drupal\social_event_managers\Plugin\views\field\SocialEventManagersViewsBulkOperationsBulkForm::viewsFormValidate()
  3. 8.7 modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php \Drupal\social_event_managers\Plugin\views\field\SocialEventManagersViewsBulkOperationsBulkForm::viewsFormValidate()
  4. 8.8 modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php \Drupal\social_event_managers\Plugin\views\field\SocialEventManagersViewsBulkOperationsBulkForm::viewsFormValidate()
  5. 10.3.x modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php \Drupal\social_event_managers\Plugin\views\field\SocialEventManagersViewsBulkOperationsBulkForm::viewsFormValidate()
  6. 10.0.x modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php \Drupal\social_event_managers\Plugin\views\field\SocialEventManagersViewsBulkOperationsBulkForm::viewsFormValidate()
  7. 10.1.x modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php \Drupal\social_event_managers\Plugin\views\field\SocialEventManagersViewsBulkOperationsBulkForm::viewsFormValidate()
  8. 10.2.x modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php \Drupal\social_event_managers\Plugin\views\field\SocialEventManagersViewsBulkOperationsBulkForm::viewsFormValidate()

File

modules/social_features/social_event/modules/social_event_managers/src/Plugin/views/field/SocialEventManagersViewsBulkOperationsBulkForm.php, line 228

Class

SocialEventManagersViewsBulkOperationsBulkForm
Defines the Enrollments Views Bulk Operations field plugin.

Namespace

Drupal\social_event_managers\Plugin\views\field

Code

public function viewsFormValidate(&$form, FormStateInterface $form_state) {
  if ($this->view
    ->id() === 'event_manage_enrollments' && $this->options['buttons']) {
    $user_input = $form_state
      ->getUserInput();
    $actions =& $form['header'][$this->options['id']]['actions'];
    foreach (Element::children($actions) as $action_id) {
      $action =& $actions[$action_id];
      if (isset($action['#access']) && !$action['#access']) {
        continue;
      }

      /** @var \Drupal\Core\StringTranslation\TranslatableMarkup $label */
      $label = $action['#value'];
      if (strip_tags($label
        ->render()) === $user_input['op']) {
        $form_state
          ->setTriggeringElement($action);
        break;
      }
    }
  }
  parent::viewsFormValidate($form, $form_state);
}