From c262a9185a736494f32c69fa5d1cd1b74eaedf2b Mon Sep 17 00:00:00 2001 From: nickw Date: Fri, 2 Apr 2010 20:25:48 +0000 Subject: 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 --- views/default/page_elements/content_header.php | 32 ++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'views/default/page_elements') 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; // 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 = "" . elgg_echo($type . ':new') . ""; $action_buttons = "
".$action_buttons."
"; -- cgit v1.2.3