aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt6
-rw-r--r--engine/lib/elgglib.php48
-rw-r--r--mod/bookmarks/add.php29
-rw-r--r--mod/bookmarks/index.php28
-rw-r--r--mod/groups/forum.php31
-rw-r--r--mod/groups/views/default/forms/forums/addtopic.php56
-rw-r--r--mod/groups/views/default/forum/viewposts.php77
-rw-r--r--mod/messages/views/default/messages/messages.php81
-rw-r--r--views/default/navigation/breadcrumbs.php45
-rw-r--r--views/default/page_elements/breadcrumbs.php26
-rw-r--r--views/default/page_elements/content_header.php41
11 files changed, 263 insertions, 205 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 8e0af58b3..d4f5507dc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,7 +2,11 @@ Version 1.8.0
(??? from http://code.elgg.org/branches/1.8/)
API changes:
- * added elgg_instanceof().
+ * Added elgg_instanceof().
+
+ UI/UX
+ * Added elgg_push_breadcrumb(), elgg_pop_breadcrumb(), and elgg_get_breadcrumbs().
+ * Added navigation/breadcrumbs.
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 42d6ffc6f..fd270bc1d 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2661,6 +2661,54 @@ function elgg_http_add_url_query_elements($url, array $elements) {
return $string;
}
+
+/**
+ * Breadcrumb support.
+ */
+
+/**
+ * Adds a breadcrumb to the stack
+ *
+ * @param string $title The title to display
+ * @param string $link Optional. The link for the title.
+ */
+function elgg_push_breadcrumb($title, $link = NULL) {
+ global $CONFIG;
+ if (!is_array($CONFIG->breadcrumbs)) {
+ $CONFIG->breadcrumbs = array();
+ }
+
+ // avoid key collisions.
+ $CONFIG->breadcrumbs[] = array('title' => $title, 'link' => $link);
+}
+
+/**
+ * Removes last breadcrumb entry.
+ *
+ * @return array popped item.
+ */
+function elgg_pop_breadcrumb() {
+ global $CONFIG;
+
+ if (is_array($CONFIG->breadcrumbs)) {
+ array_pop($CONFIG->breadcrumbs);
+ }
+
+ return FALSE;
+}
+
+/**
+ * Returns all breadcrumbs
+ *
+ * @return array Breadcrumbs
+ */
+function elgg_get_breadcrumbs() {
+ global $CONFIG;
+
+ return (is_array($CONFIG->breadcrumbs)) ? $CONFIG->breadcrumbs : array();
+}
+
+
/**
* Returns the PHP INI setting in bytes
*
diff --git a/mod/bookmarks/add.php b/mod/bookmarks/add.php
index 6f4ca7889..e5bc67a1a 100644
--- a/mod/bookmarks/add.php
+++ b/mod/bookmarks/add.php
@@ -1,7 +1,7 @@
<?php
/**
* Elgg bookmarks plugin add bookmark page
- *
+ *
* @package ElggBookmarks
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider <info@elgg.com>
@@ -13,10 +13,10 @@ global $CONFIG;
// Start engine
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
+
// You need to be logged in for this one
gatekeeper();
-
+
// Get the current page's owner
$page_owner = page_owner_entity();
if ($page_owner === false || is_null($page_owner)) {
@@ -25,17 +25,16 @@ if ($page_owner === false || is_null($page_owner)) {
}
if ($page_owner instanceof ElggGroup)
$container = $page_owner->guid;
-
+
//set up breadcrumbs
-$area1 .= elgg_view('page_elements/breadcrumbs', array(
- 'breadcrumb_root_url' => $CONFIG->wwwroot."mod/bookmarks/all.php",
- 'breadcrumb_root_text' => elgg_echo('bookmarks:all'),
- 'breadcrumb_currentpage' => elgg_echo("bookmarks:add")
- ));
-
+elgg_push_breadcrumb(elgg_echo('bookmarks:all'), $CONFIG->wwwroot."mod/bookmarks/all.php");
+elgg_push_breadcrumb(elgg_echo("bookmarks:add"));
+
+$area1 .= elgg_view('navigation/breadcrumbs');
+
// get the filter menu
$area1 .= elgg_view('page_elements/content_header', array('context' => "action", 'type' => 'bookmarks'));
-
+
// If we've been given a bookmark to edit, grab it
if ($this_guid = get_input('bookmark',0)) {
$entity = get_entity($this_guid);
@@ -48,12 +47,12 @@ if ($this_guid = get_input('bookmark',0)) {
$area3 = elgg_view('bookmarks/ownerblock');
// if logged in, get the bookmarklet
-$area3 .= elgg_view("bookmarks/bookmarklet");
+$area3 .= elgg_view("bookmarks/bookmarklet");
//include a view for plugins to extend
-$area3 .= elgg_view("bookmarks/sidebar_options", array("object_type" => 'bookmarks'));
-
+$area3 .= elgg_view("bookmarks/sidebar_options", array("object_type" => 'bookmarks'));
+
// Format page
$body = elgg_view_layout('one_column_with_sidebar', $area1.$area2, $area3);
-
+
// Draw it
echo page_draw(elgg_echo('bookmarks:add'),$body); \ No newline at end of file
diff --git a/mod/bookmarks/index.php b/mod/bookmarks/index.php
index baff805bf..55f854121 100644
--- a/mod/bookmarks/index.php
+++ b/mod/bookmarks/index.php
@@ -1,7 +1,7 @@
<?php
/**
* Elgg bookmarks plugin index page
- *
+ *
* @package ElggBookmarks
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider <info@elgg.com>
@@ -19,20 +19,18 @@ if ($page_owner === false || is_null($page_owner)) {
$page_owner = $_SESSION['user'];
set_page_owner($page_owner->getGUID());
}
-
+
+elgg_push_breadcrumb(elgg_echo('bookmarks:all'), $CONFIG->wwwroot."mod/bookmarks/all.php");
+elgg_push_breadcrumb(sprintf(elgg_echo("bookmarks:user"),$page_owner->name));
+
//set bookmarks header
-if(page_owner()== get_loggedin_user()->guid){
+if(page_owner() == get_loggedin_userid()) {
$area1 .= elgg_view('page_elements/content_header', array('context' => "own", 'type' => 'bookmarks'));
-}else{
- $area1 .= elgg_view('page_elements/breadcrumbs', array(
- 'breadcrumb_root_url' => $CONFIG->wwwroot."mod/bookmarks/all.php",
- 'breadcrumb_root_text' => elgg_echo('bookmarks:all'),
- 'breadcrumb_currentpage' => sprintf(elgg_echo("bookmarks:user"),$page_owner->name)
- ));
-
+} else {
+ $area1 .= elgg_view('navigation/breadcrumbs');
$area1 .= elgg_view('page_elements/content_header_member', array('type' => 'bookmarks'));
}
-
+
// List bookmarks
set_context('search');
$bookmarks = list_entities('object','bookmarks',page_owner());
@@ -44,16 +42,16 @@ set_context('bookmarks');
//if the logged in user is not looking at their stuff, display the ownerblock
if(page_owner() != get_loggedin_user()->guid){
$area3 = elgg_view('bookmarks/ownerblock');
-}else{
+}else{
if(isloggedin()){
// if logged in, get the bookmarklet
$area3 .= elgg_view("bookmarks/bookmarklet");
- }
+ }
}
//include a view for plugins to extend
-$area3 .= elgg_view("bookmarks/sidebar_options", array("object_type" => 'bookmarks'));
+$area3 .= elgg_view("bookmarks/sidebar_options", array("object_type" => 'bookmarks'));
// Format page
$body = elgg_view_layout('one_column_with_sidebar', $area1.$area2, $area3);
-
+
// Draw it
echo page_draw(sprintf(elgg_echo("bookmarks:user"),page_owner_entity()->name), $body); \ No newline at end of file
diff --git a/mod/groups/forum.php b/mod/groups/forum.php
index 12c84adb5..f59c3ed30 100644
--- a/mod/groups/forum.php
+++ b/mod/groups/forum.php
@@ -1,7 +1,7 @@
<?php
/**
* Elgg groups forum
- *
+ *
* @package ElggGroups
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider
@@ -10,32 +10,27 @@
*/
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
+
set_page_owner((int)get_input('group_guid'));
if (!(page_owner_entity() instanceof ElggGroup)) forward();
-
+
group_gatekeeper();
-
- //get any forum topics
+
//get any forum topics
$topics = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 20, 0, get_input('group_guid'), false, false, false);
- set_context('search');
-
- //set up breadcrumbs
- $area1 = elgg_view('page_elements/breadcrumbs', array(
- 'breadcrumb_root_url' => '',
- 'breadcrumb_root_text' => 'Parent Group Name',
- 'breadcrumb_currentpage' => elgg_echo('item:object:groupforumtopic')
- ));
-
-
+ set_context('search');
+
+ // set up breadcrumbs
+ elgg_push_breadcrumb('Parent Group Name');
+ elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'));
+
$area1 .= elgg_view("forum/topics", array('topics' => $topics));
set_context('groups');
-
+
$body = elgg_view_layout('one_column_with_sidebar', $area1);
-
+
$title = elgg_echo('item:object:groupforumtopic');
-
+
// Finally draw the page
page_draw($title, $body);
diff --git a/mod/groups/views/default/forms/forums/addtopic.php b/mod/groups/views/default/forms/forums/addtopic.php
index 37075aa6d..e3bc3e1c6 100644
--- a/mod/groups/views/default/forms/forums/addtopic.php
+++ b/mod/groups/views/default/forms/forums/addtopic.php
@@ -1,13 +1,13 @@
<?php
/**
* Elgg Groups topic edit/add page
- *
+ *
* @package ElggGroups
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider <info@elgg.com>
* @copyright Curverider Ltd 2008-2010
* @link http://elgg.com/
- *
+ *
* @uses $vars['object'] Optionally, the topic to edit
*/
@@ -20,22 +20,20 @@
$message_id = "";
$status = "";
$access_id = ACCESS_DEFAULT;
-
- // get the group guid
- $group_guid = (int) get_input('group_guid');
-
- // set breadcrumbs
- echo elgg_view('page_elements/breadcrumbs', array(
- 'breadcrumb_root_url' => '',
- 'breadcrumb_root_text' => 'Parent Group Name',
- 'breadcrumb_level1_url' => '#',
- 'breadcrumb_level1_text' => elgg_echo('item:object:groupforumtopic'),
- 'breadcrumb_currentpage' => elgg_echo("groups:addtopic")
- ));
-
+
+ // get the group guid
+ $group_guid = (int) get_input('group_guid');
+
+ // set breadcrumbs
+ elgg_push_breadcrumb('', 'Parent Group Name');
+ elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), '');
+ elgg_push_breadcrumb(elgg_echo("groups:addtopic"));
+
+ echo elgg_view('navigation/breadcrumbs');
+
// set the title
echo elgg_view_title(elgg_echo("groups:addtopic"));
-
+
?>
<!-- display the input form -->
<form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" method="post" class="margin_top">
@@ -44,7 +42,7 @@
<p>
<label><?php echo elgg_echo("title"); ?><br />
<?php
- //display the topic title input
+ //display the topic title input
echo elgg_view("input/text", array(
"internalname" => "topictitle",
"value" => $title,
@@ -52,7 +50,7 @@
?>
</label>
</p>
-
+
<!-- display the tag input -->
<p>
<label><?php echo elgg_echo("tags"); ?><br />
@@ -62,11 +60,11 @@
"internalname" => "topictags",
"value" => $tags,
));
-
+
?>
</label>
</p>
-
+
<!-- topic message input -->
<p class="longtext_editarea">
<label><?php echo elgg_echo("groups:topicmessage"); ?><br />
@@ -79,17 +77,17 @@
?>
</label>
</p>
-
+
<!-- set the topic status -->
<p>
- <label><?php echo elgg_echo("groups:topicstatus"); ?><br />
- <select name="status">
- <option value="open" <?php if($status == "") echo "SELECTED";?>><?php echo elgg_echo('groups:topicopen'); ?></option>
- <option value="closed" <?php if($status == "closed") echo "SELECTED";?>><?php echo elgg_echo('groups:topicclosed'); ?></option>
- </select>
- </label>
+ <label><?php echo elgg_echo("groups:topicstatus"); ?><br />
+ <select name="status">
+ <option value="open" <?php if($status == "") echo "SELECTED";?>><?php echo elgg_echo('groups:topicopen'); ?></option>
+ <option value="closed" <?php if($status == "closed") echo "SELECTED";?>><?php echo elgg_echo('groups:topicclosed'); ?></option>
+ </select>
+ </label>
</p>
-
+
<!-- access -->
<p>
<label>
@@ -97,7 +95,7 @@
<?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?>
</label>
</p>
-
+
<!-- required hidden info and submit button -->
<p>
<input type="hidden" name="group_guid" value="<?php echo $group_guid; ?>" />
diff --git a/mod/groups/views/default/forum/viewposts.php b/mod/groups/views/default/forum/viewposts.php
index efb7e595c..02ed06b62 100644
--- a/mod/groups/views/default/forum/viewposts.php
+++ b/mod/groups/views/default/forum/viewposts.php
@@ -1,8 +1,8 @@
<?php
- /**
+ /**
* Elgg groups plugin display topic posts
- *
+ *
* @package ElggGroups
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider
@@ -10,55 +10,48 @@
* @link http://elgg.com/
*/
-?>
+ elgg_push_breadcrumb('', 'Parent Group Name');
+ elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), '');
+ elgg_push_breadcrumb($vars['entity']->title);
-<?php
- echo elgg_view('page_elements/breadcrumbs', array(
- 'breadcrumb_root_url' => '',
- 'breadcrumb_root_text' => 'Parent Group Name',
- 'breadcrumb_level1_url' => '#',
- 'breadcrumb_level1_text' => elgg_echo('item:object:groupforumtopic'),
- 'breadcrumb_currentpage' => $vars['entity']->title
- ));
+ echo elgg_view('navigation/breadcrumbs');
-
+ //display follow up comments
+ $count = $vars['entity']->countAnnotations('group_topic_post');
+ $offset = (int) get_input('offset',0);
- //display follow up comments
- $count = $vars['entity']->countAnnotations('group_topic_post');
- $offset = (int) get_input('offset',0);
-
- $baseurl = $vars['url'] . "mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$vars['entity']->container_guid}";
- echo elgg_view('navigation/pagination',array(
- 'limit' => 50,
- 'offset' => $offset,
- 'baseurl' => $baseurl,
- 'count' => $count,
- ));
+ $baseurl = $vars['url'] . "mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$vars['entity']->container_guid}";
+ echo elgg_view('navigation/pagination',array(
+ 'limit' => 50,
+ 'offset' => $offset,
+ 'baseurl' => $baseurl,
+ 'count' => $count,
+ ));
?>
<!-- grab the topic title -->
<h2><?php echo $vars['entity']->title; ?></h2>
<?php
-
- foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) {
-
- echo elgg_view("forum/topicposts",array('entity' => $post));
-
+
+ foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) {
+
+ echo elgg_view("forum/topicposts",array('entity' => $post));
+
}
-
+
// check to find out the status of the topic and act
- if($vars['entity']->status != "closed" && page_owner_entity()->isMember($vars['user'])){
-
- //display the add comment form, this will appear after all the existing comments
- echo elgg_view("forms/forums/addpost", array('entity' => $vars['entity']));
-
- } elseif($vars['entity']->status == "closed") {
-
- //this topic has been closed by the owner
- echo "<h2>" . elgg_echo("groups:topicisclosed") . "</h2>";
- echo "<p>" . elgg_echo("groups:topiccloseddesc") . "</p>";
-
- } else {
- }
+ if($vars['entity']->status != "closed" && page_owner_entity()->isMember($vars['user'])){
+
+ //display the add comment form, this will appear after all the existing comments
+ echo elgg_view("forms/forums/addpost", array('entity' => $vars['entity']));
+
+ } elseif($vars['entity']->status == "closed") {
+
+ //this topic has been closed by the owner
+ echo "<h2>" . elgg_echo("groups:topicisclosed") . "</h2>";
+ echo "<p>" . elgg_echo("groups:topiccloseddesc") . "</p>";
+
+ } else {
+ }
?>
diff --git a/mod/messages/views/default/messages/messages.php b/mod/messages/views/default/messages/messages.php
index 5c2630ad6..29178bf6d 100644
--- a/mod/messages/views/default/messages/messages.php
+++ b/mod/messages/views/default/messages/messages.php
@@ -17,15 +17,15 @@
if(get_input("type") == "sent"){
// send back to the users sentbox
$url = $vars['url'] . "mod/messages/sent.php";
- // set up breadcrumbs context
- $breadcrumb_root_text = elgg_echo('messages:sent');
+ // set up breadcrumbs context
+ elgg_push_breadcrumb(elgg_echo('messages:sent'), $url);
//this is used on the delete link so we know which type of message it is
$type = "sent";
} else {
//send back to the users inbox
$url = $vars['url'] . "pg/messages/" . $vars['user']->username;
- // set up breadcrumbs context
- $breadcrumb_root_text = elgg_echo('messages:inbox');
+ // set up breadcrumbs context
+ elgg_push_breadcrumb(elgg_echo('messages:inbox'), $url);
//this is used on the delete link so we know which type of message it is
$type = "inbox";
}
@@ -41,11 +41,8 @@ if (isloggedin())
if ($vars['entity']->toId == $vars['user']->guid
|| $vars['entity']->owner_guid == $vars['user']->guid) {
// display breadcrumbs
- echo elgg_view('page_elements/breadcrumbs', array(
- 'breadcrumb_root_url' => $url,
- 'breadcrumb_root_text' => $breadcrumb_root_text,
- 'breadcrumb_currentpage' => $vars['entity']->title
- ));
+ elgg_push_breadcrumb($vars['entity']->title);
+ echo elgg_view('navigation/breadcrumbs');
?>
<!-- display the content header block -->
<div id="content_header" class="clearfloat">
@@ -57,45 +54,45 @@ if (isloggedin())
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
'class' => "action_button disabled"
- ));
+ ));
?>
</div>
</div>
-
- <div class="entity_listing messages clearfloat">
- <?php
- // we need a different user icon and name depending on whether the user is reading the message
- // from their inbox or sentbox. If it is the inbox, then the icon and name will be the person who sent
- // the message. If it is the sentbox, the icon and name will be the user the message was sent to
- if($type == "sent"){
- //get an instance of the user who the message has been sent to so we can access the name and icon
- $user_object = get_entity($vars['entity']->toId);
- $message_icon = elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny'));
- $message_owner = elgg_echo('messages:to').": <a href='{$vars['url']}pg/profile/".$user_object->username."'>".$user_object->name."</a>";
- }else{
- $user_object = get_entity($vars['entity']->fromId);
- $message_icon = elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny'));
- $message_owner = elgg_echo('messages:from').": <a href='{$vars['url']}pg/profile/".$user_object->username."'>".get_entity($vars['entity']->fromId)->name."</a>";
- }
- ?>
- <div class="entity_listing_icon"><?php echo $message_icon ?></div>
- <div class="entity_listing_info"><p><?php echo $message_owner ?></p>
+
+ <div class="entity_listing messages clearfloat">
+ <?php
+ // we need a different user icon and name depending on whether the user is reading the message
+ // from their inbox or sentbox. If it is the inbox, then the icon and name will be the person who sent
+ // the message. If it is the sentbox, the icon and name will be the user the message was sent to
+ if($type == "sent"){
+ //get an instance of the user who the message has been sent to so we can access the name and icon
+ $user_object = get_entity($vars['entity']->toId);
+ $message_icon = elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny'));
+ $message_owner = elgg_echo('messages:to').": <a href='{$vars['url']}pg/profile/".$user_object->username."'>".$user_object->name."</a>";
+ }else{
+ $user_object = get_entity($vars['entity']->fromId);
+ $message_icon = elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny'));
+ $message_owner = elgg_echo('messages:from').": <a href='{$vars['url']}pg/profile/".$user_object->username."'>".get_entity($vars['entity']->fromId)->name."</a>";
+ }
+ ?>
+ <div class="entity_listing_icon"><?php echo $message_icon ?></div>
+ <div class="entity_listing_info"><p><?php echo $message_owner ?></p>
<p class="entity_subtext"><?php echo friendly_time($vars['entity']->time_created); ?></p>
</div>
- </div>
-
- <div class="messagebody margin_top clearfloat">
- <?php
- // if the message is a reply, display the message the reply was for
- // @todo I need to figure out how to get the description out using -> (anyone?)
- if($main_message = $vars['entity']->getEntitiesFromRelationship("reply")){
- echo $main_message[0][description];
- }
- ?>
+ </div>
+
+ <div class="messagebody margin_top clearfloat">
+ <?php
+ // if the message is a reply, display the message the reply was for
+ // @todo I need to figure out how to get the description out using -> (anyone?)
+ if($main_message = $vars['entity']->getEntitiesFromRelationship("reply")){
+ echo $main_message[0][description];
+ }
+ ?>
<!-- display the message -->
<?php echo elgg_view('output/longtext',array('value' => $vars['entity']->description)); ?>
</div>
-
+
<!-- reply form -->
<div id="message_reply_form" class="hidden margin_top">
<h2><?php echo elgg_echo('messages:answer'); ?></h2>
@@ -108,8 +105,8 @@ if (isloggedin())
"internalname" => "message",
"value" => '',
));
- ?></div>
-
+ ?></div>
+
<?php
//pass across the guid of the message being replied to
echo "<input type='hidden' name='reply' value='" . $vars['entity']->getGUID() . "' />";
diff --git a/views/default/navigation/breadcrumbs.php b/views/default/navigation/breadcrumbs.php
new file mode 100644
index 000000000..1dc97f29c
--- /dev/null
+++ b/views/default/navigation/breadcrumbs.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Displays registered breadcrumbs.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ *
+ * @uses optional $vars['breadcrumbs'] = array('title' => 'The title', 'link' => 'url')
+ *
+ */
+
+if (isset($vars['breadcrumbs'])) {
+ $breadcrumbs = $vars['breadcrumbs'];
+} else {
+ $breadcrumbs = elgg_get_breadcrumbs();
+}
+
+$formatted_breadcrumbs = array();
+
+foreach ($breadcrumbs as $breadcrumb) {
+ $link = $breadcrumb['link'];
+ $title = $breadcrumb['title'];
+
+ if (!empty($link)) {
+ $formatted_breadcrumbs[] = elgg_view('output/url', array(
+ 'href' => $link,
+ 'text' => $title
+ ));
+ } else {
+ $formatted_breadcrumbs[] = $title;
+ }
+}
+
+$breadcrumbs_html = implode(' &gt; ', $formatted_breadcrumbs);
+
+echo <<<___END
+
+<div id="breadcrumbs">
+ $breadcrumbs_html
+</div>
+
+___END;
+?> \ No newline at end of file
diff --git a/views/default/page_elements/breadcrumbs.php b/views/default/page_elements/breadcrumbs.php
deleted file mode 100644
index 165a6c7dd..000000000
--- a/views/default/page_elements/breadcrumbs.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-/**
- * Breadcrumbs
-**/
-// @todo spk to Brett re. making this simpler / scalable
-// grab variables from array
-$breadcrumb_root_url = $vars['breadcrumb_root_url'];
-$breadcrumb_root_text = $vars['breadcrumb_root_text'];
-$breadcrumb_level1_url = $vars['breadcrumb_level1_url'];
-$breadcrumb_level1_text = $vars['breadcrumb_level1_text'];
-$breadcrumb_level2_url = $vars['breadcrumb_level2_url'];
-$breadcrumb_level2_text = $vars['breadcrumb_level2_text'];
-$breadcrumb_currentpage = $vars['breadcrumb_currentpage'];
-?>
-<div id="breadcrumbs">
- <a href="<?php echo $breadcrumb_root_url; ?>"><?php echo $breadcrumb_root_text; ?></a> &gt;
- <?php
- if (isset($vars['breadcrumb_level1_url']) && $vars['breadcrumb_level1_url']) { ?>
- <a href="<?php echo $breadcrumb_level1_url; ?>"><?php echo $breadcrumb_level1_text; ?></a> &gt;
- <?php }
- if (isset($vars['breadcrumb_level2_url']) && $vars['breadcrumb_level2_url']) { ?>
- <a href="<?php echo $breadcrumb_level2_url; ?>"><?php echo $breadcrumb_level2_text; ?></a> &gt;
- <?php }
- echo $breadcrumb_currentpage; ?>
-</div> \ No newline at end of file
diff --git a/views/default/page_elements/content_header.php b/views/default/page_elements/content_header.php
index 9d7bea08a..95e754d59 100644
--- a/views/default/page_elements/content_header.php
+++ b/views/default/page_elements/content_header.php
@@ -1,44 +1,51 @@
<?php
/**
- * Page Content header
- holds the filter menu and any content action buttons
- used on bookmarks, blog, file, pages,
- **/
-
+ * Displays the dropdown filter menu.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ *
+ */
+
global $CONFIG;
-
+
// set variables
$page_owner = page_owner_entity();
+if (!$page_owner) {
+ $page_owner = get_loggedin_user();
+}
$filter_context = $vars['context']; // so we know if the user is looking at their own, everyone's or all friends
-$type = $vars['type']; // get the object type
+$type = $vars['type']; // get the object type
$mine_selected = '';
$all_selected = '';
$friend_selected = '';
$action_buttons = '';
$title = '';
/* $dash_selected = ''; */
-
-if(!($page_owner instanceof ElggGroup)){
+
+if (!($page_owner instanceof ElggGroup)){
if($filter_context == 'mine') {
$mine_selected = "SELECTED";
}
if($filter_context == 'everyone') {
- $all_selected = "SELECTED";
+ $all_selected = "SELECTED";
}
if($filter_context == 'friends') {
$friend_selected = "SELECTED";
}
- if($filter_context == 'action') {
+ if($filter_context == 'action') {
// if this is an action page, we'll not be displaying the filter
}
/*
- if($filter_context == 'dashboard')
+ if($filter_context == 'dashboard')
$dash_selected = "SELECTED";
*/
-}
+}
// must be logged in to see the filter menu and any action buttons
-if(isloggedin()) {
+if (isloggedin()) {
// if we're not on an action page (add bookmark, create page, upload a file etc)
if ($filter_context != 'action') {
$location_filter = "<select onchange=\"window.open(this.options[this.selectedIndex].value,'_top')\" name=\"file_filter\" class='styled' >";
@@ -47,10 +54,10 @@ if(isloggedin()) {
$location_filter .= "<option {$friend_selected} class='select_option' value=\"{$vars['url']}pg/{$type}/{$_SESSION['user']->username}/friends/\">". elgg_echo($type . ':friends') . "</option>";
$location_filter .= "</select>";
$location_filter = "<div class='content_header_filter'>".$location_filter."</div>";
-
+
// action buttons
if(get_context() != 'bookmarks'){
- $url = $CONFIG->wwwroot . "pg/{$type}/". $page_owner->username . "/new/";
+ $url = $CONFIG->wwwroot . "pg/{$type}/". $page_owner->username . "/new";
} else {
$url = $CONFIG->wwwroot . "pg/{$type}/". $page_owner->username . "/add";
}
@@ -61,7 +68,7 @@ if(isloggedin()) {
// if we're on an action page - we'll just have a simple page title, and no filter menu
$title = "<div class='content_header_title'>".elgg_view_title($title = elgg_echo($type . ':add'))."</div>";
}
-}
+}
?>
<!-- construct the content area header -->
<div id="content_header" class="clearfloat">