You are here

protected function LingotekSettingsTabPreferencesForm::retrieveAdminMenu in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  2. 4.0.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  3. 3.0.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  4. 3.1.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  5. 3.2.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  6. 3.3.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  7. 3.4.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  8. 3.5.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  9. 3.6.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  10. 3.7.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
  11. 3.8.x src/Form/LingotekSettingsTabPreferencesForm.php \Drupal\lingotek\Form\LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
1 call to LingotekSettingsTabPreferencesForm::retrieveAdminMenu()
LingotekSettingsTabPreferencesForm::buildForm in src/Form/LingotekSettingsTabPreferencesForm.php
Form constructor.

File

src/Form/LingotekSettingsTabPreferencesForm.php, line 231

Class

LingotekSettingsTabPreferencesForm
Configure Lingotek

Namespace

Drupal\lingotek\Form

Code

protected function retrieveAdminMenu() {
  $menu_link_manager = \Drupal::service('plugin.manager.menu.link');
  $admin_menu = $menu_link_manager
    ->getDefinition('lingotek.dashboard');

  // Will be opposite from enabled value since we're hiding the menu item
  if ($admin_menu['enabled']) {
    $this->top_level_value = 0;
  }
  else {
    $this->top_level_value = 1;
  }
}