You are here

public function FlowPushConfirmation::buildForm in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Form/FlowPushConfirmation.php \Drupal\cms_content_sync\Form\FlowPushConfirmation::buildForm()
  2. 2.1.x src/Form/FlowPushConfirmation.php \Drupal\cms_content_sync\Form\FlowPushConfirmation::buildForm()

Form constructor.

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 The form structure.

Overrides ConfirmFormBase::buildForm

File

src/Form/FlowPushConfirmation.php, line 77

Class

FlowPushConfirmation
Provides a pool pull all confirmation page.

Namespace

Drupal\cms_content_sync\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $cms_content_sync_flow = null) {
  $this->cms_content_sync_flow = $cms_content_sync_flow;
  $this->flow = $this->flow_storage
    ->load($this->cms_content_sync_flow);

  // If the flow is migrated to v2, the syndication dashboard will be used.
  if ($this->flow
    ->useV2()) {
    return $this
      ->redirect('cms_content_sync.syndication', [
      'flow' => $this->flow
        ->id(),
      'new' => 'true',
    ]);
  }
  $form['push_mode'] = [
    '#type' => 'radios',
    '#options' => [
      'automatic' => $this
        ->t('Push entities that match "Push: All".'),
      'automatic_manual' => $this
        ->t('Push entities that match "Push: All" and entities that match "Push: Manually" and have been pushed before.'),
      'automatic_manual_force' => $this
        ->t('Push entities that match "Push: All" and entities that match "Push: Manually" even if they were never pushed before.'),
    ],
    '#default_value' => 'automatic',
  ];
  return parent::buildForm($form, $form_state);
}