You are here

class SchemeLocalTask in Taxonomy Access Control Lite 8

Provides local tasks for each search page.

Hierarchy

Expanded class hierarchy of SchemeLocalTask

1 string reference to 'SchemeLocalTask'
tac_lite.links.task.yml in ./tac_lite.links.task.yml
tac_lite.links.task.yml

File

src/Plugin/Derivative/SchemeLocalTask.php, line 10

Namespace

Drupal\tac_lite\Plugin\Derivative
View source
class SchemeLocalTask extends DeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    $this->derivatives = [];
    $config = \Drupal::config('tac_lite.settings');
    $schemes = $config
      ->get('tac_lite_schemes');
    for ($i = 1; $i <= $schemes; $i++) {
      $scheme = $config
        ->get('tac_lite_config_scheme_' . $i);
      $title = $scheme['name'] ? $scheme['name'] : 'Scheme ' . $i;
      $this->derivatives[] = [
        'title' => $title,
        'route_name' => 'tac_lite.scheme_' . $i,
        'base_route' => 'tac_lite.administration',
        'weight' => $i,
      ];
    }
    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
SchemeLocalTask::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions