function _notifications_content_user_options in Notifications 6.2
Same name and namespace in other branches
- 6 notifications_content/notifications_content.module \_notifications_content_user_options()
- 6.3 notifications_content/notifications_content.module \_notifications_content_user_options()
Subscribe / unsubscribe options for specific user
Parameters
$account: User who is subscribing / unsubscribing to
$author: User we are subscribing too
1 call to _notifications_content_user_options()
- notifications_content_notifications in notifications_content/
notifications_content.module - Implementation of hook_notifications()
File
- notifications_content/
notifications_content.module, line 632 - Subscriptions to content events
Code
function _notifications_content_user_options($account, $author) {
$options = array();
// All posts by author
$options[] = array(
'name' => t('All posts by @name', array(
'@name' => $author->name,
)),
'type' => 'author',
'fields' => array(
'author' => $author->uid,
),
);
// Content types with author subscriptions
foreach (notifications_content_types('name', 'typeauthor') as $type => $name) {
$options[] = array(
'name' => t('@type posts by @name', array(
'@name' => $author->name,
'@type' => $name,
)),
'type' => 'typeauthor',
'fields' => array(
'author' => $author->uid,
'type' => $type,
),
);
}
return $options;
}