Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
fix(pages): move group wall page to a resource view
Browse files Browse the repository at this point in the history
  • Loading branch information
hypeJunction committed Jan 20, 2016
1 parent f6bc4cb commit 092e5f1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
29 changes: 3 additions & 26 deletions classes/hypeJunction/Wall/Router.php
Expand Up @@ -58,33 +58,10 @@ public function handlePages($segments) {

case 'group' :
case 'container' :
$guid = elgg_extract(1, $segments);

elgg_entity_gatekeeper($guid);

$group = get_entity($guid);

elgg_set_page_owner_guid($group->guid);

$name = elgg_instanceof($group, 'object') ? $group->title : $group->name;
$title = elgg_echo('wall:owner', array($name));
elgg_push_breadcrumb($title, $this->normalize($segments[0], $group->guid));

if (isset($segments[2])) {
elgg_entity_gatekeeper($page[2]);
$post = get_entity($page[2]);
}

$content = elgg_view("framework/wall/group", array(
'post' => $post,
));

$layout = elgg_view_layout('content', array(
'title' => $title,
'content' => $content,
'filter' => false,
echo elgg_view('resources/wall/group', array(
'group_guid' => elgg_extract(1, $segments),
'post_guid' => elgg_extract(2, $segments),
));
echo elgg_view_page($title, $layout);
return true;
}

Expand Down
29 changes: 29 additions & 0 deletions views/default/resources/wall/group.php
@@ -0,0 +1,29 @@
<?php

$group_guid = elgg_extract('group_guid', $vars);
$post_guid = elgg_extract('post_guid', $vars);

elgg_entity_gatekeeper($group_guid);
elgg_group_gatekeeper(true, $group_guid);

$group = get_entity($group_guid);
$post = get_entity($post_guid);

elgg_set_page_owner_guid($group->guid);

$name = elgg_instanceof($group, 'object') ? $group->title : $group->name;
$title = elgg_echo('wall:owner', array($name));
elgg_push_breadcrumb($title, hypeWall()->router->normalize('group', $group->guid));

$content = elgg_view("framework/wall/group", array(
'group' => $group,
'post' => $post,
));

$layout = elgg_view_layout('content', array(
'title' => $title,
'content' => $content,
'filter' => false,
));

echo elgg_view_page($title, $layout);

0 comments on commit 092e5f1

Please sign in to comment.