accessibility.features.inc

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

Functions

Namesort descending Description
accessibility_test_features_export Implements hook[component]_features_export().
accessibility_test_features_export_options Implements hook[component]_features_export_options().
accessibility_test_features_export_render Implements hook[component]_features_export_render().
accessibility_test_features_rebuild Implements hook[component]_features_rebuild().
accessibility_test_features_revert Implements hook[component]_features_revert().

File

sites/all/modules/ulmus/accessibility/accessibility.features.inc
View source
  1. <?php
  2. /**
  3. * Implements hook[component]_features_export().
  4. */
  5. function accessibility_test_features_export($data, &$export, $module_name) {
  6. if(!function_exists($module_name . 'accessibility_test_default')) {
  7. module_load_include('inc', $module_name, $module_name .'.accessibility_test');
  8. }
  9. foreach ($data as $component) {
  10. $export['features']['accessibility_test'][$component] = $component;
  11. }
  12. return array();
  13. }
  14. /**
  15. * Implements hook[component]_features_export_options().
  16. */
  17. function accessibility_test_features_export_options() {
  18. $options = array();
  19. $tests = accessibility_get_active_tests();
  20. $return = array();
  21. foreach($tests as $test) {
  22. $return[$test->quail_name] = $test->name;
  23. }
  24. return $return;
  25. }
  26. /**
  27. * Implements hook[component]_features_export_render().
  28. */
  29. function accessibility_test_features_export_render($module_name, $data, $export = NULL) {
  30. if(!function_exists($module_name . 'accessibility_test_default')) {
  31. module_load_include('inc', $module_name, $module_name .'.accessibility_test');
  32. }
  33. $code = array();
  34. $code[] = '$accessibility_tests = array();';
  35. foreach ($data as $name) {
  36. $id = accessibility_get_test_by_machine_name($name);
  37. $test = accessibility_test_load($id);
  38. unset($test->test_id);
  39. unset($test->created);
  40. unset($test->changed);
  41. unset($test->rdf_mapping);
  42. $code[] = "\$accessibility_tests['{$name}'] = (object)" . features_var_export($test) .";";
  43. }
  44. $code[] = "return \$accessibility_tests;";
  45. $code = implode("\n", $code);
  46. return array('accessibility_test_default' => $code);
  47. }
  48. /**
  49. * Implements hook[component]_features_revert().
  50. */
  51. function accessibility_test_features_revert($module_name) {
  52. accessibility_test_features_rebuild($module_name);
  53. }
  54. /**
  55. * Implements hook[component]_features_rebuild().
  56. */
  57. function accessibility_test_features_rebuild($module_name) {
  58. if(!function_exists($module_name . 'accessibility_test_default')) {
  59. module_load_include('inc', $module_name, $module_name .'.accessibility_test');
  60. }
  61. $accessibility_tests = module_invoke($module_name, 'accessibility_test_default');
  62. if (!empty($accessibility_tests)) {
  63. foreach ($accessibility_tests as $machine_name => $accessibility_test) {
  64. $id = accessibility_get_test_by_machine_name($machine_name);
  65. if($id) {
  66. $accessibility_test->test_id = $id;
  67. }
  68. $accessibility_test->changed = time();
  69. $accessibility_test->created = time();
  70. accessibility_test_save($accessibility_test);
  71. }
  72. }
  73. }