Elgg  Version 4.x
Functions
actions.php File Reference

Go to the source code of this file.

Functions

 elgg_register_action (string $action, $filename= '', string $access= 'logged_in')
 Elgg Actions. More...
 
 elgg_unregister_action (string $action)
 Unregisters an action. More...
 
 elgg_build_hmac ($data)
 Get an HMAC token builder/validator object. More...
 
 elgg_action_exists (string $action)
 Check if an action is registered and its script exists. More...
 
 elgg_is_xhr ()
 Checks whether the request was requested via ajax. More...
 

Function Documentation

elgg_action_exists ( string  $action)

Check if an action is registered and its script exists.

Parameters
string$actionAction name
Returns
bool
Since
1.8.0

Definition at line 66 of file actions.php.

elgg_build_hmac (   $data)

Get an HMAC token builder/validator object.

Parameters
mixed$dataHMAC data string or serializable data
Returns
Since
1.11

Definition at line 54 of file actions.php.

elgg_is_xhr ( )

Checks whether the request was requested via ajax.

Returns
bool whether page was requested via ajax
Since
1.8.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 76 of file actions.php.

elgg_register_action ( string  $action,
  $filename = '',
string  $access = 'logged_in' 
)

Elgg Actions.

Registers an action.

Actions are registered to a script in the system and are executed by the URL http://elggsite.org/action/action_name/.

$filename must be the full path of the file to register or a path relative to the core actions/ dir.

Actions should be namedspaced for your plugin. Example: elgg_register_action('myplugin/save_settings', ...);

Put action files under the actions/<plugin_name> directory of your plugin.

You don't need to use Elgg in your action files.

Parameters
string$actionThe name of the action (eg "register", "account/settings/save")
string$filenameOptionally, the filename where this action is located. If not specified, will assume the action is in elgg/actions/<action>.php
string$accessWho is allowed to execute this action: public, logged_in, admin. (default: logged_in)
Returns
bool

Definition at line 32 of file actions.php.

elgg_unregister_action ( string  $action)

Unregisters an action.

Parameters
string$actionAction name
Returns
bool
Since
1.8.1

Definition at line 43 of file actions.php.