diff --git a/og.module b/og.module index f2e3de7..b6453ea 100644 --- a/og.module +++ b/og.module @@ -2619,14 +2619,15 @@ function og_block_new() { } /** - * Content for Group Details block. + * Create the links for the group details block. + * */ -function og_block_details() { +function og_details_links() { global $user; - // Only display group details if we have a group context. + $links = array(); + // Only display the group details links if we have a group context. if (($node = og_get_group_context()) && node_access('view', $node)) { - $account = user_load($node->uid); list($txt, $subscription) = og_subscriber_count_link($node); if ($subscription == 'active' || user_access('administer nodes')) { $links = module_invoke_all('og_create_links', $node); @@ -2635,10 +2636,10 @@ function og_block_details() { $links['invite'] = l(t('Invite friend'), "og/invite/$node->nid"); } $links['subscribers'] = $txt; - $links['manager'] = t('Manager: !name', array('!name' => theme('username', $account))); + $links['manager'] = t('Manager: !name', array('!name' => theme('username', $node))); // Site admins get a Join link if they are not yet subscribed. - $subscribe = isset($subscription) && og_is_group_member($node->nid, FALSE) ? l(t('My membership'), "og/manage/$node->nid") : theme('og_subscribe_link', $node); + $subscribe = isset($subscription) && og_is_group_member($node->nid, FALSE) ? l(t('My membership'), "og/manage/$node->nid") : og_subscribe_link($node); if(isset($subscribe)) { $links['my_membership'] = $subscribe; } @@ -2657,7 +2658,7 @@ function og_block_details() { } } elseif ($node->og_selective < OG_INVITE_ONLY) { - $links['subscribe'] = theme('og_subscribe_link', $node); + $links['subscribe'] = og_subscribe_link($node); } elseif ($node->og_selective == OG_INVITE_ONLY) { $links['closed'] = t('This is an invite only group. The group administrators add/remove members as needed.'); @@ -2668,7 +2669,17 @@ function og_block_details() { // Modify these links by reference. If you want control of the whole block, see og_block_details(). drupal_alter('og_links', $links, $node); + } + return $links; +} +/** + * Content for Group Details block. + */ +function og_block_details() { + // Only display group details if we have a group context. + if (($node = og_get_group_context()) && node_access('view', $node)) { + $links = og_details_links(); $block['content'] = theme('item_list', $links); $block['subject'] = l($node->title, "node/$node->nid"); return $block;