X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FPlugin%2FDerivative%2FThemeLocalTask.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FPlugin%2FDerivative%2FThemeLocalTask.php;h=ab9f87d949618ae6e32d4be61dd4db47078e1c40;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php b/web/core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php new file mode 100644 index 000000000..ab9f87d94 --- /dev/null +++ b/web/core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php @@ -0,0 +1,55 @@ +themeHandler = $theme_handler; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, $base_plugin_id) { + return new static( + $container->get('theme_handler') + ); + } + + /** + * {@inheritdoc} + */ + 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'] = ['theme' => $theme_name]; + } + } + return $this->derivatives; + } + +}