aboutsummaryrefslogtreecommitdiff
path: root/views/default/page_elements
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-02 20:25:48 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-02 20:25:48 +0000
commitc262a9185a736494f32c69fa5d1cd1b74eaedf2b (patch)
treed3da663a0cfdfe6f2f8397196f8f2a6e85705da8 /views/default/page_elements
parent39e084331ddfcccefc09cdc40ef9fb8e41626e7d (diff)
downloadelgg-c262a9185a736494f32c69fa5d1cd1b74eaedf2b.tar.gz
elgg-c262a9185a736494f32c69fa5d1cd1b74eaedf2b.tar.bz2
Allowing default page handler to be overridden.
You can pass in full url overrides to the content header view for all/mine/friend tabs. git-svn-id: http://code.elgg.org/elgg/trunk@5580 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/page_elements')
-rw-r--r--views/default/page_elements/content_header.php32
1 files changed, 27 insertions, 5 deletions
diff --git a/views/default/page_elements/content_header.php b/views/default/page_elements/content_header.php
index e42f03651..f0e2ad535 100644
--- a/views/default/page_elements/content_header.php
+++ b/views/default/page_elements/content_header.php
@@ -42,6 +42,28 @@ if (!($page_owner instanceof ElggGroup)){
}
}
+
+// allow plugins to override default page handlers
+if (isset($vars['all_link'])) {
+ $all_link = $vars['all_link'];
+} else {
+ // @todo switch this over to proper page handling style
+ $all_link = "{$vars['url']}mod/$type/all.php";
+}
+
+if (isset($vars['mine_link'])) {
+ $mine_link = $vars['mine_link'];
+} else {
+ $mine_link = "{$vars['url']}pg/$type/{$_SESSION['user']->username}";
+}
+
+if (isset($vars['friend_link'])) {
+ $friend_link = $vars['friend_link'];
+} else {
+ $friend_link = "{$vars['url']}pg/$type/{$_SESSION['user']->username}/friends";
+}
+
+
// must be logged in to see the filter menu and any action buttons
if ( isloggedin() ) {
// if we're not on an action page (add a bookmark, create a blog, upload a file etc), or a group page
@@ -51,17 +73,17 @@ if ( isloggedin() ) {
$page_filter = <<<EOT
<div class="elgg_horizontal_tabbed_nav margin_top">
<ul>
- <li {$all_selected}><a href="{$vars['url']}mod/{$type}/all.php">{$all_title}</a></li>
- <li {$mine_selected}><a href="{$vars['url']}pg/{$type}/{$_SESSION['user']->username}">{$mine_title}</a></li>
- <li {$friend_selected}><a href="{$vars['url']}pg/{$type}/{$_SESSION['user']->username}/friends/">{$friend_title}</a></li>
+ <li $all_selected><a href="$all_link">$all_title</a></li>
+ <li $mine_selected><a href="$mine_link">$mine_title</a></li>
+ <li $friend_selected><a href="$friend_link">$friend_title</a></li>
</ul>
</div>
EOT;
// 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";
+ $url = "{$CONFIG->wwwroot}pg/$type/{$page_owner->username}/add";
}
$action_buttons = "<a href=\"{$url}\" class='action_button'>" . elgg_echo($type . ':new') . "</a>";
$action_buttons = "<div class='content_header_options'>".$action_buttons."</div>";