You are here

function notifications_ui_link in Notifications 6

Same name and namespace in other branches
  1. 5 notifications_ui/notifications_ui.module \notifications_ui_link()
  2. 6.4 notifications_ui/notifications_ui.module \notifications_ui_link()
  3. 6.2 notifications_ui/notifications_ui.module \notifications_ui_link()
  4. 6.3 notifications_ui/notifications_ui.module \notifications_ui_link()
  5. 7 notifications_ui/notifications_ui.module \notifications_ui_link()

Implementation of hook_link()

Add subscriptions links to nodes

File

notifications_ui/notifications_ui.module, line 331
User Interface for subscriptions modules

Code

function notifications_ui_link($type, $node = NULL, $teaser = FALSE) {
  global $user;
  if ($type == 'node' && $user->uid && (notifications_ui_node_options($node->type, 'teaserlinks') && $teaser || notifications_ui_node_options($node->type, 'links') && !$teaser) && ($options = notifications_ui_subscribe_options($user, 'node', $node))) {

    // Now we have the array of allowed options ready, build single links
    return notifications_ui_build_links($options);
  }
}