1 language_layout_access.inc LanguageLayoutAccess::summary()

Provides a human-readable summary of this access check's behavior.

Parameters

$contexts: An array containing available contexts.

Return value

string: The sanitized HTML summary string for this access check.

Overrides LayoutAccess::summary

File

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

Class

LanguageLayoutAccess

Code

function summary() {
  $languages = array(
    'default' => t('Default site language'),
  );
  $languages += language_list(FALSE, TRUE);
  $names = array();
  foreach ($this->settings['language'] as $langcode) {
    $names[] = $languages[$langcode];
  }
  if (empty($names)) {
    return t('Site language is any language');
  }
  return format_plural(count($names), 'Site language is "@languages"', 'Site language is one of "@languages"', array('@languages' => implode(', ', $names)));
}