function shoutbox_group_page in Shoutbox 7.2
Same name and namespace in other branches
- 6.2 shoutbox_group/shoutbox_group.module \shoutbox_group_page()
- 7 shoutbox_group/shoutbox_group.module \shoutbox_group_page()
Generate dedicated shoutbox page for group
Parameters
$group: The group node whom this shoutbox page belongs to
1 string reference to 'shoutbox_group_page'
- shoutbox_group_menu in shoutbox_group/
shoutbox_group.module - Implementation of hook_menu().
File
- shoutbox_group/
shoutbox_group.module, line 50
Code
function shoutbox_group_page($group) {
// View permissions checked in shoutbox_group_shoutbox_get_shouts()
// Post permissions check in shoutbox_group_form_shoutbox_add_form_alter()
// Check that we're in a real group
if (!og_is_group_type('node', $group->type)) {
return t('The group does not exist');
}
// Tell OG this is a group-specific page
og_context('node', $group);
// Set the page title with group name
drupal_set_title(t('Shout box @title', array(
'@title' => $group->title,
)));
// Set the breadcrumb
drupal_set_breadcrumb(array(
l(t('Home'), '<front>'),
l(t('Groups'), 'groups'),
l($group->title, 'node/' . $group->nid),
));
// Return normal shoutbox page
return shoutbox_view();
}