Elgg  Version 1.9
Namespaces | Functions
pagehandler.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Activate a plugin or plugins.
 

Functions

 elgg_register_page_handler ($identifier, $function)
 Registers a page handler for a particular identifier. More...
 
 elgg_unregister_page_handler ($identifier)
 Unregister a page handler for an identifier. More...
 
 elgg_gatekeeper ()
 Used at the top of a page to mark it as logged in users only. More...
 
 gatekeeper ()
 Alias of elgg_gatekeeper() More...
 
 elgg_admin_gatekeeper ()
 Used at the top of a page to mark it as admin only. More...
 
 admin_gatekeeper ()
 Alias of elgg_admin_gatekeeper() More...
 
 elgg_group_gatekeeper ($forward=true, $group_guid=null)
 May the current user access item(s) on this page? If the page owner is a group, membership, visibility, and logged in status are taken into account. More...
 
 group_gatekeeper ($forward=true, $page_owner_guid=null)
 May the current user access item(s) on this page? If the page owner is a group, membership, visibility, and logged in status are taken into account. More...
 
 elgg_entity_gatekeeper ($guid, $type=null, $subtype=null)
 Can the viewer see this entity? More...
 
 elgg_front_page_handler ()
 Front page handler. More...
 
 elgg_error_page_handler ($hook, $type, $result, $params)
 Serve an error page. More...
 
 _elgg_page_handler_init ()
 Initializes the page handler/routing system. More...
 

Function Documentation

_elgg_page_handler_init ( )

Initializes the page handler/routing system.

Returns
void private

Definition at line 293 of file pagehandler.php.

admin_gatekeeper ( )

Alias of elgg_admin_gatekeeper()

Used at the top of a page to mark it as logged in admin or siteadmin only.

Returns
void

Definition at line 100 of file pagehandler.php.

elgg_admin_gatekeeper ( )

Used at the top of a page to mark it as admin only.

Returns
void
Since
1.9.0

Definition at line 83 of file pagehandler.php.

elgg_entity_gatekeeper (   $guid,
  $type = null,
  $subtype = null 
)

Can the viewer see this entity?

Tests if the entity exists and whether the viewer has access to the entity if it does. If the viewer cannot view this entity, it forwards to an appropriate page.

Parameters
int$guidEntity GUID
string$typeOptional required entity type
string$subtypeOptional required entity subtype
Returns
void
Since
1.9.0

Definition at line 185 of file pagehandler.php.

elgg_error_page_handler (   $hook,
  $type,
  $result,
  $params 
)

Serve an error page.

This is registered by Elgg for the 'forward', '404' plugin hook. It can registered for other hooks by plugins or called directly to display an error page.

Parameters
string$hookThe name of the hook
string$typeHttp error code
bool$resultThe current value of the hook
array$paramsParameters related to the hook
Returns
void

Definition at line 251 of file pagehandler.php.

elgg_front_page_handler ( )

Front page handler.

Returns
bool

Definition at line 214 of file pagehandler.php.

elgg_gatekeeper ( )

Used at the top of a page to mark it as logged in users only.

Returns
void
Since
1.9.0

Definition at line 58 of file pagehandler.php.

elgg_group_gatekeeper (   $forward = true,
  $group_guid = null 
)

May the current user access item(s) on this page? If the page owner is a group, membership, visibility, and logged in status are taken into account.

Parameters
bool$forwardIf set to true (default), will forward the page; if set to false, will return true or false.
int$group_guidThe group that owns the page. If not set, this will be pulled from elgg_get_page_owner_guid().
Returns
bool Will return if $forward is set to false.
Since
1.9.0

Definition at line 117 of file pagehandler.php.

elgg_register_page_handler (   $identifier,
  $function 
)

Registers a page handler for a particular identifier.

For example, you can register a function called 'blog_page_handler' for the identifier 'blog' For all URLs http://yoururl/blog/*, the blog_page_handler() function will be called. The part of the URL marked with * above will be exploded on '/' characters and passed as an array to that function. For example, the URL http://yoururl/blog/username/friends/ would result in the call: blog_page_handler(array('username','friends'), blog);

A request to register a page handler with the same identifier as previously registered handler will replace the previous one.

The context is set to the identifier before the registered page handler function is called. For the above example, the context is set to 'blog'.

Page handlers should return true to indicate that they handled the request. Requests not handled are forwarded to the front page with a reason of 404. Plugins can register for the 'forward', '404' plugin hook.

See also
forward()
Parameters
string$identifierThe page type identifier
string$functionYour function name
Returns
bool Depending on success

Definition at line 34 of file pagehandler.php.

elgg_unregister_page_handler (   $identifier)

Unregister a page handler for an identifier.

Note: to replace a page handler, call elgg_register_page_handler()

Parameters
string$identifierThe page type identifier
Since
1.7.2
Returns
void

Definition at line 48 of file pagehandler.php.

gatekeeper ( )

Alias of elgg_gatekeeper()

Used at the top of a page to mark it as logged in users only.

Returns
void

Definition at line 73 of file pagehandler.php.

group_gatekeeper (   $forward = true,
  $page_owner_guid = null 
)

May the current user access item(s) on this page? If the page owner is a group, membership, visibility, and logged in status are taken into account.

Parameters
bool$forwardIf set to true (default), will forward the page; if set to false, will return true or false.
int$page_owner_guidThe current page owner guid. If not set, this will be pulled from elgg_get_page_owner_guid().
Returns
bool Will return if $forward is set to false.

Definition at line 168 of file pagehandler.php.