audit.api.php

  1. 7.x modules/audit/audit.api.php
  2. 6.x modules/audit/audit.api.php

This file contains examples of the hooks you may use (as a module developer) to extend the functionality of the audit module.

File

modules/audit/audit.api.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * This file contains examples of the hooks you may use (as a module developer) to extend the functionality
  5. * of the audit module.
  6. */
  7. /**
  8. * This hook allows the module developer to modify the approval types
  9. * which will be displayed on the audit tab.
  10. *
  11. * Ordinarily, basic approvals are able to be added via the Audit settings using
  12. * the Admin Console. This allows us to remove, re-arrange, or add new approvals
  13. * dynamically.
  14. *
  15. * Notice that the $approvals array is passed by reference. There is no need
  16. * to return anything.
  17. */
  18. function hook_audit_modify_approval_types(&$approvals, $school_id = 0) {
  19. // $approvals looks like:
  20. /*
  21. * $approvals['machine_name'] = array(
  22. * 'title' => 'Some Title'
  23. * 'description' => 'Some Description',
  24. * );
  25. *
  26. * To ensure uniqueness, it is best practice for the machine name to begin with the name
  27. * of the module. Ex: mymodule_education_coursework.
  28. *
  29. */
  30. $approvals['mymodule_education_coursework'] = array(
  31. 'title' => 'Education Coursework',
  32. 'description' => 'The student has completed all Education coursework with a GPA of at least 2.5.',
  33. );
  34. // Do not return anything. $approvals is passed by reference.
  35. }
  36. /**
  37. * This hook allows other modules to add to the "overall" calculations table near the top of the Audit tab.
  38. *
  39. * Items added here will appear ABOVE the "footnotes & messages" section.
  40. *
  41. * @return $rtn An array that contains the additional row information. Ex:
  42. * $rtn[] = array(
  43. * 'title' => 'Education Courses:',
  44. * 'section_1_html' => $some_html_here
  45. * 'section_2_html' => $some_html_here_also
  46. * 'raw_data' => $arr, // optional array of "raw data" formatted however you like, for use later in other modules.
  47. * );
  48. */
  49. function hook_audit_get_additional_overall_calculations($student, $school_id = 0) {
  50. $rtn = array();
  51. // IF student is in the Education major....
  52. $rtn[] = array(
  53. 'title' => 'Education Courses:',
  54. 'section_1_html' => '<b>This goes in section 1</b>',
  55. 'section_2_html' => '<b>This goes in section 2</b>',
  56. 'raw_data' => array(1,2,3,4),
  57. );
  58. return $rtn;
  59. }

Functions

Namesort descending Description
hook_audit_get_additional_overall_calculations This hook allows other modules to add to the "overall" calculations table near the top of the Audit tab.
hook_audit_modify_approval_types This hook allows the module developer to modify the approval types which will be displayed on the audit tab.