announcements.module

  1. 6.x modules/announcements/announcements.module
  2. 4.x modules/announcements/announcements.module
  3. 5.x modules/announcements/announcements.module

File

modules/announcements/announcements.module
View source
  1. <?php
  2. /**
  3. * This module lets administrators create announcements, when then appear can appear in a block.
  4. *
  5. * This module uses the Content module to do all of its work. All it is really for is
  6. * specifying the content type, then handing its output as a block.
  7. */
  8. /**
  9. * Implementatin of content's hook_content_register_content_type
  10. *
  11. * @return unknown
  12. */
  13. function announcements_content_register_content_type() {
  14. $arr = array(
  15. "announcement" => array(
  16. "title" => t("Announcement"),
  17. "description" => t("This is a short announcement to the user, meant to be displayed like news items in a block."),
  18. "settings" => array(),
  19. ),
  20. );
  21. $fields['activity_datetime'] = array(
  22. 'type' => 'datetime-local',
  23. 'label' => t('Date/Time'),
  24. 'value' => 'now',
  25. 'format_date' => 'short',
  26. 'weight' => 60,
  27. 'required' => TRUE,
  28. );
  29. $fields['msg'] = array(
  30. 'type' => 'textarea_editor',
  31. 'label' => t('Message'),
  32. 'filter' => 'basic',
  33. 'weight' => 70,
  34. );
  35. $fields['visibility'] = array(
  36. 'type' => 'radios',
  37. 'label' => 'Visible to:',
  38. 'options' => array('public' => 'Anyone (incl. student)', 'faculty' => 'Faculty/Staff only'),
  39. 'weight' => 80,
  40. );
  41. $arr['announcement']['fields'] = $fields;
  42. return $arr;
  43. }
  44. /**
  45. * Implementation of hook_perm
  46. *
  47. */
  48. function announcements_perm() {
  49. return array(
  50. "view_faculty_announcements" => array(
  51. "title" => t("View faculty announcements"),
  52. ),
  53. );
  54. }

Functions

Namesort descending Description
announcements_content_register_content_type Implementatin of content's hook_content_register_content_type
announcements_perm Implementation of hook_perm