diff options
Diffstat (limited to 'mod')
43 files changed, 76 insertions, 87 deletions
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 92ee7e421..ca367deb2 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -57,7 +57,7 @@ function bookmarks_pagesetup() { // Add group bookmark menu item if (isloggedin()) { - if ($page_owner instanceof ElggGroup && get_context() == 'groups') { + if ($page_owner instanceof ElggGroup && elgg_get_context() == 'groups') { if ($page_owner->bookmarks_enable != "no") { //add_submenu_item(sprintf(elgg_echo("bookmarks:group"),$page_owner->name), "pg/bookmarks/" . $page_owner->username . '/items'); } diff --git a/mod/bookmarks/views/default/river/object/bookmarks/create.php b/mod/bookmarks/views/default/river/object/bookmarks/create.php index dec4ab4d1..faffdec5d 100644 --- a/mod/bookmarks/views/default/river/object/bookmarks/create.php +++ b/mod/bookmarks/views/default/river/object/bookmarks/create.php @@ -10,7 +10,7 @@ $url = $object->getURL(); $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; $string = sprintf(elgg_echo("bookmarks:river:created"),$url) . " "; $string .= "<a href=\"" . $object->address . "\">" . $object->title . "</a>"; -if(($is_group instanceof ElggGroup) && (get_context() != 'groups')){ +if (($is_group instanceof ElggGroup) && (elgg_get_context() != 'groups')){ $string .= " " . elgg_echo('bookmarks:ingroup') . " <a href=\"{$is_group->getURL()}\">" . $is_group->name . "</a>"; } $string .= " <span class='entity_subtext'>" . elgg_view_friendly_time($object->time_created); diff --git a/mod/categories/listing.php b/mod/categories/listing.php index b2701b143..efbac8551 100644 --- a/mod/categories/listing.php +++ b/mod/categories/listing.php @@ -24,10 +24,9 @@ $params = array( 'full_view' => FALSE, 'metadata_case_sensitive' => FALSE, ); -$current_context = get_context(); -set_context('search'); +elgg_push_context('search'); $objects = elgg_list_entities_from_metadata($params); -set_context($current_context); +elgg_pop_context(); $title = sprintf(elgg_echo('categories:results'), $category); diff --git a/mod/defaultwidgets/views/default/defaultwidgets/editor.php b/mod/defaultwidgets/views/default/defaultwidgets/editor.php index 6400ed55d..e63e84a79 100644 --- a/mod/defaultwidgets/views/default/defaultwidgets/editor.php +++ b/mod/defaultwidgets/views/default/defaultwidgets/editor.php @@ -18,9 +18,9 @@ $area3widgets = false; // get available widget types - set_context ( $context ); + elgg_set_context($context); $widgettypes = get_widget_types(); - set_context ( 'admin' ); + elgg_set_context('admin'); // get the entities for the module $entities = elgg_get_entities(array('type' => 'object', 'subtype' => 'moddefaultwidgets', 'limit' => 9999)); @@ -103,7 +103,7 @@ $(document).ready(function () { <td colspan="2" align="left" valign="top"> <?php - if(get_context() == "profile"){ + if (elgg_get_context() == "profile"){ ?> <h2 class="profile_box"><?php echo elgg_echo("widgets:profilebox"); ?></h2> <div id="profile_box_widgets"> @@ -118,7 +118,7 @@ $(document).ready(function () { <td rowspan="2" align="left" valign="top"> <h2><?php echo elgg_echo("widgets:rightcolumn"); ?></h2> - <div id="rightcolumn_widgets" <?php if(get_context() == "profile")echo "class=\"long\""; ?>> + <div id="rightcolumn_widgets" <?php if (elgg_get_context() == "profile") echo "class=\"long\""; ?>> <?php $rightcolumn_widgets = ""; if (is_array($area3widgets) && sizeof($area3widgets) > 0) { diff --git a/mod/diagnostics/index.php b/mod/diagnostics/index.php index ca0f9b9f4..9bc58b56a 100644 --- a/mod/diagnostics/index.php +++ b/mod/diagnostics/index.php @@ -8,7 +8,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); admin_gatekeeper(); -set_context('admin'); +elgg_set_context('admin'); // system diagnostics $body = elgg_view_title(elgg_echo('diagnostics')); diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php index 45403e3b5..52bd8a1d8 100644 --- a/mod/diagnostics/start.php +++ b/mod/diagnostics/start.php @@ -26,7 +26,7 @@ function diagnostics_init() */ function diagnostics_pagesetup() { - if (get_context() == 'admin' && isadminloggedin()) { + if (elgg_get_context() == 'admin' && isadminloggedin()) { global $CONFIG; add_submenu_item(elgg_echo('diagnostics'), 'pg/diagnostics/'); } diff --git a/mod/ecml/start.php b/mod/ecml/start.php index 2c6cc073b..14031aac4 100644 --- a/mod/ecml/start.php +++ b/mod/ecml/start.php @@ -181,7 +181,7 @@ function ecml_generate_page_handler($page) { */ function ecml_admin_page_handler($page) { admin_gatekeeper(); - set_context('admin'); + elgg_set_context('admin'); $content = elgg_view('ecml/admin/ecml_admin'); $body = elgg_view_layout('one_column_with_sidebar', $content); echo elgg_view_page(elgg_echo('ecml:admin'), $body); diff --git a/mod/file/friends.php b/mod/file/friends.php index 038d7efa2..f76c4e692 100644 --- a/mod/file/friends.php +++ b/mod/file/friends.php @@ -15,10 +15,11 @@ $title = sprintf(elgg_echo("file:friends"),$owner->name); $area1 = elgg_view('page_elements/content_header', array('context' => "friends", 'type' => 'file')); - set_context('search'); + elgg_push_context('search'); // offset is grabbed in list_user_friends_objects $content = list_user_friends_objects($owner->guid, 'file', 10, false); - set_context('file'); + elgg_pop_context(); + $area1 .= get_filetype_cloud($owner->guid, true); // handle case where friends don't have any files diff --git a/mod/file/index.php b/mod/file/index.php index 7fb246367..2a82ee1e4 100644 --- a/mod/file/index.php +++ b/mod/file/index.php @@ -23,10 +23,11 @@ } // Get objects - set_context('search'); + elgg_push_context('search'); $offset = (int)get_input('offset', 0); $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'container_guid' => elgg_get_page_owner_guid(), 'limit' => 10, 'offset' => $offset, 'full_view' => FALSE)); - set_context('file'); + elgg_pop_context(); + $get_filter = get_filetype_cloud(elgg_get_page_owner_guid()); if ($get_filter) { $area1 .= $get_filter; diff --git a/mod/file/search.php b/mod/file/search.php index 6568eae79..e92cf0362 100644 --- a/mod/file/search.php +++ b/mod/file/search.php @@ -69,8 +69,7 @@ $area1 = get_filetype_cloud(); } - // Set context - set_context('search'); + elgg_push_context('search'); $offset = (int)get_input('offset', 0); $limit = 10; @@ -89,7 +88,7 @@ $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'owner_guid' => $owner_guid, 'limit' => $limit, 'offset' => $offset)); } - set_context("file"); + elgg_pop_context(); $content = "<div class='files'>".$area1.$area2."</div>"; diff --git a/mod/file/start.php b/mod/file/start.php index 544024d49..3d66dcc21 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -77,7 +77,7 @@ $page_owner = elgg_get_page_owner(); // Group submenu option - if ($page_owner instanceof ElggGroup && get_context() == "groups") { + if ($page_owner instanceof ElggGroup && elgg_get_context() == "groups") { if($page_owner->file_enable != "no"){ add_submenu_item(sprintf(elgg_echo("file:group"),$page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username); } diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 2511f5af6..5858a1f1e 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -22,7 +22,7 @@ $title = elgg_echo('untitled'); } - if (get_context() == "search") { // Start search listing version + if (elgg_get_context() == "search") { // Start search listing version if (get_input('search_viewtype') == "gallery") { echo "<div class='filerepo_gallery_item'>"; diff --git a/mod/file/world.php b/mod/file/world.php index 0fa2a2ead..a3d78ef7b 100644 --- a/mod/file/world.php +++ b/mod/file/world.php @@ -22,9 +22,9 @@ // Get objects $area1 = elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'file')); $area1 .= get_filetype_cloud(); // the filter - set_context('search'); + elgg_push_context('search'); $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE)); - set_context('file'); + elgg_pop_context(); //get the latest comments on all files $comments = get_annotations(0, "object", "file", "generic_comment", "", 0, 4, 0, "desc"); diff --git a/mod/groups/all.php b/mod/groups/all.php index 666c6ad4b..da884bac7 100644 --- a/mod/groups/all.php +++ b/mod/groups/all.php @@ -15,7 +15,7 @@ $filter = "newest"; } - $context = get_context(); + $context = elgg_get_context(); switch($filter){ case "newest": @@ -50,7 +50,7 @@ $featured_groups = elgg_get_entities_from_metadata(array('metadata_name' => 'featured_group', 'metadata_value' => 'yes', 'types' => 'group', 'limit' => 10)); $area2 .= elgg_view("groups/featured", array("featured" => $featured_groups)); - set_context($context); + elgg_set_context($context); $objects = "<div class='group_listings'>".$objects."</div>"; diff --git a/mod/groups/forum.php b/mod/groups/forum.php index 603743009..376098f80 100644 --- a/mod/groups/forum.php +++ b/mod/groups/forum.php @@ -35,7 +35,7 @@ elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic')); $area1 = elgg_view('navigation/breadcrumbs'); $area1 .= elgg_view("forum/topics", array('topics' => $topics, 'group_guid' => $group_guid)); -set_context('groups'); +elgg_set_context('groups'); $body = elgg_view_layout('one_column_with_sidebar', $area1); diff --git a/mod/groups/groupprofile.php b/mod/groups/groupprofile.php index ffa96d71d..bb577fde2 100644 --- a/mod/groups/groupprofile.php +++ b/mod/groups/groupprofile.php @@ -6,7 +6,7 @@ */ $group_guid = get_input('group_guid'); - set_context('groups'); + elgg_set_context('groups'); global $autofeed; $autofeed = true; diff --git a/mod/groups/index.php b/mod/groups/index.php index de1363ae6..457d2eb55 100644 --- a/mod/groups/index.php +++ b/mod/groups/index.php @@ -15,9 +15,9 @@ // Get objects $area1 = elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "pg/groups/new")); - set_context('search'); + elgg_push_context('search'); $objects = elgg_list_entities(array('types' => 'group', 'owner_guid' => elgg_get_page_owner_guid(), 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE)); - set_context('groups'); + elgg_pop_context(); $area1 .= $objects; $body = elgg_view_layout('one_column_with_sidebar', $area1); diff --git a/mod/groups/membership.php b/mod/groups/membership.php index bfce96741..dd5fd675b 100644 --- a/mod/groups/membership.php +++ b/mod/groups/membership.php @@ -21,10 +21,10 @@ // Get objects $area2 = elgg_view('page_elements/content_header', array('context' => "mine", 'type' => 'groups', 'new_link' => "pg/groups/new")); - set_context('search'); + elgg_push_context('search'); // offset is grabbed in the list_entities_from_relationship() function $objects = list_entities_from_relationship('member',page_owner(),false,'group','',0, $limit,false, false); - set_context('groups'); + elgg_pop_context(); $area2 .= $objects; $body = elgg_view_layout('one_column_with_sidebar', $area1.$area2); diff --git a/mod/groups/start.php b/mod/groups/start.php index f24a3106a..8e5befb74 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -202,7 +202,7 @@ // Get the page owner entity $page_owner = elgg_get_page_owner(); - if (get_context() == 'groups') { + if (elgg_get_context() == 'groups') { if ($page_owner instanceof ElggGroup) { if (isloggedin() && $page_owner->canEdit() && !$page_owner->isPublicMembership()) { $url = elgg_get_site_url()."mod/groups/membershipreq.php?group_guid={$page_owner->getGUID()}"; @@ -267,7 +267,7 @@ include($CONFIG->pluginspath . "groups/new.php"); break; case "world": - set_context('groups'); + elgg_set_context('groups'); set_page_owner(0); include($CONFIG->pluginspath . "groups/all.php"); break; diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php index 2d5b1e094..fb67797d3 100644 --- a/mod/groups/views/default/object/groupforumtopic.php +++ b/mod/groups/views/default/object/groupforumtopic.php @@ -24,7 +24,7 @@ if ($last_post) { $u = get_user($last_user); //select the correct output depending on where you are -if (get_context() == "search") { +if (elgg_get_context() == "search") { var_export($counter); if($counter == 1){ $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('groups:forum:created:single'), $forum_created, $counter) . "<br />"; diff --git a/mod/invitefriends/index.php b/mod/invitefriends/index.php index 25935565a..4b7637c97 100644 --- a/mod/invitefriends/index.php +++ b/mod/invitefriends/index.php @@ -10,7 +10,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php'); gatekeeper(); -set_context('friends'); +elgg_set_context('friends'); set_page_owner(get_loggedin_userid()); $body = elgg_view('invitefriends/form'); diff --git a/mod/invitefriends/start.php b/mod/invitefriends/start.php index 4b039bac3..19a4c4b55 100644 --- a/mod/invitefriends/start.php +++ b/mod/invitefriends/start.php @@ -10,9 +10,9 @@ */ function invitefriends_pagesetup() { global $CONFIG; - if (get_context() == "friends" || - get_context() == "friendsof" || - get_context() == "collections") { + if (elgg_get_context() == "friends" || + elgg_get_context() == "friendsof" || + elgg_get_context() == "collections") { add_submenu_item(elgg_echo('friends:invite'), "mod/invitefriends/",'invite'); } } diff --git a/mod/members/index.php b/mod/members/index.php index 589301ec6..8e6c3ddf9 100644 --- a/mod/members/index.php +++ b/mod/members/index.php @@ -51,7 +51,7 @@ switch($filter){ break; // search based on name case "search": - set_context('search'); + elgg_set_context('search'); $filter_content = list_user_search($tag); break; // search based on tags diff --git a/mod/messages/start.php b/mod/messages/start.php index de8f42e51..07698d893 100644 --- a/mod/messages/start.php +++ b/mod/messages/start.php @@ -22,7 +22,7 @@ function messages_init() { global $CONFIG; //add submenu options - if (get_context() == "messages") { + if (elgg_get_context() == "messages") { add_submenu_item(elgg_echo('messages:inbox'), "pg/messages/" . get_loggedin_user()->username); add_submenu_item(elgg_echo('messages:sentmessages'), "mod/messages/sent.php"); } diff --git a/mod/notifications/groups.php b/mod/notifications/groups.php index baa8757a8..9b176955a 100644 --- a/mod/notifications/groups.php +++ b/mod/notifications/groups.php @@ -15,7 +15,7 @@ gatekeeper(); set_page_owner(get_loggedin_userid()); // Set the context to settings -set_context('settings'); +elgg_set_context('settings'); // Get the form $people = array(); diff --git a/mod/notifications/index.php b/mod/notifications/index.php index 0418e6b1d..209de9cd2 100644 --- a/mod/notifications/index.php +++ b/mod/notifications/index.php @@ -15,7 +15,7 @@ gatekeeper(); set_page_owner(get_loggedin_userid()); // Set the context to settings -set_context('settings'); +elgg_set_context('settings'); // Get the form $people = array(); diff --git a/mod/notifications/start.php b/mod/notifications/start.php index 4d3d2b7ee..d98c475d3 100644 --- a/mod/notifications/start.php +++ b/mod/notifications/start.php @@ -61,7 +61,7 @@ function notifications_page_handler($page) { */ function notifications_plugin_pagesetup() { global $CONFIG; - if (get_context() == 'settings') { + if (elgg_get_context() == 'settings') { add_submenu_item(elgg_echo('notifications:subscriptions:changesettings'), "pg/notifications/personal"); if (is_plugin_enabled('groups')) { add_submenu_item(elgg_echo('notifications:subscriptions:changesettings:groups'), "pg/notifications/group"); diff --git a/mod/pages/actions/pages/edit.php b/mod/pages/actions/pages/edit.php index c8b151a97..b5ce6eb3b 100644 --- a/mod/pages/actions/pages/edit.php +++ b/mod/pages/actions/pages/edit.php @@ -9,7 +9,7 @@ global $CONFIG; gatekeeper(); -set_context('pages'); +elgg_set_context('pages'); //boolean to select correct add to river. It will be new or edit $which_river = 'new'; diff --git a/mod/pages/index.php b/mod/pages/index.php index 3cffbd292..e3d440692 100644 --- a/mod/pages/index.php +++ b/mod/pages/index.php @@ -34,13 +34,9 @@ if($owner instanceof ElggGroup){ // Get objects -$context = get_context(); - -set_context('search'); - +elgg_push_context('search'); $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => elgg_get_page_owner_guid(), 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE)); - -set_context($context); +elgg_pop_context(); //get the owners latest welcome message $welcome_message = elgg_get_entities(array('types' => 'object', 'subtypes' => 'pages_welcome', 'container_guid' => $owner->guid, 'limit' => 1)); diff --git a/mod/pages/start.php b/mod/pages/start.php index 4c7bb1d15..0f0af0a80 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -84,7 +84,7 @@ function pages_submenus() { $page_owner = elgg_get_page_owner(); // Group submenu option - if ($page_owner instanceof ElggGroup && get_context() == 'groups') { + if ($page_owner instanceof ElggGroup && elgg_get_context() == 'groups') { if($page_owner->pages_enable != "no"){ add_submenu_item(sprintf(elgg_echo("pages:group"),$page_owner->name), "pg/pages/owned/" . $page_owner->username); } @@ -308,7 +308,7 @@ function pages_write_permission_check($hook, $entity_type, $returnvalue, $params */ function pages_container_permission_check($hook, $entity_type, $returnvalue, $params) { - if (get_context() == "pages") { + if (elgg_get_context() == "pages") { if (elgg_get_page_owner_guid()) { if (can_write_to_container(get_loggedin_userid(), elgg_get_page_owner_guid())) return true; } diff --git a/mod/pages/view.php b/mod/pages/view.php index 84b0ae55b..2600de5c8 100644 --- a/mod/pages/view.php +++ b/mod/pages/view.php @@ -8,7 +8,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); $page_guid = get_input('page_guid'); -set_context('pages'); +elgg_set_context('pages'); if (is_callable('group_gatekeeper')) { group_gatekeeper(); diff --git a/mod/pages/world.php b/mod/pages/world.php index ee9521ba4..25081e00d 100644 --- a/mod/pages/world.php +++ b/mod/pages/world.php @@ -32,13 +32,9 @@ $offset = get_input("offset", 0); $title = sprintf(elgg_echo("pages:all"),elgg_get_page_owner()->name); // Get objects -$context = get_context(); - -set_context('search'); - +elgg_push_context('search'); $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE)); - -set_context($context); +elgg_pop_context(); $body = elgg_view_title($title); $body .= $objects; diff --git a/mod/profile/edit.php b/mod/profile/edit.php index c6fc154ac..12ce8564a 100644 --- a/mod/profile/edit.php +++ b/mod/profile/edit.php @@ -31,7 +31,7 @@ if (!$user->canEdit()) { $area1 = elgg_view_title(elgg_echo('profile:edit')); $area1 .= elgg_view("profile/edit",array('entity' => $user)); -set_context('profile_edit'); +elgg_set_context('profile_edit'); // get the required canvas area $body = elgg_view_layout("one_column_with_sidebar", $area1); diff --git a/mod/profile/editicon.php b/mod/profile/editicon.php index e3adef13f..4c19937b2 100644 --- a/mod/profile/editicon.php +++ b/mod/profile/editicon.php @@ -30,7 +30,7 @@ if (!$user->canEdit()) { $area1 = elgg_view_title(elgg_echo('profile:createicon:header')); $area1 .= elgg_view("profile/edit_icon", array('user' => $user)); -set_context('profile_edit'); +elgg_set_context('profile_edit'); // Get the form and correct canvas area $body = elgg_view_layout("one_column_with_sidebar", $area1); diff --git a/mod/profile/start.php b/mod/profile/start.php index 6cebf88c0..dab12b12d 100644 --- a/mod/profile/start.php +++ b/mod/profile/start.php @@ -173,7 +173,7 @@ function profile_pagesetup() global $CONFIG; //add submenu options - if (get_context() == "profile") { + if (elgg_get_context() == "profile") { $page_owner = elgg_get_page_owner(); if ($page_owner && $page_owner->canEdit()) { add_submenu_item(elgg_echo('profile:editdetails'), "pg/profile/{$page_owner->username}/edit/details"); diff --git a/mod/riverdashboard/index.php b/mod/riverdashboard/index.php index 153e6a75c..3c3f97dad 100644 --- a/mod/riverdashboard/index.php +++ b/mod/riverdashboard/index.php @@ -55,7 +55,7 @@ if (isloggedin()) { $sidebar = ''; } -set_context('riverdashboard'); +elgg_set_context('riverdashboard'); if (empty($callback)) { $body .= elgg_view('riverdashboard/container', array('body' => $nav . $extend . $river . elgg_view('riverdashboard/js'))); diff --git a/mod/riverdashboard/views/default/river/item/wrapper.php b/mod/riverdashboard/views/default/river/item/wrapper.php index 6dd4e91d3..cd474df2a 100644 --- a/mod/riverdashboard/views/default/river/item/wrapper.php +++ b/mod/riverdashboard/views/default/river/item/wrapper.php @@ -18,7 +18,7 @@ $likes_count = elgg_count_likes($object); //user //if displaying on the profile get the object owner, else the subject_guid -if (get_context() == 'profile' && $object->getSubtype() == 'thewire') { +if (elgg_get_context() == 'profile' && $object->getSubtype() == 'thewire') { $user = get_entity($object->owner_guid); } else { $user = get_entity($vars['item']->subject_guid); diff --git a/mod/sitepages/index.php b/mod/sitepages/index.php index 5b575ef37..f1f6585da 100644 --- a/mod/sitepages/index.php +++ b/mod/sitepages/index.php @@ -13,7 +13,8 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); //Load the front page
$content = elgg_view('sitepages/welcome');
$content .= elgg_view_title(elgg_echo('content:latest'));
-set_context('search');
+
+elgg_set_context('search');
$offset = (int)get_input('offset', 0);
if(is_plugin_enabled('riverdashboard')){
$items = elgg_view_river_items(0, 0, "", "", "", '', 10, 0, 0, true, false);
@@ -21,7 +22,8 @@ if(is_plugin_enabled('riverdashboard')){ }else{
$content .= elgg_list_registered_entities(array('limit' => 10, 'offset' => $offset, 'full_view' => FALSE, 'allowed_types' => array('object','group')));
}
-set_context('main');
+elgg_set_context('main');
+
global $autofeed;
$autofeed = FALSE;
diff --git a/mod/sitepages/start.php b/mod/sitepages/start.php index fb562b631..3b0242a43 100644 --- a/mod/sitepages/start.php +++ b/mod/sitepages/start.php @@ -69,18 +69,18 @@ function sitepages_runonce() { */ function sitepages_custom_index() { // context is checked by the extended metatags view to print out its custom CSS - //$context = get_context(); - //set_context('sitepages:front'); + //$context = elgg_get_context(); + //elgg_set_context('sitepages:front'); //if ($contents = elgg_view('sitepages/custom_frontpage')) { // echo elgg_view_page(FALSE, $contents); - // set_context($context); + // elgg_set_context($context); // return TRUE to tell index.php we've got its content right here. // return TRUE; //} - //set_context($context); + //elgg_set_context($context); // return NULL to pass this to next in chain, or back to standard index.php. //return NULL; diff --git a/mod/sitepages/views/default/sitepages/metatags.php b/mod/sitepages/views/default/sitepages/metatags.php index ac8ece148..6213dde52 100644 --- a/mod/sitepages/views/default/sitepages/metatags.php +++ b/mod/sitepages/views/default/sitepages/metatags.php @@ -20,7 +20,7 @@ ___END; } // only show on the custom front page. -if (get_context() == 'sitepages:front') { +if (elgg_get_context() == 'sitepages:front') { $custom_css = sitepages_get_sitepage_object('front'); if ($custom_css && $custom_css->css) { diff --git a/mod/tagcloud/views/default/widgets/tagcloud/view.php b/mod/tagcloud/views/default/widgets/tagcloud/view.php index a290d8e37..662c02d97 100644 --- a/mod/tagcloud/views/default/widgets/tagcloud/view.php +++ b/mod/tagcloud/views/default/widgets/tagcloud/view.php @@ -1,9 +1,8 @@ <?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 30; +$num_items = $vars['entity']->num_items; +if (!isset($num_items)) { + $num_items = 30; +} - $prev_context = get_context(); - echo display_tagcloud(1, $num_items, 'tags', '', '', elgg_get_page_owner_guid()); - set_context($prev_context); -?> +echo display_tagcloud(1, $num_items, 'tags', '', '', elgg_get_page_owner_guid()); diff --git a/mod/thewire/start.php b/mod/thewire/start.php index 4031ded42..ca13acc9c 100644 --- a/mod/thewire/start.php +++ b/mod/thewire/start.php @@ -59,7 +59,7 @@ global $CONFIG; //add submenu options - if (get_context() == "thewire") { + if (elgg_get_context() == "thewire") { if ((elgg_get_page_owner_guid() == get_loggedin_userid() || !elgg_get_page_owner_guid()) && isloggedin()) { add_submenu_item(elgg_echo('thewire:read'),$CONFIG->wwwroot."pg/thewire/" . get_loggedin_user()->username); add_submenu_item(elgg_echo('thewire:everyone'),$CONFIG->wwwroot."mod/thewire/everyone.php"); diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php index 4596fd7d6..b0f621a84 100644 --- a/mod/uservalidationbyemail/start.php +++ b/mod/uservalidationbyemail/start.php @@ -66,8 +66,7 @@ function uservalidationbyemail_disable_new_user($hook, $type, $value, $params) { // disable user to prevent showing up on the site // set context to our canEdit() override works - $context = get_context(); - set_context('uservalidationbyemail_new_user'); + elgg_push_context('uservalidationbyemail_new_user'); $hidden_entities = access_get_show_hidden_status(); access_show_hidden_entities(TRUE); @@ -81,7 +80,7 @@ function uservalidationbyemail_disable_new_user($hook, $type, $value, $params) { uservalidationbyemail_set_user_validation_status($user->guid, FALSE); uservalidationbyemail_request_validation($user->guid); - set_context($context); + elgg_pop_context(); access_show_hidden_entities($hidden_entities); return TRUE; @@ -100,7 +99,7 @@ function uservalidationbyemail_allow_new_user_can_edit($hook, $type, $value, $pa return NULL; } - $context = get_context(); + $context = elgg_get_context(); if ($context == 'uservalidationbyemail_new_user' || $context = 'uservalidationbyemail_validate_user') { return TRUE; } @@ -171,15 +170,12 @@ function uservalidationbyemail_page_handler($page) { if (($code) && ($user)) { if (uservalidationbyemail_validate_email($user_guid, $code)) { - $context = get_context(); - set_context('uservalidationbyemail_validate_user'); - + elgg_push_context('uservalidationbyemail_validate_user'); system_message(elgg_echo('email:confirm:success')); - $user = get_entity($user_guid); $user->enable(); + elgg_pop_context(); - set_context($context); login($user); } else { register_error(elgg_echo('email:confirm:fail')); |