You are here

class SocialEventManagersViewsBulkOperationsConfirmAction in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php \Drupal\social_event_managers\Form\SocialEventManagersViewsBulkOperationsConfirmAction
  2. 8.5 modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php \Drupal\social_event_managers\Form\SocialEventManagersViewsBulkOperationsConfirmAction
  3. 8.6 modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php \Drupal\social_event_managers\Form\SocialEventManagersViewsBulkOperationsConfirmAction
  4. 8.8 modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php \Drupal\social_event_managers\Form\SocialEventManagersViewsBulkOperationsConfirmAction
  5. 10.3.x modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php \Drupal\social_event_managers\Form\SocialEventManagersViewsBulkOperationsConfirmAction
  6. 10.0.x modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php \Drupal\social_event_managers\Form\SocialEventManagersViewsBulkOperationsConfirmAction
  7. 10.1.x modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php \Drupal\social_event_managers\Form\SocialEventManagersViewsBulkOperationsConfirmAction
  8. 10.2.x modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php \Drupal\social_event_managers\Form\SocialEventManagersViewsBulkOperationsConfirmAction

Default action execution confirmation form.

Hierarchy

Expanded class hierarchy of SocialEventManagersViewsBulkOperationsConfirmAction

File

modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php, line 11

Namespace

Drupal\social_event_managers\Form
View source
class SocialEventManagersViewsBulkOperationsConfirmAction extends ConfirmAction {

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state, $view_id = 'event_manage_enrollments', $display_id = 'page_manage_enrollments') {
    $form = parent::buildForm($form, $form_state, $view_id, $display_id);
    $form_data = $this
      ->getFormData($view_id, $display_id);

    // Show a descriptive message in the confirm action form.
    if (isset($form_data['action_id'])) {
      $form['description'] = [
        '#markup' => $this
          ->formatPlural($form_data['selected_count'], 'Are you sure you want to "%action" the following enrollee?', 'Are you sure you want to "%action" the following %count enrollees?', [
          '%action' => $form_data['action_label'],
          '%count' => $form_data['selected_count'],
        ]),
        '#weight' => -10,
      ];
      if (strpos($form_data['action_id'], 'mail') !== FALSE) {
        $form['description'] = [
          '#markup' => $this
            ->formatPlural($form_data['selected_count'], 'Are you sure you want to send your email to the following enrollee?', 'Are you sure you want to send your email to to the following %count enrollees?', [
            '%action' => $form_data['action_label'],
            '%count' => $form_data['selected_count'],
          ]),
          '#weight' => -10,
        ];
      }
    }
    $form['actions']['submit']['#attributes']['class'] = [
      'button button--primary js-form-submit form-submit btn js-form-submit btn-raised btn-primary waves-effect waves-btn waves-light',
    ];
    $form['actions']['cancel']['#attributes']['class'] = [
      'button button--danger btn btn-flat waves-effect waves-btn',
    ];
    return $form;
  }

}

Members