public function LingotekManagementRelatedEntitiesForm::buildForm in Lingotek Translation 8.2
Same name and namespace in other branches
- 4.0.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
- 3.0.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
- 3.1.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
- 3.2.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
- 3.3.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
- 3.4.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
- 3.5.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
- 3.6.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
- 3.7.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::buildForm()
- 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\FormCode
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;
}