accessibility_content.inc

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

Functions

File

sites/all/modules/ulmus/accessibility/modules/accessibility_content/accessibility_content.inc
View source
  1. <?php
  2. function accessibility_content_load_tests_json() {
  3. $tests = _accessibility_content_get_quail_tests();
  4. $result = array();
  5. $existing_tests = accessibility_get_active_tests();
  6. foreach ($tests as $test_name => $test) {
  7. if (isset($existing_tests[$test_name])) {
  8. $test->accessibility_content_test_id = $existing_tests[$test_name];
  9. $result[$test_name] = $test;
  10. }
  11. }
  12. drupal_json_output(array('guideline' => array_keys($result), 'tests' => $result));
  13. }
  14. function accessibility_content_init($options = array()) {
  15. static $init;
  16. if ($init) {
  17. return;
  18. }
  19. $init = TRUE;
  20. if (!user_access('check content for accessibility')) {
  21. return;
  22. }
  23. $settings = array();
  24. $settings['show_default'] = variable_get('accessibility_content_auto_check', FALSE);
  25. $settings['show_toggle'] = variable_get('accessibility_content_show_toggle', TRUE);
  26. $settings['toggle']['off_message'] = variable_get('accessibility_content_toggle_message_off', t('Check page for accessibility'));
  27. $settings['toggle']['on_message'] = variable_get('accessibility_content_toggle_message_on', t('Hide checks for accessibility'));
  28. $settings['options'] = $options;
  29. accessibility_load();
  30. drupal_add_js(array('accessibility_content' => $settings), 'setting');
  31. drupal_add_js(drupal_get_path('module', 'accessibility_content') . '/js/accessibility_content.js');
  32. drupal_add_css(drupal_get_path('module', 'accessibility_content') . '/css/accessibility_content.css');
  33. }
  34. function _accessibility_content_field_pre_render($element) {
  35. $element['#prefix'] = (isset($element['#prefix'])) ? $element['#prefix'] : '';
  36. $element['#suffix'] = (isset($element['#suffix'])) ? $element['#suffix'] : '';
  37. $element['#prefix'] = '<span class="ac-check-field">' . $element['#prefix'];
  38. $element['#suffix'] .= '</span>';
  39. return $element;
  40. }