accessibility_reporting.views.inc

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

Exposes reporting data to views.

Functions

File

sites/all/modules/ulmus/accessibility/modules/accessibility_reporting/views/accessibility_reporting.views.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Exposes reporting data to views.
  5. */
  6. /**
  7. * Implements hook_views_data().
  8. */
  9. function accessibility_reporting_views_data() {
  10. // Define the base group of this table.
  11. $data['accessibility_reporting']['table']['group'] = t('Accessibility reporting');
  12. $data['accessibility_reporting']['field'] = array(
  13. 'title' => t('Responsible field'),
  14. 'help' => t('The field in the entity that had the error.'),
  15. 'field' => array(
  16. 'handler' => 'views_handler_accessibility_reporting_field',
  17. ),
  18. 'argument' => array(
  19. 'handler' => 'views_handler_argument_string',
  20. 'numeric' => TRUE,
  21. ),
  22. 'filter' => array(
  23. 'handler' => 'views_handler_filter',
  24. ),
  25. 'sort' => array(
  26. 'handler' => 'views_handler_sort',
  27. ),
  28. );
  29. $data['accessibility_reporting']['total'] = array(
  30. 'title' => t('Total errors'),
  31. 'help' => t('Total number of errors in a field.'),
  32. 'field' => array(
  33. 'handler' => 'views_handler_field_numeric',
  34. 'click sortable' => TRUE,
  35. ),
  36. 'argument' => array(
  37. 'handler' => 'views_handler_argument_numeric',
  38. 'numeric' => TRUE,
  39. ),
  40. 'filter' => array(
  41. 'handler' => 'views_handler_filter_numeric',
  42. ),
  43. 'sort' => array(
  44. 'handler' => 'views_handler_sort',
  45. ),
  46. );
  47. $data['accessibility_reporting']['accessibility_test'] = array(
  48. 'title' => t('Accessibility test'),
  49. 'help' => t('The accessibility test that failed.'),
  50. 'relationship' => array(
  51. 'label' => t('Accessibility test'),
  52. 'base' => 'accessibility_test',
  53. 'base field' => 'test_id',
  54. 'relationship field' => 'test_id',
  55. ),
  56. );
  57. return $data;
  58. }
  59. /**
  60. * Implements hook_views_data_alter().
  61. */
  62. function accessibility_reporting_views_data_alter(&$data) {
  63. // Load information for entity types so we can find their base tables
  64. $entity_infos = entity_get_info();
  65. $entity_tables = array();
  66. foreach ($entity_infos as $entity_type => $entity_info) {
  67. if (isset($entity_info['base table'])) {
  68. $data[$entity_info['base table']]['accessibility_reporting_base_left_' . $entity_info['base table']] = array(
  69. 'title' => t('Accessibility reporting results'),
  70. 'help' => t('Provides a relationship from entities to the appropriate accessibility reporting'),
  71. 'relationship' => array(
  72. 'label' => t('Reporting'),
  73. 'title' => t('Accessibility report results'),
  74. 'base' => 'accessibility_reporting',
  75. 'base field' => 'entity_id',
  76. 'relationship field' => $entity_info['entity keys']['id'],
  77. 'entity_type_left' => $entity_type,
  78. 'handler' => 'views_handler_relationship',
  79. ),
  80. );
  81. }
  82. }
  83. }