You are here

function hook_quail_api_get_severitys in Quail API 8

Define quail api display levels.

This allows for custom modules to define their own quail api display levels or alter an existing display level.

Parameters

$severitys: An array of standards that is returned to the caller.

$severity: (optional) A number representing the display level. When defined, the return value to only contain the display level that matches this string. When undefined, all display levels will be loaded into the severitys array.

$other_arguments: (optional) Array of additional arguments.

The severitys array has the following structure:

  • display level: An array (whose key is the numerical id of the display level) defining a given display level using the following keys:

    • machine name: Machine name of the standard.
    • human name: Human friendly name of the standard.
    • module: Machine name of the primary module providing this display level.
    • description: A description of the standard, wrapped in t().
    • id: Numerical id of the display level, this must match the array key.
    • default: A boolean representing whether or not to have this display level enabled by default.

See also

QuailApiSettings::get_severity()

QuailApiSettings::get_severity_list()

File

./quail_api.api.php, line 113
Hooks provided by the quail api.

Code

function hook_quail_api_get_severitys(&$severitys, $severity) {
  if (!is_numeric($severity) || $severity == 4) {
    $severitys[4] = array(
      'machine_name' => 'quail_test_other',
      'human_name' => t("Other Problems"),
      'module' => 'wcag7',
      'description' => t("Other problems represent failures in accessibility compliance that do not fall in any of the three primary categories: Major, Minor, and Suggestion."),
      'id' => 4,
      'default' => TRUE,
    );
  }
}