function og_notifications_menu in Organic groups 5.8
Same name and namespace in other branches
- 5 og_notifications/og_notifications.module \og_notifications_menu()
- 5.3 og_notifications/og_notifications.module \og_notifications_menu()
- 5.7 og_notifications/og_notifications.module \og_notifications_menu()
- 6.2 modules/og_notifications/og_notifications.module \og_notifications_menu()
- 6 modules/og_notifications/og_notifications.module \og_notifications_menu()
Implementation of hook_menu().
File
- og_notifications/
og_notifications.module, line 25 - Provide notifications and messaging support for organic groups.
Code
function og_notifications_menu($may_cache) {
global $user;
$items = array();
if (!$may_cache) {
if ($user->uid && arg(0) == 'user' && is_numeric(arg(1)) && arg(2) == 'notifications' && ($user->uid == arg(1) || user_access('administer notifications'))) {
$account = $user->uid == arg(1) ? $user : user_load(array(
'uid' => arg(1),
));
$items[] = array(
'path' => 'user/' . $account->uid . '/notifications/group',
'access' => user_access('subscribe to content in groups'),
'title' => t('Groups'),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'og_notifications_user_page',
$account,
),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
// grouptype redirects to group.
$items[] = array(
'path' => 'user/' . $account->uid . '/notifications/grouptype',
'access' => user_access('subscribe to content in groups'),
'callback' => 'og_notifications_grouptype_user_page',
'callback arguments' => array(
$account,
),
'type' => MENU_CALLBACK,
);
}
}
return $items;
}