You are here

public function ThemeLocalTask::getDerivativeDefinitions in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/block/src/Plugin/Derivative/ThemeLocalTask.php \Drupal\block\Plugin\Derivative\ThemeLocalTask::getDerivativeDefinitions()
  2. 8 core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php \Drupal\system\Plugin\Derivative\ThemeLocalTask::getDerivativeDefinitions()
Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php \Drupal\system\Plugin\Derivative\ThemeLocalTask::getDerivativeDefinitions()

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php, line 49
Contains \Drupal\system\Plugin\Derivative\ThemeLocalTask.

Class

ThemeLocalTask
Provides dynamic tabs based on active themes.

Namespace

Drupal\system\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach ($this->themeHandler
    ->listInfo() as $theme_name => $theme) {
    if ($this->themeHandler
      ->hasUi($theme_name)) {
      $this->derivatives[$theme_name] = $base_plugin_definition;
      $this->derivatives[$theme_name]['title'] = $theme->info['name'];
      $this->derivatives[$theme_name]['route_parameters'] = array(
        'theme' => $theme_name,
      );
    }
  }
  return $this->derivatives;
}