engine/lib/pageowner.php File Reference

Go to the source code of this file.

Namespaces

namespace  Elgg::Core
 

Activate a plugin or plugins.


Functions

 elgg_get_page_owner_guid ($guid=0)
 Gets the guid of the entity that owns the current page.
 elgg_get_page_owner_entity ()
 Gets the owner entity for the current page.
 elgg_set_page_owner_guid ($guid)
 Set the guid of the entity that owns this page.
 default_page_owner_handler ($hook, $entity_type, $returnvalue, $params)
 Sets the page owner based on request.
 elgg_set_context ($context)
 Sets the page context.
 elgg_get_context ()
 Get the current context.
 elgg_push_context ($context)
 Push a context onto the top of the stack.
 elgg_pop_context ()
 Removes and returns the top context string from the stack.
 elgg_in_context ($context)
 Check if this context exists anywhere in the stack.
 page_owner_boot ()
 Initializes the page owner functions.

Function Documentation

default_page_owner_handler ( hook,
entity_type,
returnvalue,
params 
)

Sets the page owner based on request.

Tries to figure out the page owner by looking at the URL or a request parameter. The request parameters used are 'username' and 'owner_guid'. If the page request is going through the page handling system, this function attempts to figure out the owner if the url fits the patterns of: <handler>/owner/<username> <handler>/friends/<username> <handler>/view/<entity guid>=""> <handler>/add/<container guid>=""> <handler>/edit/<entity guid>=""> <handler>/group/<group guid>="">

Note:
Access is disabled while finding the page owner for the group gatekeeper functions.
Parameters:
string $hook 'page_owner'
string $entity_type 'system'
int $returnvalue Previous function's return value
array $params no parameters
Returns:
int GUID private

Definition at line 97 of file pageowner.php.

elgg_get_context (  ) 

Get the current context.

Since context is a stack, this is equivalent to a peek.

Returns:
string|NULL
Since:
1.8.0

Definition at line 223 of file pageowner.php.

elgg_get_page_owner_entity (  ) 

Gets the owner entity for the current page.

Note:
Access is disabled when getting the page owner entity.
Returns:
ElggUser|ElggGroup|false The current page owner or false if none.
Since:
1.8.0

Definition at line 48 of file pageowner.php.

elgg_get_page_owner_guid ( guid = 0  ) 

Gets the guid of the entity that owns the current page.

Parameters:
int $guid Optional parameter used by elgg_set_page_owner_guid().
Returns:
int The current page owner guid (0 if none).
Since:
1.8.0

Definition at line 18 of file pageowner.php.

elgg_in_context ( context  ) 

Check if this context exists anywhere in the stack.

This is useful for situations with more than one element in the stack. For example, a widget has a context of 'widget'. If a widget view needs to render itself differently based on being on the dashboard or profile pages, it can check the stack.

Parameters:
string $context The context string to check for
Returns:
bool
Since:
1.8.0

Definition at line 270 of file pageowner.php.

elgg_pop_context (  ) 

Removes and returns the top context string from the stack.

Returns:
string|NULL
Since:
1.8.0

Definition at line 252 of file pageowner.php.

elgg_push_context ( context  ) 

Push a context onto the top of the stack.

Parameters:
string $context The context string to add to the context stack
Returns:
void
Since:
1.8.0

Definition at line 240 of file pageowner.php.

elgg_set_context ( context  ) 

Sets the page context.

Views can modify their output based on the local context. You may want to display a list of blogs on a blog page or in a small widget. The rendered output could be different for those two contexts ('blog' vs 'widget').

Pages that pass through the page handling system set the context to the first string after the root url. Example: http://example.org/elgg/bookmarks/ results in the initial context being set to 'bookmarks'.

The context is a stack so that for a widget on a profile, the context stack may contain first 'profile' and then 'widget'.

If no context was been set, the default context returned is 'main'.

Warning:
The context is not available until the page_handler runs (after the 'init, system' event processing has completed).
Parameters:
string $context The context of the page
Returns:
bool
Since:
1.8.0

Definition at line 198 of file pageowner.php.

elgg_set_page_owner_guid ( guid  ) 

Set the guid of the entity that owns this page.

Parameters:
int $guid The guid of the page owner
Returns:
void
Since:
1.8.0

Definition at line 68 of file pageowner.php.

page_owner_boot (  ) 

Initializes the page owner functions.

Note:
This is on the 'boot, system' event so that the context is set up quickly.
Returns:
void private

Definition at line 284 of file pageowner.php.

 All Classes Namespaces Files Functions Variables Enumerations
Generated on Wed May 22 00:01:42 2013 for Elgg by  doxygen 1.6.3