Further modules included.
[yaffs-website] / web / modules / contrib / advanced_help / src / Plugin / Derivative / DynamicLocalTasks.php
1 <?php
2
3 namespace Drupal\advanced_help\Plugin\Derivative;
4
5 use Drupal\Component\Plugin\Derivative\DeriverBase;
6
7 /**
8  * Defines dynamic local tasks.
9  */
10 class DynamicLocalTasks extends DeriverBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function getDerivativeDefinitions($base_plugin_definition) {
16
17     if (\Drupal::moduleHandler()->moduleExists('help')) {
18       $this->derivatives['advanced_help.help'] = $base_plugin_definition;
19       $this->derivatives['advanced_help.help']['title'] = "Help";
20       $this->derivatives['advanced_help.help']['route_name'] = 'help.main';
21       $this->derivatives['advanced_help.help']['base_route'] = 'help.main';
22
23       $this->derivatives['help.main'] = $base_plugin_definition;
24       $this->derivatives['help.main']['title'] = "Advanced Help";
25       $this->derivatives['help.main']['route_name'] = 'advanced_help.main';
26       $this->derivatives['help.main']['base_route'] = 'help.main';
27
28       return $this->derivatives;
29     }
30   }
31 }
32 ?>