/** * Group profile page * * @param int $guid Group entity GUID */ function groups_handle_profile_page($guid) { elgg_set_page_owner_guid($guid); // turn this into a core function global $autofeed; $autofeed = true; elgg_push_context('group_profile'); elgg_entity_gatekeeper($guid, 'group'); $group = get_entity($guid); elgg_push_breadcrumb($group->name); groups_register_profile_buttons($group); $content = elgg_view('groups/profile/layout', array('entity' => $group)); $sidebar = ''; if (elgg_group_gatekeeper(false)) { if (elgg_is_active_plugin('search')) { $sidebar .= elgg_view('groups/sidebar/search', array('entity' => $group)); } $sidebar .= elgg_view('groups/sidebar/members', array('entity' => $group)); $subscribed = false; if (elgg_is_active_plugin('notifications')) { $NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal(); foreach ($NOTIFICATION_HANDLERS as $method => $foo) { $relationship = check_entity_relationship(elgg_get_logged_in_user_guid(), 'notify' . $method, $guid); if ($relationship) { $subscribed = true; break; } } } $sidebar .= elgg_view('groups/sidebar/my_status', array('entity' => $group, 'subscribed' => $subscribed)); } $params = array('content' => $content, 'sidebar' => $sidebar, 'title' => $group->name); $body = elgg_view_layout('one_sidebar', $params); echo elgg_view_page($group->name, $body); }
/** * Group profile page * * @param int $guid Group entity GUID */ function groups_handle_profile_page($guid) { elgg_set_page_owner_guid($guid); // turn this into a core function global $autofeed; $autofeed = true; $group = get_entity($guid); if (!$group) { forward('groups/all'); } elgg_push_breadcrumb($group->name); $content = elgg_view('groups/profile/layout', array('entity' => $group)); if (group_gatekeeper(false)) { $sidebar = elgg_view('groups/sidebar/members', array('entity' => $group)); } else { $sidebar = ''; } groups_register_profile_buttons($group); $params = array('content' => $content, 'sidebar' => $sidebar, 'title' => $group->name, 'filter' => ''); $body = elgg_view_layout('content', $params); echo elgg_view_page($group->name, $body); }
<?php $guid = elgg_extract('guid', $vars); // turn this into a core function global $autofeed; $autofeed = true; elgg_entity_gatekeeper($guid, 'group'); $group = get_entity($guid); elgg_push_breadcrumb($group->name); groups_register_profile_buttons($group); $content = elgg_view('groups/profile/layout', array('entity' => $group)); $sidebar = ''; if (elgg_group_gatekeeper(false)) { if (elgg_is_active_plugin('search')) { $sidebar .= elgg_view('groups/sidebar/search', array('entity' => $group)); } $sidebar .= elgg_view('groups/sidebar/members', array('entity' => $group)); $subscribed = false; if (elgg_is_active_plugin('notifications')) { $NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal(); foreach ($NOTIFICATION_HANDLERS as $method => $foo) { $relationship = check_entity_relationship(elgg_get_logged_in_user_guid(), 'notify' . $method, $guid); if ($relationship) { $subscribed = true; break; } } } $sidebar .= elgg_view('groups/sidebar/my_status', array('entity' => $group, 'subscribed' => $subscribed)); } $params = array('content' => $content, 'sidebar' => $sidebar, 'title' => $group->name);
/** * Group profile page * * @param int $guid Group entity GUID */ function groups_handle_profile_page($guid) { elgg_set_page_owner_guid($guid); // turn this into a core function global $autofeed; $autofeed = true; $group = get_entity($guid); if (!$group) { forward('groups/all'); } $content = elgg_view('groups/profile/layout', array('entity' => $group)); $sidebar = ''; if ($group->grouptype == 'local') { $sidebar .= elgg_view('groups/sidebar/localgrouplist', array('group_guid' => $group->getGUID())); } if (group_gatekeeper(false)) { if (elgg_is_active_plugin('search')) { $sidebar .= elgg_view('groups/sidebar/search', array('entity' => $group)); } $sidebar .= elgg_view('groups/sidebar/members', array('entity' => $group)); } groups_register_profile_buttons($group); $params = array('content' => $content, 'sidebar' => $sidebar, 'title' => $group->name, 'filter' => ''); $body = elgg_view_layout('content', $params); echo elgg_view_page($group->name, $body); }
/** * Group profile page * * @param int $guid Group entity GUID */ function groups_handle_profile_page($guid) { elgg_set_page_owner_guid($guid); // turn this into a core function global $autofeed; $autofeed = true; elgg_push_context('group_profile'); elgg_entity_gatekeeper($guid, 'group'); $group = get_entity($guid); elgg_push_breadcrumb($group->name); groups_register_profile_buttons($group); $content = elgg_view('groups/profile/layout', array('entity' => $group)); $sidebar = elgg_view('groups/sidebar/sidebar', array('entity' => $group)); $params = array('content' => $content, 'sidebar' => $sidebar, 'title' => $group->name); $body = elgg_view_layout('one_sidebar', $params); echo elgg_view_page($group->name, $body); }
<?php $guid = elgg_extract('guid', $vars); elgg_entity_gatekeeper($guid, 'group'); $entity = get_entity($guid); elgg_set_page_owner_guid($guid); $identifier = is_callable('group_subtypes_get_identifier') ? group_subtypes_get_identifier($entity) : 'groups'; // pushing context to make it easier to user 'menu:filter' hook elgg_push_context("{$identifier}/profile"); groups_register_profile_buttons($entity); $title = $entity->getDisplayName(); elgg_push_breadcrumb(elgg_echo($identifier), "{$identifier}/all"); elgg_push_breadcrumb($title); $vars = $vars; $vars['entity'] = $entity; $subtype = $entity->getSubtype(); if (elgg_view_exists("profiles/group/{$subtype}")) { $content = elgg_view("profiles/group/{$subtype}", $vars); } else { $content = elgg_view('profiles/group/default', $vars); } $filter = elgg_view('filters/groups/profile', $vars); $sidebar = elgg_view('sidebars/groups/profile', $vars); $layout_vars = array('title' => $title, 'content' => $content, 'filter' => $filter ?: '', 'sidebar' => $sidebar ?: null, 'layout_name' => 'content'); $layout_vars = elgg_trigger_plugin_hook('layout_vars', 'groups_profile', $vars, $layout_vars); $layout_name = elgg_extract('layout_name', $layout_vars, 'content'); unset($layout_vars['layout_name']); $layout = elgg_view_layout($layout_name, $layout_vars); echo elgg_view_page($title, $layout);