You are here

function notifications_custom_notifications in Notifications 6.4

Same name and namespace in other branches
  1. 6 notifications_custom/notifications_custom.module \notifications_custom_notifications()

Implementation of hook_notifications().

File

notifications_custom/notifications_custom.module, line 115
Custom notifications module

Code

function notifications_custom_notifications($op) {
  switch ($op) {
    case 'subscription types':
      if ($custom = notifications_custom_list()) {
        foreach ($custom as $subs) {
          $type = (array) $subs;
          $type['custom'] = TRUE;
          $type['class'] = 'Notifications_Custom_Subscription';
          $types[$subs->type] = $type;
        }
        return $types;
      }
      break;
    case 'subscription fields':

      // To create custom subscriptions to specific event actions
      $fields['event-action'] = array(
        'name' => t('Action'),
        'field' => 'event-action',
        'type' => 'string',
        'options callback' => 'notifications_custom_event_actions',
      );
      return $fields;
  }
}