diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-03 02:13:36 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-03 02:13:36 +0000 |
commit | db7b497114329dda5f560198884c5bc5fbb3c1a8 (patch) | |
tree | 35ac7546fe14a8dd372e74d823ede01e24424443 /mod/pages | |
parent | 6307e6af3b4a717011570e71b844c4b1e366fae5 (diff) | |
download | elgg-db7b497114329dda5f560198884c5bc5fbb3c1a8.tar.gz elgg-db7b497114329dda5f560198884c5bc5fbb3c1a8.tar.bz2 |
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
Diffstat (limited to 'mod/pages')
-rw-r--r-- | mod/pages/actions/pages/edit.php | 2 | ||||
-rw-r--r-- | mod/pages/index.php | 8 | ||||
-rw-r--r-- | mod/pages/start.php | 4 | ||||
-rw-r--r-- | mod/pages/view.php | 2 | ||||
-rw-r--r-- | mod/pages/world.php | 8 |
5 files changed, 8 insertions, 16 deletions
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; |