1 http_response_code_layout_access.inc public HttpResponseCodeLayoutAccess::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/http_response_code_layout_access.inc, line 73
Plugin to provide access control by the server HTTP response code.

Class

HttpResponseCodeLayoutAccess
@file Plugin to provide access control by the server HTTP response code.

Code

public function summary() {
  $allowed_status_codes = array_filter($this->settings['http_response_codes']);

  if (count($allowed_status_codes)) {
    if ($this->settings['negate']) {
      $summary = format_plural(count($allowed_status_codes), 'Server response code is not @response', 'Server response code is not one of: @response', array('@response' => implode(', ', $allowed_status_codes)));
    }
    else {
      $summary = format_plural(count($allowed_status_codes), 'Server response code is @response', 'Server response code is one of: @response', array('@response' => implode(', ', $allowed_status_codes)));
    }
  }
  else {
    $summary = t('Shown on all pages where this layout applies.');
  }

  return $summary;
}