You are here

function notifications_notifications in Notifications 6.4

Same name and namespace in other branches
  1. 5 notifications.module \notifications_notifications()
  2. 6 notifications.module \notifications_notifications()
  3. 6.2 notifications.module \notifications_notifications()
  4. 6.3 notifications.module \notifications_notifications()
  5. 7 notifications.module \notifications_notifications()

Implementation of hook_notifications()

Check access permissions to subscriptions and take care of some backwards compatibility

File

./notifications.module, line 1700
Notifications module

Code

function notifications_notifications($op) {
  switch ($op) {
    case 'build methods':

      // Return array of building engines
      $info['simple'] = array(
        'type' => 'simple',
        'name' => t('Simple'),
        'description' => t('Produces one message per event, without digesting.'),
        // This is a built in method so we don't have a 'build callback' for it

        //'build callback' => array('Notifications_Message', 'build_simple',
        'digest' => FALSE,
      );
      return $info;
    case 'object types':
      notifications_include('object.inc');
      $types['node'] = array(
        'name' => t('Node'),
        'key_field' => 'nid',
        'load callback' => 'node_load',
        'autocomplete path' => 'notifications/autocomplete/node/title',
        'autocomplete callback' => 'notifications_node_nid2autocomplete',
        'format callback' => 'notifications_node_nid2title',
        'value callback' => 'notifications_node_title2nid',
        'access callback' => 'notifications_node_user_access',
        'file' => 'node.inc',
      );
      $types['user'] = array(
        'name' => t('User'),
        'key_field' => 'uid',
        'load callback' => 'notifications_load_user',
        'autocomplete path' => 'user/autocomplete',
        'autocomplete callback' => 'notifications_user_name_callback',
        'format callback' => 'messaging_user_format_name',
        'value callback' => 'notifications_user_name2uid',
        'access callback' => 'notifications_user_user_access',
        'file' => 'user.inc',
      );
      return $types;
  }
}