function blog_get_page_content_read($owner_guid = NULL, $guid = NULL) {
global $CONFIG;
+ $return = array();
+
if ($guid) {
$blog = get_entity($guid);
if (!elgg_instanceof($blog, 'object', 'blog') || ($blog->status != 'published' && !$blog->canEdit())) {
- $content = elgg_echo('blog:error:post_not_found');
+ $return['body'] = elgg_echo('blog:error:post_not_found');
} else {
elgg_push_breadcrumb($blog->title, $blog->getURL());
- $content = elgg_view_entity($blog, TRUE);
+ $return['body'] = elgg_view_entity($blog, TRUE);
//check to see if comment are on
if ($blog->comments_on != 'Off') {
- $content .= elgg_view_comments($blog);
+ $return['body'] .= elgg_view_comments($blog);
}
}
} else {
- $content = elgg_view('page_elements/content_header', array(
- 'context' => $owner_guid ? 'mine' : 'everyone',
+
+ $params = array(
+ 'type' => 'blog',
+ );
+ $return['header'] = elgg_view('page_elements/main_header', $params);
+
+ $params = array(
'type' => 'blog',
- 'all_link' => "pg/blog"
- ));
+ 'context' => $owner_guid ? 'mine' : 'everyone',
+ );
+ $return['body'] = elgg_view('page_elements/main_nav', $params);
$options = array(
'type' => 'object',
//'order_by_metadata' => array('name'=>'publish_date', 'direction'=>'DESC', 'as'=>'int')
);
+/*
$loggedin_userid = get_loggedin_userid();
if ($owner_guid) {
$options['owner_guid'] = $owner_guid;
$content = elgg_view('page_elements/content_header_member', array('type' => 'blog'));
}
}
+ *
+ */
+/*
// show all posts for admin or users looking at their own blogs
// show only published posts for other users.
if (!(isadminloggedin() || (isloggedin() && $owner_guid == $loggedin_userid))) {
//array('name' => 'publish_date', 'operand' => '<', 'value' => time())
);
}
+*/
$list = elgg_list_entities_from_metadata($options);
if (!$list) {
- $content .= elgg_echo('blog:none');
+ $return['body'] .= elgg_echo('blog:none');
} else {
- $content .= $list;
+ $return['body'] .= $list;
}
}
- return array('content' => $content);
+ return $return;
}
/**
//$sidebar = elgg_view('blog/sidebar_related');
}
- return array('content' => $content, 'sidebar' => $sidebar);
+ return array('body' => $content, 'sidebar' => $sidebar);
}
/**
'page' => isset($page[1]) ? $page[1] : FALSE,
));
- $content = elgg_view('navigation/breadcrumbs') . $content_info['content'];
+ $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,
GENERIC SELECTORS
*************************************** */
h2 {
- border-bottom:1px solid #CCCCCC;
+/* border-bottom:1px solid #CCCCCC; */
padding-bottom:5px;
}
height:24px;
z-index: 9000;
}
-.elgg-header {
+.elgg-page > .elgg-header {
x-overflow: hidden;
position: relative;
width: 100%;
width: 730px;
}
+.elgg-module {
+}
+.elgg-module-heading {
+ float: left;
+ max-width: 530px;
+ margin-right: 10px;
+}
+
+.elgg-maincontent-header {
+ border-bottom: 1px solid #CCCCCC;
+ padding-bottom: 3px;
+}
/* ***************************************
ELGG TOPBAR
/**
* Elgg module layout
*
- * @uses $vars['header'] HTML content of the header
- * @uses $vars['body'] HTML content of the body
- * @uses $vars['footer'] HTML content of the footer
- * @uses $vars['class'] Optional additional class for module
+ * @uses $vars['header'] HTML content of the header
+ * @uses $vars['body'] HTML content of the body
+ * @uses $vars['footer'] HTML content of the footer
+ * @uses $vars['class'] Optional additional class for module
+ * @uses $vars['header_class'] Optional additional class for header
*/
$header = elgg_get_array_value('header', $vars, '');
$class = "$class $additional_class";
}
+$header_class = 'elgg-header';
+$additional_class = elgg_get_array_value('header_class', $vars, '');
+if ($additional_class) {
+ $header_class = "$header_class $additional_class";
+}
+
if ($header) {
- $header = "<div class=\"elgg-header\">$header</div>";
+ $header = "<div class=\"$header_class\">$header</div>";
}
if ($footer) {
<div class="$class">
<div class="elgg-inner">
$header
- <div class="elgg-body">
- $body
- </div>
+ <div class="elgg-body">$body</div>
$footer
</div>
</div>
--- /dev/null
+<?php
+/**
+ * Header for main module
+ *
+ * @uses string $vars['type'] The section type. Should be the same as the page handler. Used for generating URLs.
+ */
+
+$type = $vars['type'];
+$username = get_loggedin_user()->username;
+
+$title = elgg_echo($type);
+
+$new_button = '';
+if (isloggedin()) {
+ $new_link = elgg_get_array_value('new_link', $vars, "pg/$type/$username/new");
+ $params = array(
+ 'href' => $new_link = elgg_normalize_url($new_link),
+ 'text' => elgg_echo("$type:new"),
+ 'class' => 'action-button right',
+ );
+ $new_button = elgg_view('output/url', $params);
+}
+
+echo <<<HTML
+<h2 class="elgg-module-heading">$title</h2>
+$new_button
+HTML;
--- /dev/null
+<?php
+
+$vars['class'] = 'elgg-module-maincontent';
+$vars['header_class'] = 'elgg-maincontent-header clearfix';
+echo elgg_view_layout('module', $vars);
\ No newline at end of file
--- /dev/null
+<?php
+
+// page handler type
+$type = $vars['type'];
+
+$username = get_loggedin_user()->username;
+
+// so we know if the user is looking at their own, everyone's or all friends
+$filter_context = $vars['context'];
+
+// generate a list of default tabs
+$default_tabs = array(
+ 'all' => array(
+ 'title' => elgg_echo('all'),
+ 'url' => (isset($vars['all_link'])) ? $vars['all_link'] : "pg/$type/",
+ 'selected' => ($filter_context == 'everyone'),
+ ),
+ 'mine' => array(
+ 'title' => elgg_echo('mine'),
+ 'url' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "pg/$type/$username",
+ 'selected' => ($filter_context == 'mine'),
+ ),
+ 'friend' => array(
+ 'title' => elgg_echo('friends'),
+ 'url' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "pg/$type/$username/friends",
+ 'selected' => ($filter_context == 'friends'),
+ ),
+);
+
+// determine if using default or overwritten tabs
+$tabs = elgg_get_array_value('tabs', $vars, $default_tabs);
+echo elgg_view('navigation/tabs', array('tabs' => $tabs));
\ No newline at end of file