From c80f32c614e48e237bcc3b72b780badf17d99dca Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 8 Oct 2011 17:56:27 -0400 Subject: Fixes #3936 added @access private to internal functions --- engine/lib/pageowner.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engine/lib/pageowner.php') diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php index 504d34a4e..d1010fda6 100644 --- a/engine/lib/pageowner.php +++ b/engine/lib/pageowner.php @@ -82,6 +82,7 @@ function elgg_set_page_owner_guid($guid) { * @param array $params no parameters * * @return int GUID + * @access private */ function default_page_owner_handler($hook, $entity_type, $returnvalue, $params) { @@ -259,6 +260,7 @@ function elgg_in_context($context) { * @note This is on the 'boot, system' event so that the context is set up quickly. * * @return void + * @access private */ function page_owner_boot() { global $CONFIG; @@ -266,7 +268,10 @@ function page_owner_boot() { elgg_register_plugin_hook_handler('page_owner', 'system', 'default_page_owner_handler'); $CONFIG->context = array(); - // @todo Ew... hacky + + // Bootstrap the context stack by setting its first entry to the handler. + // This is the first segment of the URL and the handler is set by the rewrite rules. + // @todo this does not work for actions $handler = get_input('handler', FALSE); if ($handler) { elgg_set_context($handler); -- cgit v1.2.3 From cb0677fbffa53db9682277bc796384a7af715a91 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 30 Oct 2011 13:05:28 -0400 Subject: setting $CONFIG->context earlier to avoid using the context functions before it is initialized --- engine/lib/configuration.php | 2 ++ engine/lib/pageowner.php | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'engine/lib/pageowner.php') diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php index c6db515e8..615063f3d 100644 --- a/engine/lib/configuration.php +++ b/engine/lib/configuration.php @@ -572,6 +572,8 @@ function set_default_config() { } } + $CONFIG->context = array(); + return true; } diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php index d1010fda6..9d41d74c1 100644 --- a/engine/lib/pageowner.php +++ b/engine/lib/pageowner.php @@ -263,12 +263,9 @@ function elgg_in_context($context) { * @access private */ function page_owner_boot() { - global $CONFIG; elgg_register_plugin_hook_handler('page_owner', 'system', 'default_page_owner_handler'); - $CONFIG->context = array(); - // Bootstrap the context stack by setting its first entry to the handler. // This is the first segment of the URL and the handler is set by the rewrite rules. // @todo this does not work for actions -- cgit v1.2.3