Permalink
Browse files

feature(routing): Use the views system to render the index page

This makes it much easier to override. There is no need to
register a page handler and remember to `return true`. Instead,
just override the `resources/index` view.
  • Loading branch information...
ewinslow committed Dec 5, 2014
1 parent 6a4d6d0 commit f1b75bbeffa582f4933f5445d6cb90db2ee67387
Showing with 23 additions and 20 deletions.
  1. +1 −20 engine/lib/pagehandler.php
  2. +22 −0 views/default/resources/index.php
View
@@ -212,26 +212,7 @@ function elgg_entity_gatekeeper($guid, $type = null, $subtype = null) {
* @return bool
*/
function elgg_front_page_handler() {
if (elgg_is_logged_in()) {
forward('activity');
}
$title = elgg_echo('content:latest');
$content = elgg_list_river();
if (!$content) {
$content = elgg_echo('river:none');
}
$login_box = elgg_view('core/account/login_box');
$params = array(
'title' => $title,
'content' => $content,
'sidebar' => $login_box
);
$body = elgg_view_layout('one_sidebar', $params);
echo elgg_view_page(null, $body);
echo elgg_view('resources/index');
return true;
}
@@ -0,0 +1,22 @@
<?php
if (elgg_is_logged_in()) {
forward('activity');
}
$title = elgg_echo('content:latest');
$content = elgg_list_river();
if (!$content) {
$content = elgg_echo('river:none');
}
$login_box = elgg_view('core/account/login_box');
$params = array(
'title' => $title,
'content' => $content,
'sidebar' => $login_box
);
$body = elgg_view_layout('one_sidebar', $params);
echo elgg_view_page(null, $body);

0 comments on commit f1b75bb

Please sign in to comment.