announcements.module
Search API
- 6.x modules/announcements/announcements.module
- 4.x modules/announcements/announcements.module
- 5.x modules/announcements/announcements.module
File
modules/announcements/announcements.moduleView source
- <?php
-
- /**
- * This module lets administrators create announcements, when then appear can appear in a block.
- *
- * This module uses the Content module to do all of its work. All it is really for is
- * specifying the content type, then handing its output as a block.
- */
-
-
- /**
- * Implementatin of content's hook_content_register_content_type
- *
- * @return unknown
- */
- function announcements_content_register_content_type() {
- $arr = array(
- "announcement" => array(
- "title" => t("Announcement"),
- "description" => t("This is a short announcement to the user, meant to be displayed like news items in a block."),
- "settings" => array(),
- ),
- );
-
-
- $fields['activity_datetime'] = array(
- 'type' => 'datetime-local',
- 'label' => t('Date/Time'),
- 'value' => 'now',
- 'format_date' => 'short',
- 'weight' => 60,
- 'required' => TRUE,
- );
-
-
-
-
- $fields['msg'] = array(
- 'type' => 'textarea_editor',
- 'label' => t('Message'),
- 'filter' => 'basic',
- 'weight' => 70,
- );
-
-
-
- $fields['visibility'] = array(
- 'type' => 'radios',
- 'label' => 'Visible to:',
- 'options' => array('public' => 'Anyone (incl. student)', 'faculty' => 'Faculty/Staff only'),
- 'weight' => 80,
- );
-
-
- $arr['announcement']['fields'] = $fields;
-
- return $arr;
- }
-
-
- /**
- * Implementation of hook_perm
- *
- */
- function announcements_perm() {
-
- return array(
- "view_faculty_announcements" => array(
- "title" => t("View faculty announcements"),
- ),
- );
- }
-
-
-
-
-
-
-
Functions
Name | Description |
---|---|
announcements_content_register_content_type | Implementatin of content's hook_content_register_content_type |
announcements_perm | Implementation of hook_perm |