You are here

public function LingotekManagementRelatedEntitiesForm::buildForm in Lingotek Translation 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
  2. 4.0.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
  3. 3.1.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
  4. 3.2.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
  5. 3.3.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
  6. 3.4.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
  7. 3.5.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
  8. 3.6.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
  9. 3.7.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
  10. 3.8.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::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 LingotekManagementFormBase::buildForm

File

src/Form/LingotekManagementRelatedEntitiesForm.php, line 90

Class

LingotekManagementRelatedEntitiesForm
Form for bulk management of related content.

Namespace

Drupal\lingotek\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, ContentEntityInterface $node = NULL) {
  $this->node = $node;
  $form = parent::buildForm($form, $form_state);
  $depth = $this
    ->getRecursionDepth();
  $form['depth_selection'] = [
    '#type' => 'container',
    '#attributes' => [
      'class' => 'form-item-depth-selection',
    ],
    '#weight' => 60,
  ];
  $form['depth_selection']['depth'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Recursion depth:'),
    '#options' => [
      1 => 1,
      2 => 2,
      3 => 3,
      4 => 4,
      5 => 5,
    ],
    '#default_value' => $depth,
  ];
  $form['depth_selection']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Apply'),
    '#submit' => [
      [
        $this,
        'recursionDepthCallback',
      ],
    ],
  ];
  return $form;
}