accessibility.pages.inc

  1. cis7 sites/all/modules/ulmus/accessibility/accessibility.pages.inc
  2. cle7 sites/all/modules/ulmus/accessibility/accessibility.pages.inc
  3. ecd7 sites/all/modules/ulmus/accessibility/accessibility.pages.inc
  4. elmsmedia7 sites/all/modules/ulmus/accessibility/accessibility.pages.inc
  5. harmony7 sites/all/modules/ulmus/accessibility/accessibility.pages.inc
  6. icor7 sites/all/modules/ulmus/accessibility/accessibility.pages.inc
  7. meedjum_blog7 sites/all/modules/ulmus/accessibility/accessibility.pages.inc
  8. mooc7 sites/all/modules/ulmus/accessibility/accessibility.pages.inc

Functions

Namesort descending Description
accessibility_tests_json Outputs settings and test information in JSON.

File

sites/all/modules/ulmus/accessibility/accessibility.pages.inc
View source
  1. <?php
  2. /**
  3. * Outputs settings and test information in JSON.
  4. */
  5. function accessibility_tests_json($return = FALSE) {
  6. if(!$result = cache_get('accessibility_tests_json')) {
  7. $existing_tests = accessibility_get_active_tests();
  8. $accessibility_tests = module_invoke_all('accessibility_tests', FALSE);
  9. $result = array();
  10. foreach ($existing_tests as $test_id => $test) {
  11. $result[$test->quail_name] = $accessibility_tests[$test->quail_name];
  12. $result[$test->quail_name]['readableName'] = $test->name;
  13. $result[$test->quail_name]['testId'] = $test_id;
  14. $result[$test->quail_name]['tags'] = $accessibility_tests[$test->quail_name]['tags'];
  15. }
  16. cache_set('accessibility_tests_json', $result);
  17. }
  18. else {
  19. $result = $result->data;
  20. }
  21. if ($return) {
  22. return $result;
  23. }
  24. drupal_json_output(array('guideline' => array_keys($result), 'tests' => $result));
  25. }