You are here

function notifications_content_types in Notifications 6.2

Same name and namespace in other branches
  1. 5 notifications_content/notifications_content.module \notifications_content_types()
  2. 6.4 notifications_content/notifications_content.module \notifications_content_types()
  3. 6 notifications_content/notifications_content.module \notifications_content_types()
  4. 6.3 notifications_content/notifications_content.module \notifications_content_types()
  5. 7 notifications_content/notifications_content.module \notifications_content_types()

Get content types available for subscriptions to content type

Parameters

$field: Optional field to return as array value. If none it will return the full objects.

$subs_type: Optional type of subscription for which to find allowed content types. Defaults to nodetype, can be any subscription type with event-type=node for which notifications_content handles content type settings.

6 calls to notifications_content_types()
NotificationsContentTests::testNotificationsContent in tests/notifications_content.test
Play with creating, retrieving, deleting a pair subscriptions
notifications_content_form_alter in notifications_content/notifications_content.module
Implementation of hook_form_alter().
notifications_content_page_nodetype in notifications_content/notifications_content.pages.inc
User subscriptions to content types
notifications_content_page_thread in notifications_content/notifications_content.pages.inc
Subscriptions page callback: List thread subscriptions
notifications_content_types_callback in notifications_content/notifications_content.module
Wrapper for options callback based on subscription type.

... See full list

2 string references to 'notifications_content_types'
notifications_content_uninstall in notifications_content/notifications_content.install
Implementation of hook_uninstall().
notifications_update_5 in ./notifications.install
Update content type and taxonomy options

File

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

Code

function notifications_content_types($field = 'name', $subs_type = 'nodetype') {

  // Get list of available node types, all of them will be allowed by default
  $types = array();
  foreach (node_get_types() as $key => $data) {
    if (notifications_content_type_enabled($key, $subs_type)) {
      $types[$key] = $data;
    }
  }
  if ($field) {
    foreach (array_keys($types) as $type) {
      $types[$type] = $types[$type]->{$field};
    }
  }
  return $types;
}