aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/start.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-04 04:43:26 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-04 04:43:26 +0000
commit4e80e365f054dea55bd481cbebd7af5fed7bb288 (patch)
treefa8ce71532292f0d37cca4651607125c4e453654 /mod/blog/start.php
parent719146b6449c1241f70caed2ddb520ce8fbd6da3 (diff)
downloadelgg-4e80e365f054dea55bd481cbebd7af5fed7bb288.tar.gz
elgg-4e80e365f054dea55bd481cbebd7af5fed7bb288.tar.bz2
a better main content view structure
git-svn-id: http://code.elgg.org/elgg/trunk@7525 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/blog/start.php')
-rw-r--r--mod/blog/start.php35
1 files changed, 12 insertions, 23 deletions
diff --git a/mod/blog/start.php b/mod/blog/start.php
index b279de1a3..0d0c58ac8 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -92,13 +92,13 @@ function blog_runonce() {
function blog_page_handler($page) {
global $CONFIG;
+ // push breadcrumb
+ elgg_push_breadcrumb(elgg_echo('blog:blogs'), "pg/blog");
+
// see if we're showing all or just a user's
if (isset($page[0]) && !empty($page[0])) {
$username = $page[0];
- // push breadcrumb
- elgg_push_breadcrumb(elgg_echo('blog:blogs'), "pg/blog");
-
// forward away if invalid user.
if (!$user = get_user_by_username($username)) {
register_error('blog:error:unknown_username');
@@ -118,24 +118,24 @@ function blog_page_handler($page) {
switch ($action) {
case 'read':
$title = elgg_echo('blog:title:user_blogs', array($user->name));
- $content_info = blog_get_page_content_read($user->getGUID(), $page2);
+ $params = blog_get_page_content_read($user->getGUID(), $page2);
break;
case 'new':
case 'edit':
gatekeeper();
$title = elgg_echo('blog:edit');
- $content_info = blog_get_page_content_edit($page2, $page3);
+ $params = blog_get_page_content_edit($page2, $page3);
break;
case 'archive':
$title = elgg_echo('blog:archives');
- $content_info = blog_get_page_content_archive($user->getGUID(), $page2, $page3);
+ $params = blog_get_page_content_archive($user->getGUID(), $page2, $page3);
break;
case 'friends':
$title = elgg_echo('blog:title:friends');
- $content_info = blog_get_page_content_friends($user->getGUID());
+ $params = blog_get_page_content_friends($user->getGUID());
break;
default:
@@ -144,27 +144,16 @@ function blog_page_handler($page) {
}
} else {
$title = elgg_echo('blog:title:all_blogs');
- $content_info = blog_get_page_content_read();
+ $params = blog_get_page_content_read();
}
- $sidebar = isset($content_info['sidebar']) ? $content_info['sidebar'] : '';
-
- $sidebar .= elgg_view('blog/sidebar_menu', array(
+ $sidebar_menu = elgg_view('blog/sidebar_menu', array(
'page' => isset($page[1]) ? $page[1] : FALSE,
));
- $content = elgg_view('navigation/breadcrumbs');
- $params = array(
- 'header' => $content_info['header'],
- 'body' => $content_info['body'],
- );
- $content .= elgg_view('page_elements/main_module', $params);
-
- $params = array(
- 'content' => $content,
- 'sidebar' => $sidebar,
- );
- $body = elgg_view_layout('one_column_with_sidebar', $params);
+ $params['sidebar'] .= $sidebar_menu;
+
+ $body = elgg_view_layout('main_content', $params);
echo elgg_view_page($title, $body);
}