You are here

public function PageWizardBase::getOperations in Page Manager 8

Same name and namespace in other branches
  1. 8.4 page_manager_ui/src/Wizard/PageWizardBase.php \Drupal\page_manager_ui\Wizard\PageWizardBase::getOperations()

Retrieve a list of FormInterface classes by their step key in the wizard.

Parameters

mixed $cached_values: The values returned by $this->getTempstore()->get($this->getMachineName()); *.

Return value

array An associative array keyed on the step name with an array value with the following keys:

  • title (string): Human-readable title of the step.
  • form (string): Fully-qualified class name of the form for this step.
  • values (array): Optional array of cached values to override when on this step.
  • validate (array): Optional array of callables to be called when this step is validated.
  • submit (array): Optional array of callables to be called when this step is submitted.

Overrides FormWizardInterface::getOperations

2 calls to PageWizardBase::getOperations()
PageAddWizard::getOperations in page_manager_ui/src/Wizard/PageAddWizard.php
Retrieve a list of FormInterface classes by their step key in the wizard.
PageEditWizard::getOperations in page_manager_ui/src/Wizard/PageEditWizard.php
Retrieve a list of FormInterface classes by their step key in the wizard.
2 methods override PageWizardBase::getOperations()
PageAddWizard::getOperations in page_manager_ui/src/Wizard/PageAddWizard.php
Retrieve a list of FormInterface classes by their step key in the wizard.
PageEditWizard::getOperations in page_manager_ui/src/Wizard/PageEditWizard.php
Retrieve a list of FormInterface classes by their step key in the wizard.

File

page_manager_ui/src/Wizard/PageWizardBase.php, line 57
Contains \Drupal\page_manager_ui\Wizard\PageWizardBase.

Class

PageWizardBase

Namespace

Drupal\page_manager_ui\Wizard

Code

public function getOperations($cached_values) {
  $operations = [];
  $operations['general'] = [
    'title' => $this
      ->t('Page information'),
    'form' => PageGeneralForm::class,
  ];

  /** @var $page \Drupal\page_manager\Entity\Page */
  $page = $cached_values['page'];
  if ($page) {
    $matches = [];
    preg_match_all('|\\{\\w+\\}|', $page
      ->getPath(), $matches);
    if (array_filter($matches)) {
      $operations['parameters'] = [
        'title' => $this
          ->t('Page parameters'),
        'form' => PageParametersForm::class,
      ];
    }
  }
  $operations['access'] = [
    'title' => $this
      ->t('Page access'),
    'form' => PageAccessForm::class,
  ];
  return $operations;
}