You are here

class SocialEventManagersViewsBulkOperationsConfirmAction in Open Social 10.3.x

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.7 modules/social_features/social_event/modules/social_event_managers/src/Form/SocialEventManagersViewsBulkOperationsConfirmAction.php \Drupal\social_event_managers\Form\SocialEventManagersViewsBulkOperationsConfirmAction
  5. 8.8 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

Namesort descending Modifiers Type Description Overrides
ConfirmAction::$actionManager protected property Views Bulk Operations action manager.
ConfirmAction::$actionProcessor protected property Views Bulk Operations action processor.
ConfirmAction::$tempStoreFactory protected property The tempstore service.
ConfirmAction::create public static function Instantiates a new instance of this class. Overrides FormBase::create
ConfirmAction::getFormId public function Returns a unique string identifying the form. Overrides FormInterface::getFormId
ConfirmAction::submitForm public function Form submission handler. Overrides FormInterface::submitForm
ConfirmAction::__construct public function Constructor.
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function 2
DependencySerializationTrait::__wakeup public function 2
FormBase::$configFactory protected property The config factory. 3
FormBase::$requestStack protected property The request stack. 1
FormBase::$routeMatch protected property The route match.
FormBase::config protected function Retrieves a configuration object.
FormBase::configFactory protected function Gets the config factory for this form. 3
FormBase::container private function Returns the service container.
FormBase::currentUser protected function Gets the current user.
FormBase::getRequest protected function Gets the request object.
FormBase::getRouteMatch protected function Gets the route match.
FormBase::logger protected function Gets the logger for a specific channel.
FormBase::redirect protected function Returns a redirect response object for the specified route.
FormBase::resetConfigFactory public function Resets the configuration factory.
FormBase::setConfigFactory public function Sets the config factory for this form.
FormBase::setRequestStack public function Sets the request stack object to use.
FormBase::validateForm public function Form validation handler. Overrides FormInterface::validateForm 72
LoggerChannelTrait::$loggerFactory protected property The logger channel factory service.
LoggerChannelTrait::getLogger protected function Gets the logger for a specific channel.
LoggerChannelTrait::setLoggerFactory public function Injects the logger channel factory.
MessengerTrait::$messenger protected property The messenger. 27
MessengerTrait::messenger public function Gets the messenger. 27
MessengerTrait::setMessenger public function Sets the messenger.
RedirectDestinationTrait::$redirectDestination protected property The redirect destination service. 1
RedirectDestinationTrait::getDestinationArray protected function Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
RedirectDestinationTrait::getRedirectDestination protected function Returns the redirect destination service.
RedirectDestinationTrait::setRedirectDestination public function Sets the redirect destination service.
SocialEventManagersViewsBulkOperationsConfirmAction::buildForm public function Form constructor. Overrides ConfirmAction::buildForm
StringTranslationTrait::$stringTranslation protected property The string translation service. 4
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
ViewsBulkOperationsFormTrait::$tempStoreName protected property The tempstore name.
ViewsBulkOperationsFormTrait::$viewTempstore protected property The tempstore object associated with the current view.
ViewsBulkOperationsFormTrait::addCancelButton protected function Add a cancel button into a VBO form.
ViewsBulkOperationsFormTrait::addListData protected function Add data needed for entity list rendering.
ViewsBulkOperationsFormTrait::calculateEntityBulkFormKey public static function Calculates the bulk form key for an entity.
ViewsBulkOperationsFormTrait::cancelForm public function Submit callback to cancel an action and return to the view.
ViewsBulkOperationsFormTrait::deleteTempstoreData protected function Deletes the current view user tempstore data.
ViewsBulkOperationsFormTrait::getFormData protected function Helper function to prepare data needed for proper form display.
ViewsBulkOperationsFormTrait::getListItem protected function Get an entity list item from a bulk form key.
ViewsBulkOperationsFormTrait::getListRenderable protected function Build selected entities list renderable.
ViewsBulkOperationsFormTrait::getMultipageList protected function Build the selection info element.
ViewsBulkOperationsFormTrait::getSelectionInfoTitle protected function Get the selection info title.
ViewsBulkOperationsFormTrait::getTempstore protected function Initialize the current view tempstore object.
ViewsBulkOperationsFormTrait::getTempstoreData protected function Gets the current view user tempstore data.
ViewsBulkOperationsFormTrait::setTempstoreData protected function Sets the current view user tempstore data.