From db7b497114329dda5f560198884c5bc5fbb3c1a8 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 3 Nov 2010 02:13:36 +0000 Subject: Fixes #2128 - replaces all uses of set_context() and get_context() in core and plugins git-svn-id: http://code.elgg.org/elgg/trunk@7215 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/admin.php | 2 +- engine/lib/api.php | 2 +- engine/lib/navigation.php | 4 ++-- engine/lib/users.php | 4 ++-- engine/lib/usersettings.php | 2 +- engine/lib/views.php | 2 +- engine/lib/widgets.php | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/admin.php b/engine/lib/admin.php index 595a3aa7c..b760adabe 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -168,7 +168,7 @@ function admin_settings_page_handler($page) { admin_gatekeeper(); elgg_admin_add_plugin_settings_sidemenu(); - set_context('admin'); + elgg_set_context('admin'); // default to overview if (!isset($page[0]) || empty($page[0])) { diff --git a/engine/lib/api.php b/engine/lib/api.php index a2b80625c..93de88d5b 100644 --- a/engine/lib/api.php +++ b/engine/lib/api.php @@ -1271,7 +1271,7 @@ function _php_api_exception_handler($exception) { function service_handler($handler, $request) { global $CONFIG; - set_context('api'); + elgg_set_context('api'); $request = explode('/', $request); diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index fcfc553fd..75c5958f4 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -43,7 +43,7 @@ function add_submenu_item($label, $link, $group = 'default', $onclick = false, $ // emulate that effect. // if context == 'main' (default) it probably means they always wanted // the menu item to show up everywhere. - $context = get_context(); + $context = elgg_get_context(); if ($context == 'main') { $context = 'all'; @@ -258,7 +258,7 @@ function elgg_get_submenu($context = NULL, $sort = FALSE) { global $CONFIG; if (!$context) { - $context = get_context(); + $context = elgg_get_context(); } if (!elgg_prepare_submenu($context, $sort)) { diff --git a/engine/lib/users.php b/engine/lib/users.php index e76702fb2..0075c9baa 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1397,8 +1397,8 @@ function users_pagesetup() { global $CONFIG; //add submenu options - if (get_context() == "friends" || get_context() == "friendsof") { - // || get_context() == "collections") { - disabled as we no longer use collections + if (elgg_get_context() == "friends" || elgg_get_context() == "friendsof") { + // || elgg_get_context() == "collections") { - disabled as we no longer use collections add_submenu_item(elgg_echo('friends'), $CONFIG->wwwroot . "pg/friends/" . elgg_get_page_owner()->username); diff --git a/engine/lib/usersettings.php b/engine/lib/usersettings.php index bec202b8a..396bb6de5 100644 --- a/engine/lib/usersettings.php +++ b/engine/lib/usersettings.php @@ -43,7 +43,7 @@ function usersettings_pagesetup() { global $CONFIG; // Menu options - if (get_context() == "settings") { + if (elgg_get_context() == "settings") { $user = get_loggedin_user(); add_submenu_item(elgg_echo('usersettings:user:opt:linktext'), $CONFIG->wwwroot . "pg/settings/user/{$user->username}/"); diff --git a/engine/lib/views.php b/engine/lib/views.php index 21056db0e..c70489117 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -843,7 +843,7 @@ $viewtypetoggle = true, $pagination = true) { $offset = sanitise_int(get_input('offset', 0)); } - $context = get_context(); + $context = elgg_get_context(); $html = elgg_view('entities/entity_list', array( 'entities' => $entities, diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php index c849596d4..02ab3af69 100644 --- a/engine/lib/widgets.php +++ b/engine/lib/widgets.php @@ -38,7 +38,7 @@ function use_widgets($context) { function using_widgets() { global $CONFIG; - $context = get_context(); + $context = elgg_get_context(); if (isset($CONFIG->widgets->contexts) && is_array($CONFIG->widgets->contexts)) { if (in_array($context, $CONFIG->widgets->contexts)) { return true; @@ -299,7 +299,7 @@ function get_widget_types() { && !empty($CONFIG->widgets->handlers) && is_array($CONFIG->widgets->handlers)) { - $context = get_context(); + $context = elgg_get_context(); foreach ($CONFIG->widgets->handlers as $key => $handler) { if (!in_array('all', $handler->context) && -- cgit v1.2.3