You are here

function _subscriptions_content_types in Subscriptions 2.0.x

Same name and namespace in other branches
  1. 5.2 subscriptions_content.module \_subscriptions_content_types()
  2. 6 subscriptions_content.module \_subscriptions_content_types()
  3. 7 subscriptions_content.module \_subscriptions_content_types()

Implements _hook_types(), subhook of hook_subscriptions().

This is called by subscriptions_types() in subscriptions.module.

Return value

array Returns information about types for Subscriptions module interface.

See also

subscriptions_types()

File

subscriptions_content/subscriptions_content.module, line 204
Subscriptions to content events.

Code

function _subscriptions_content_types() {
  $types['node'] = [
    'title' => 'Pages/Threads',
    'page' => 'subscriptions_content_page_node',
    'fields' => [
      'node',
      'nid',
    ],
    'weight' => -40,
    'access' => 'subscribe to content',
    'permission' => [
      'title' => t('Subscribe to content'),
      'description' => t('Subscribe to single pages/threads.'),
    ],
  ];
  $types['type'] = [
    'title' => 'Content types',
    'page' => 'subscriptions_content_page_type',
    'fields' => [
      'node',
      'type',
    ],
    'weight' => -30,
    'access' => 'subscribe to content types',
    'permission' => [
      'title' => t('Subscribe to content types'),
      'description' => t('Subscribe to entire content types; requires the %perm permission.', [
        '%perm' => $types['node']['permission']['title'],
      ]),
    ],
  ];
  $types['all_types'] = [
    'title' => '',
    'access' => 'subscribe to all content types',
    'permission' => [
      'title' => t('Subscribe to all content types'),
      'description' => t('Subscribe even to unlisted and blocked content types.') . '<br /><em>' . t('This permission is typically reserved for administrative roles.') . '</em>',
    ],
  ];
  return $types;
  t('Pages/Threads');
}