1 language_layout_access.inc LanguageLayoutAccess::checkAccess()

Checks for access based on the available context.

Return value

boolean: The result of the access check.

Overrides LayoutAccess::checkAccess

File

core/modules/layout/plugins/access/language_layout_access.inc, line 39
Plugin to provide access control based upon the current site language.

Class

LanguageLayoutAccess

Code

function checkAccess() {
  global $language;

  // Special case: If 'default' is checked, return TRUE if the default site
  // language matches the current interface language.
  if (in_array('default', $this->settings['language'])) {
    $default = language_default();
    if ($language->langcode == $default->langcode) {
      return TRUE;
    }
  }

  return in_array($language->langcode, $this->settings['language']);
}