function notifications_user_notifications in Notifications 7
Implementation of hook_notifications()
File
- notifications_user/
notifications_user.module, line 52 - Notifications module - User subscriptions tabs
Code
function notifications_user_notifications($op) {
switch ($op) {
case 'subscription types':
$types['user_content'] = array(
'title' => t('Author'),
'class' => 'Notifications_User_Content_Subscription',
'field_types' => array(
'node:uid',
),
'object_types' => array(
'node',
'user',
),
'access' => array(
'subscribe to author',
),
'description' => t('Subscribe to all content submitted by a user.'),
'display_options' => array(
'user_links',
'account_tabs',
),
);
// This is a complex type, combining two fields
$types['user_content_type'] = array(
'title' => t('Content type by author'),
'class' => 'Notifications_User_Content_Subscription',
'field_types' => array(
'node:type',
'node:uid',
),
'object_types' => array(
'node',
'node_type',
'user',
),
'access' => array(
'subscribe to content',
'subscribe to author',
),
'description' => t('Subscribe to all content of a given type submitted by a user.'),
);
return $types;
case 'field types':
$fields['node:uid'] = array(
'title' => t('Author'),
'class' => 'Notifications_Node_Author_Field',
);
return $fields;
case 'display options':
// All types can be in block
$types['user_links'] = array(
'#title' => t('User links'),
'#description' => t('Display subscription links on user account page.'),
);
return $types;
}
}