class CrmCoreAdminNegotiator in CRM Core 8.3
Provides the theme negotiator to use the admin theme on crm-core pages.
Hierarchy
- class \Drupal\user\Theme\AdminNegotiator implements ThemeNegotiatorInterface uses DeprecatedServicePropertyTrait
- class \Drupal\crm_core\Theme\CrmCoreAdminNegotiator
Expanded class hierarchy of CrmCoreAdminNegotiator
1 string reference to 'CrmCoreAdminNegotiator'
1 service uses CrmCoreAdminNegotiator
File
- src/
Theme/ CrmCoreAdminNegotiator.php, line 11
Namespace
Drupal\crm_core\ThemeView source
class CrmCoreAdminNegotiator extends AdminNegotiator {
/**
* {@inheritdoc}
*/
public function determineActiveTheme(RouteMatchInterface $route_match) {
return $this->configFactory
->get('crm_core.settings')
->get('custom_theme');
}
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
if ($this->configFactory
->get('crm_core.settings')
->get('custom_theme')) {
if ($route_match
->getRouteObject()) {
$path = $route_match
->getRouteObject()
->getPath();
if (strpos($path, '/crm-core') === 0) {
return TRUE;
}
}
}
return FALSE;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AdminNegotiator:: |
protected | property | The route admin context to determine whether a route is an admin one. | |
AdminNegotiator:: |
protected | property | The config factory. | |
AdminNegotiator:: |
protected | property | ||
AdminNegotiator:: |
protected | property | The entity type manager. | |
AdminNegotiator:: |
protected | property | The current user. | |
AdminNegotiator:: |
public | function | Creates a new AdminNegotiator instance. | |
CrmCoreAdminNegotiator:: |
public | function |
Whether this theme negotiator should be used to set the theme. Overrides AdminNegotiator:: |
|
CrmCoreAdminNegotiator:: |
public | function |
Determine the active theme for the request. Overrides AdminNegotiator:: |
|
DeprecatedServicePropertyTrait:: |
public | function | Allows to access deprecated/removed properties. |