public function LingotekSettingsController::getProfileListForm in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 4.0.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 3.0.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 3.1.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 3.2.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 3.3.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 3.4.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 3.5.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 3.6.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 3.7.x src/Controller/LingotekSettingsController.php \Drupal\lingotek\Controller\LingotekSettingsController::getProfileListForm()
- 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 39
Class
Namespace
Drupal\lingotek\ControllerCode
public function getProfileListForm() {
$form_builder = \Drupal::formBuilder();
$original_form = $form_builder
->getForm($this
->entityManager()
->getListBuilder('lingotek_profile'), new FormState());
$form['profiles_wrapper'] = array(
'#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' => array(
'class' => array(
'use-ajax',
),
),
'#attributes' => array(
'class' => array(
'use-ajax',
),
'data-dialog-type' => 'modal',
'data-dialog-options' => Json::encode(array(
'width' => 860,
'height' => 530,
)),
),
];
return $form;
}