You are here

protected function WebformSubmissionForm::getPages in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformSubmissionForm.php \Drupal\webform\WebformSubmissionForm::getPages()

Get visible wizard pages.

Note: The array of pages is stored in the webform's state so that it can be altered using hook_form_alter() and #validate callbacks.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array Array of visible wizard pages.

6 calls to WebformSubmissionForm::getPages()
WebformSubmissionForm::actions in src/WebformSubmissionForm.php
Returns an array of supported actions for the current entity form.
WebformSubmissionForm::attachBehaviors in src/WebformSubmissionForm.php
Attach behaviors with libraries to the form.
WebformSubmissionForm::next in src/WebformSubmissionForm.php
Webform submission handler for the 'next' action.
WebformSubmissionForm::pagesElement in src/WebformSubmissionForm.php
Returns the wizard page submit buttons for the current entity form.
WebformSubmissionForm::previous in src/WebformSubmissionForm.php
Webform submission handler for the 'previous' action.

... See full list

File

src/WebformSubmissionForm.php, line 2204

Class

WebformSubmissionForm
Provides a webform to collect and edit submissions.

Namespace

Drupal\webform

Code

protected function getPages(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->get('pages') === NULL) {
    $pages = $this
      ->getWebform()
      ->getPages($this->operation);
    $form_state
      ->set('pages', $pages);
  }

  // Get pages from form state.
  $pages = $form_state
    ->get('pages');

  /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */
  $webform_submission = $this
    ->getEntity();
  return $this->conditionsValidator
    ->buildPages($pages, $webform_submission);
}