You are here

public function LingotekSettingsController::getProfileListForm in Lingotek Translation 3.3.x

Same name and namespace in other branches
  1. 8 src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  2. 8.2 src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  3. 4.0.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  4. 3.0.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  5. 3.1.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  6. 3.2.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  7. 3.4.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  8. 3.5.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  9. 3.6.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  10. 3.7.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
  11. 3.8.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()

Gets the profile list form wrapped, so it can be expanded and collapsed.

Return value

array The form definition.

1 call to LingotekSettingsController::getProfileListForm()
LingotekSettingsController::content in src/Controller/LingotekSettingsController.php

File

src/Controller/LingotekSettingsController.php, line 44

Class

LingotekSettingsController

Namespace

Drupal\lingotek\Controller

Code

public function getProfileListForm() {
  $original_form = $this->formBuilder
    ->getForm($this
    ->entityTypeManager()
    ->getListBuilder('lingotek_profile'), new FormState());
  $form['profiles_wrapper'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Translation Profiles'),
  ];
  $form['profiles_wrapper']['form'] = $original_form;

  // We add the link manually, as we cannot use local actions for that.
  $form['profiles_wrapper']['form']['add_link'] = [
    '#type' => 'link',
    '#title' => t('Add new Translation Profile'),
    '#url' => Url::fromRoute('entity.lingotek_profile.add_form'),
    '#weight' => 50,
    '#ajax' => [
      'class' => [
        'use-ajax',
      ],
    ],
    '#attributes' => [
      'class' => [
        'use-ajax',
      ],
      'data-dialog-type' => 'modal',
      'data-dialog-options' => Json::encode([
        'width' => 860,
        'height' => 530,
      ]),
    ],
  ];
  return $form;
}