| @@ 284-333 (lines=50) @@ | ||
| 281 | * |
|
| 282 | * @param int $guid Group entity GUID |
|
| 283 | */ |
|
| 284 | function groups_handle_profile_page($guid) { |
|
| 285 | elgg_set_page_owner_guid($guid); |
|
| 286 | ||
| 287 | // turn this into a core function |
|
| 288 | global $autofeed; |
|
| 289 | $autofeed = true; |
|
| 290 | elgg_push_context('group_profile'); |
|
| 291 | elgg_entity_gatekeeper($guid, 'group'); |
|
| 292 | $group = get_entity($guid); |
|
| 293 | elgg_push_breadcrumb($group->name); |
|
| 294 | groups_register_profile_buttons($group); |
|
| 295 | ||
| 296 | $content = elgg_view('groups/profile/layout', array('entity' => $group)); |
|
| 297 | $sidebar = ''; |
|
| 298 | ||
| 299 | if (elgg_group_gatekeeper(false)) { |
|
| 300 | if (elgg_is_active_plugin('search')) { |
|
| 301 | $sidebar .= elgg_view('groups/sidebar/search', array('entity' => $group)); |
|
| 302 | } |
|
| 303 | $sidebar .= elgg_view('groups/sidebar/members', array('entity' => $group)); |
|
| 304 | ||
| 305 | $subscribed = false; |
|
| 306 | if (elgg_is_active_plugin('notifications')) { |
|
| 307 | $NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal(); |
|
| 308 | foreach ($NOTIFICATION_HANDLERS as $method => $foo) { |
|
| 309 | $relationship = check_entity_relationship(elgg_get_logged_in_user_guid(), |
|
| 310 | 'notify' . $method, $guid); |
|
| 311 | ||
| 312 | if ($relationship) { |
|
| 313 | $subscribed = true; |
|
| 314 | break; |
|
| 315 | } |
|
| 316 | } |
|
| 317 | } |
|
| 318 | ||
| 319 | $sidebar .= elgg_view('groups/sidebar/my_status', array( |
|
| 320 | 'entity' => $group, |
|
| 321 | 'subscribed' => $subscribed |
|
| 322 | )); |
|
| 323 | } |
|
| 324 | ||
| 325 | $params = array( |
|
| 326 | 'content' => $content, |
|
| 327 | 'sidebar' => $sidebar, |
|
| 328 | 'title' => $group->name, |
|
| 329 | ); |
|
| 330 | $body = elgg_view_layout('one_sidebar', $params); |
|
| 331 | ||
| 332 | echo elgg_view_page($group->name, $body); |
|
| 333 | } |
|
| 334 | ||
| 335 | /** |
|
| 336 | * Group activity page |
|
| @@ 275-329 (lines=55) @@ | ||
| 272 | * |
|
| 273 | * @param int $guid Group entity GUID |
|
| 274 | */ |
|
| 275 | function groups_handle_profile_page($guid) { |
|
| 276 | elgg_set_page_owner_guid($guid); |
|
| 277 | ||
| 278 | // turn this into a core function |
|
| 279 | global $autofeed; |
|
| 280 | $autofeed = true; |
|
| 281 | ||
| 282 | elgg_push_context('group_profile'); |
|
| 283 | ||
| 284 | elgg_entity_gatekeeper($guid, 'group'); |
|
| 285 | ||
| 286 | $group = get_entity($guid); |
|
| 287 | ||
| 288 | elgg_push_breadcrumb($group->name); |
|
| 289 | ||
| 290 | groups_register_profile_buttons($group); |
|
| 291 | ||
| 292 | $content = elgg_view('groups/profile/layout', array('entity' => $group)); |
|
| 293 | $sidebar = ''; |
|
| 294 | ||
| 295 | if (elgg_group_gatekeeper(false)) { |
|
| 296 | if (elgg_is_active_plugin('search')) { |
|
| 297 | $sidebar .= elgg_view('groups/sidebar/search', array('entity' => $group)); |
|
| 298 | } |
|
| 299 | $sidebar .= elgg_view('groups/sidebar/members', array('entity' => $group)); |
|
| 300 | ||
| 301 | $subscribed = false; |
|
| 302 | if (elgg_is_active_plugin('notifications')) { |
|
| 303 | $NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal(); |
|
| 304 | foreach ($NOTIFICATION_HANDLERS as $method => $foo) { |
|
| 305 | $relationship = check_entity_relationship(elgg_get_logged_in_user_guid(), |
|
| 306 | 'notify' . $method, $guid); |
|
| 307 | ||
| 308 | if ($relationship) { |
|
| 309 | $subscribed = true; |
|
| 310 | break; |
|
| 311 | } |
|
| 312 | } |
|
| 313 | } |
|
| 314 | ||
| 315 | $sidebar .= elgg_view('groups/sidebar/my_status', array( |
|
| 316 | 'entity' => $group, |
|
| 317 | 'subscribed' => $subscribed |
|
| 318 | )); |
|
| 319 | } |
|
| 320 | ||
| 321 | $params = array( |
|
| 322 | 'content' => $content, |
|
| 323 | 'sidebar' => $sidebar, |
|
| 324 | 'title' => $group->name, |
|
| 325 | ); |
|
| 326 | $body = elgg_view_layout('one_sidebar', $params); |
|
| 327 | ||
| 328 | echo elgg_view_page($group->name, $body); |
|
| 329 | } |
|
| 330 | ||
| 331 | /** |
|
| 332 | * Group activity page |
|