You are here

function casetracker_notifications_notifications in Case Tracker 7

Same name and namespace in other branches
  1. 6 casetracker_notifications/casetracker_notifications.module \casetracker_notifications_notifications()

Implements hook_notifications().

File

casetracker_notifications/casetracker_notifications.module, line 35

Code

function casetracker_notifications_notifications($op) {
  switch ($op) {
    case 'subscription types':
      $types['casetracker_assigned'] = array(
        'event_type' => 'node',
        'object_type' => 'node',
        'title' => t('Cases assigned'),
        'access' => 'subscribe to cases',
        'fields' => array(
          'casetracker_assign',
        ),
        'description' => t('Subscribe to all cases assigned to a user.'),
      );
      $types['casetracker_project'] = array(
        'event_type' => 'node',
        'object_type' => 'node',
        'title' => t('Project cases'),
        'access' => 'subscribe to cases',
        'page callback' => 'casetracker_notifications_projects_page',
        'user page' => 'user/%user/notifications/casetracker',
        'fields' => array(
          'casetracker_project',
        ),
        'description' => t('Subscribe to all cases for a project.'),
      );
      return $types;
    case 'subscription fields':
      $fields['casetracker_assign'] = array(
        'name' => t('Assigned to'),
        'field' => 'assign_to',
        'type' => 'int',
        'object_type' => 'user',
      );
      $fields['casetracker_project'] = array(
        'name' => t('Project'),
        'field' => 'casetracker_project',
        'type' => 'int',
        'object_type' => 'node',
      );
      return $fields;
  }
}