You are here

class DynamicLocalTasks in Lingotek Translation 8

Defines dynamic local tasks.

Hierarchy

Expanded class hierarchy of DynamicLocalTasks

1 string reference to 'DynamicLocalTasks'
lingotek.links.task.yml in ./lingotek.links.task.yml
lingotek.links.task.yml

File

src/Plugin/Derivative/DynamicLocalTasks.php, line 14
Contains \Drupal\example\Plugin\Derivative\DynamicLocalTasks.

Namespace

Drupal\lingotek\Plugin\Derivative
View 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

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
DynamicLocalTasks::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions