Elgg  Version 4.x
actions.php
Go to the documentation of this file.
1 <?php
32 function elgg_register_action(string $action, $filename = '', string $access = 'logged_in'): bool {
33  return _elgg_services()->actions->register($action, $filename, $access);
34 }
35 
43 function elgg_unregister_action(string $action): bool {
44  return _elgg_services()->actions->unregister($action);
45 }
46 
54 function elgg_build_hmac($data): \Elgg\Security\Hmac {
55  return _elgg_services()->hmac->getHmac($data);
56 }
57 
66 function elgg_action_exists(string $action): bool {
67  return _elgg_services()->actions->exists($action);
68 }
69 
76 function elgg_is_xhr(): bool {
77  return _elgg_services()->request->isXmlHttpRequest();
78 }
if(elgg_view_exists("widgets/{$widget->handler}/edit")) $access
Definition: save.php:19
if(elgg_trigger_plugin_hook('usersettings:save', 'user', $hooks_params, true)) foreach($request->validation() ->all() as $item) $data
Definition: save.php:53
elgg_action_exists(string $action)
Check if an action is registered and its script exists.
Definition: actions.php:66
$action
Definition: subscribe.php:11
$filename
_elgg_services()
Get the global service provider.
Definition: elgglib.php:777
elgg_register_action(string $action, $filename= '', string $access= 'logged_in')
Elgg Actions.
Definition: actions.php:32
elgg_build_hmac($data)
Get an HMAC token builder/validator object.
Definition: actions.php:54
elgg_is_xhr()
Checks whether the request was requested via ajax.
Definition: actions.php:76
elgg_unregister_action(string $action)
Unregisters an action.
Definition: actions.php:43