You are here

function notifications_content_page_nodetype in Notifications 6.3

Same name and namespace in other branches
  1. 5 notifications_content/notifications_content.module \notifications_content_page_nodetype()
  2. 6 notifications_content/notifications_content.pages.inc \notifications_content_page_nodetype()
  3. 6.2 notifications_content/notifications_content.pages.inc \notifications_content_page_nodetype()

User subscriptions to content types

2 string references to 'notifications_content_page_nodetype'
notifications_content_menu in notifications_content/notifications_content.module
Implementation of hook_menu_()
notifications_content_notifications in notifications_content/notifications_content.module
Implementation of hook_notifications()

File

notifications_content/notifications_content.pages.inc, line 98
Subscriptions to content events

Code

function notifications_content_page_nodetype($account = NULL) {
  global $user;
  if (!isset($account)) {
    $account = $user;
  }

  // List of all subscribed node types
  $subscriptions = notifications_get_subscriptions(array(
    'type' => 'nodetype',
    'uid' => $account->uid,
  ), array(
    'type' => NULL,
  ), TRUE, 'value');
  $output = '';
  $types = notifications_content_types('name');
  if (!$types) {
    $output .= t('There are no active content types.');
  }
  else {
    $defaults = array(
      'type' => 'nodetype',
      'event_type' => 'node',
    );
    $options = array(
      'title' => t('Type'),
    );
    $output .= drupal_get_form('notifications_user_form', $account, 'nodetype', $subscriptions, $types, $defaults, $options);
  }
  return $output;
}