You are here

function domain_config_ui_path_is_registered in Domain Access 8

Checks if provided path should have a domain switch form on top of the page.

Return value

bool TRUE if domain switch should be added. Otherwise, FALSE.

1 call to domain_config_ui_path_is_registered()
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 151
Allows saving of domain specific configuration through the UI.

Code

function domain_config_ui_path_is_registered() {
  $path_pages = \Drupal::config('domain_config_ui.settings')
    ->get('path_pages');

  // Theme settings pass arguments, so check both path and route.
  $path = \Drupal::service('path.current')
    ->getPath();

  // Get internal path without language prefix.
  $url = Url::fromUri('internal:' . $path);
  $internal_path = '/' . $url
    ->getInternalPath();
  return \Drupal::service('path.matcher')
    ->matchPath($internal_path, $path_pages);
}