class DynamicLocalTasks in Lingotek Translation 8
Defines dynamic local tasks.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\lingotek\Plugin\Derivative\DynamicLocalTasks
Expanded class hierarchy of DynamicLocalTasks
1 string reference to 'DynamicLocalTasks'
File
- src/
Plugin/ Derivative/ DynamicLocalTasks.php, line 14 - Contains \Drupal\example\Plugin\Derivative\DynamicLocalTasks.
Namespace
Drupal\lingotek\Plugin\DerivativeView source
class DynamicLocalTasks extends DeriverBase {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$lingotek_config = \Drupal::service('lingotek.configuration');
$config = \Drupal::configFactory()
->get('lingotek.settings');
$show_import_tab = $config
->get('preference.enable_content_cloud');
if ($show_import_tab) {
$this->derivatives['lingotek.import'] = $base_plugin_definition;
$this->derivatives['lingotek.import']['title'] = 'Import (Beta)';
$this->derivatives['lingotek.import']['route_name'] = 'lingotek.import';
$this->derivatives['lingotek.import']['base_route'] = 'lingotek.dashboard';
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
DynamicLocalTasks:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |