function quail_api_get_standards_list in Quail API 7
Returns a list of standards.
This is only a list of the machine_name and human_name of the select lists. Use this for populating select lists, radio buttons, and check boxes.
Parameters
array|null $standards: Providing a valid array of standards as returned by quail_api_get_standards() and it will be properly converted into a standards list.
string $target: (optional) Providing a target allows for limiting standards by some category. The target, in general, represents the scope in which the standards will be applied. The following targets are directly supported: 'snippet', 'page'.
Return value
array An array of standards that are supported by this module or extending modules. The array keys are the standard machine name and the array value is the human name.
See also
File
- ./
quail_api.module, line 389 - Module file for the quail api.
Code
function quail_api_get_standards_list($standards = NULL, $target = 'snippet') {
if (is_null($standards)) {
$standards = quail_api_get_standards(NULL, $target);
}
$standards_list = array();
foreach ($standards as $machine_name => $value) {
if (!isset($value['target']) || $value['target'] != $target) {
continue;
}
if (isset($value['human_name'])) {
$standards_list[$machine_name] = $value['human_name'];
}
}
return $standards_list;
}