Loading core/modules/search/src/Annotation/SearchPlugin.php +7 −0 Original line number Diff line number Diff line Loading @@ -37,4 +37,11 @@ class SearchPlugin extends Plugin { */ public $title; /** * Whether or not search results should be displayed in admin theme. * * @var bool */ public $use_admin_theme = FALSE; } core/modules/search/src/Plugin/SearchInterface.php +11 −0 Original line number Diff line number Diff line Loading @@ -145,4 +145,15 @@ public function searchFormAlter(array &$form, FormStateInterface $form_state); */ public function buildSearchUrlQuery(FormStateInterface $form_state); /** * Returns whether or not search results should be displayed in admin theme. * * @return bool * TRUE if search results should be displayed in the admin theme, and FALSE * otherwise. * * @see \Drupal\search\Annotation\SearchPlugin::$use_admin_theme */ public function usesAdminTheme(); } core/modules/search/src/Plugin/SearchPluginBase.php +7 −0 Original line number Diff line number Diff line Loading @@ -162,4 +162,11 @@ public function getHelp() { return $help; } /** * {@inheritdoc} */ public function usesAdminTheme() { return $this->pluginDefinition['use_admin_theme']; } } core/modules/search/src/Routing/SearchPageRoutes.php +4 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,10 @@ public function routes() { ], ] ); if ($entity->getPlugin()->usesAdminTheme()) { $routes["search.view_$entity_id"]->setOption('_admin_route', TRUE); $routes["search.help_$entity_id"]->setOption('_admin_route', TRUE); } } return $routes; } Loading core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php +2 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,8 @@ * * @SearchPlugin( * id = "search_extra_type_search", * title = @Translation("Dummy search type") * title = @Translation("Dummy search type"), * use_admin_theme = TRUE, * ) */ class SearchExtraTypeSearch extends ConfigurableSearchPluginBase { Loading Loading
core/modules/search/src/Annotation/SearchPlugin.php +7 −0 Original line number Diff line number Diff line Loading @@ -37,4 +37,11 @@ class SearchPlugin extends Plugin { */ public $title; /** * Whether or not search results should be displayed in admin theme. * * @var bool */ public $use_admin_theme = FALSE; }
core/modules/search/src/Plugin/SearchInterface.php +11 −0 Original line number Diff line number Diff line Loading @@ -145,4 +145,15 @@ public function searchFormAlter(array &$form, FormStateInterface $form_state); */ public function buildSearchUrlQuery(FormStateInterface $form_state); /** * Returns whether or not search results should be displayed in admin theme. * * @return bool * TRUE if search results should be displayed in the admin theme, and FALSE * otherwise. * * @see \Drupal\search\Annotation\SearchPlugin::$use_admin_theme */ public function usesAdminTheme(); }
core/modules/search/src/Plugin/SearchPluginBase.php +7 −0 Original line number Diff line number Diff line Loading @@ -162,4 +162,11 @@ public function getHelp() { return $help; } /** * {@inheritdoc} */ public function usesAdminTheme() { return $this->pluginDefinition['use_admin_theme']; } }
core/modules/search/src/Routing/SearchPageRoutes.php +4 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,10 @@ public function routes() { ], ] ); if ($entity->getPlugin()->usesAdminTheme()) { $routes["search.view_$entity_id"]->setOption('_admin_route', TRUE); $routes["search.help_$entity_id"]->setOption('_admin_route', TRUE); } } return $routes; } Loading
core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php +2 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,8 @@ * * @SearchPlugin( * id = "search_extra_type_search", * title = @Translation("Dummy search type") * title = @Translation("Dummy search type"), * use_admin_theme = TRUE, * ) */ class SearchExtraTypeSearch extends ConfigurableSearchPluginBase { Loading