You are here

function _notifications_content_node_options in Notifications 5

Same name and namespace in other branches
  1. 6 notifications_content/notifications_content.module \_notifications_content_node_options()
  2. 6.2 notifications_content/notifications_content.module \_notifications_content_node_options()
  3. 6.3 notifications_content/notifications_content.module \_notifications_content_node_options()
1 call to _notifications_content_node_options()
notifications_content_notifications in notifications_content/notifications_content.module
Implementation of hook_notifications()

File

notifications_content/notifications_content.module, line 416
Subscriptions to content events

Code

function _notifications_content_node_options($account, $node) {

  // Default node, field are the first three indexes, but they can be overridden in params
  // Thread
  $options[] = array(
    'name' => t('This post'),
    'type' => 'thread',
    'fields' => array(
      'nid' => $node->nid,
    ),
  );

  // Content type
  $options[] = array(
    'name' => t('Posts of type %type', array(
      '%type' => node_get_types('name', $node->type),
    )),
    'type' => 'nodetype',
    'fields' => array(
      'type' => $node->type,
    ),
  );

  // Author
  $options[] = array(
    'name' => t('Posts by %name', array(
      '%name' => $node->name,
    )),
    'type' => 'author',
    'fields' => array(
      'author' => $node->uid,
    ),
  );
  return $options;
}