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 ++-- engine/tests/ui/submenu.php | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) (limited to 'engine') 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) && diff --git a/engine/tests/ui/submenu.php b/engine/tests/ui/submenu.php index ac861254b..3069e7405 100644 --- a/engine/tests/ui/submenu.php +++ b/engine/tests/ui/submenu.php @@ -91,7 +91,7 @@ elgg_add_submenu_item(array('text' => 'Not Main C Test', 'href' => "$url?not_mai elgg_add_submenu_item(array('text' => 'All test', 'href' => "$url?all"), 'all'); -//set_context('not_main'); +//elgg_set_context('not_main'); $body = elgg_view_layout('one_column_with_sidebar', 'Look right.'); echo elgg_view_page('Submenu Test', $body); -- cgit v1.2.3