You are here

function domain_config_ui_route_is_admin in Domain Access 8

Checks if route is admin.

Return value

bool TRUE if route is admin. Otherwise, FALSE.

1 call to domain_config_ui_route_is_admin()
domain_config_ui_preprocess_page in domain_config_ui/domain_config_ui.module
Implements hook_preprocess_page().

File

domain_config_ui/domain_config_ui.module, line 169
Allows saving of domain specific configuration through the UI.

Code

function domain_config_ui_route_is_admin() {
  $route = \Drupal::routeMatch()
    ->getRouteObject();

  // Never allow this module's form to be added.
  // @TODO: Allow modules to extend this list.
  $disallowed = [
    '/admin/config/domain/config-ui',
    '/admin/config/domain/settings',
  ];
  if (in_array($route
    ->getPath(), $disallowed, TRUE)) {
    return FALSE;
  }
  return \Drupal::service('router.admin_context')
    ->isAdminRoute($route);
}