function template_preprocess_quail_api_test in Quail API 7
Same name and namespace in other branches
- 8 quail_api.module \template_preprocess_quail_api_test()
Template preprocess function for quail_api_test.tpl.php.
File
- ./
quail_api.module, line 117 - Module file for the quail api.
Code
function template_preprocess_quail_api_test(&$variables) {
drupal_add_css(drupal_get_path('module', 'quail_api') . '/includes/quail_api.css');
$root_class_name = 'quail_api-test';
$variables['base_class'] = $root_class_name;
$variables['specific_class'] = '';
$variables['test_title'] = '';
$variables['test_description'] = '';
$variables['test_problems'] = array();
if (!empty($variables['test_name'])) {
$variables['specific_class'] = $root_class_name . '-' . drupal_strtolower(check_plain($variables['test_name']));
}
if (!empty($variables['test_results']['body']['title'])) {
$variables['test_title'] = check_plain($variables['test_results']['body']['title']);
if (isset($variables['test_results']['body']['description'])) {
$variables['test_description'] = check_markup($variables['test_results']['body']['description'], $variables['markup_format']);
}
if (!empty($variables['test_results']['problems'])) {
$variables['test_problems'] = $variables['test_results']['problems'];
}
}
unset($variables['test_name']);
unset($variables['test_results']);
}