Elgg  Version 3.0
Namespaces | Functions | Variables
elgglib.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Updates the advanced settings for the primary site object.
 

Functions

 elgg ()
 Get a reference to the global Application object. More...
 
 forward ($location="", $reason= 'system')
 Forward to $location. More...
 
 elgg_set_http_header ($header, $replace=true)
 Set a response HTTP header. More...
 
 elgg_register_js ($name, $url, $location= 'head', $priority=null)
 Register a JavaScript file for inclusion. More...
 
 elgg_define_js ($name, $config)
 Defines a JS lib as an AMD module. More...
 
 elgg_unregister_js ($name)
 Unregister a JavaScript file. More...
 
 elgg_load_js ($name)
 Load a JavaScript resource on this page. More...
 
 elgg_require_js ($name)
 Request that Elgg load an AMD module onto the page. More...
 
 elgg_unrequire_js ($name)
 Cancel a request to load an AMD module onto the page. More...
 
 elgg_get_loaded_js ($location= 'head')
 Get the JavaScript URLs that are loaded. More...
 
 elgg_register_css ($name, $url, $priority=null)
 Register a CSS file for inclusion in the HTML head. More...
 
 elgg_unregister_css ($name)
 Unregister a CSS file. More...
 
 elgg_load_css ($name)
 Load a CSS file for this page. More...
 
 elgg_get_loaded_css ()
 Get the loaded CSS URLs. More...
 
 elgg_register_external_file ($type, $name, $url, $location, $priority=500)
 Core registration function for external files. More...
 
 elgg_unregister_external_file ($type, $name)
 Unregister an external file. More...
 
 elgg_load_external_file ($type, $name)
 Load an external resource for use on this page. More...
 
 elgg_get_loaded_external_files ($type, $location)
 Get external resource descriptors. More...
 
 elgg_get_file_list ($directory, $exceptions=[], $list=[], $extensions=null)
 Returns a list of files in $directory. More...
 
 count_messages ($register="")
 Counts the number of messages, either globally or in a particular register. More...
 
 system_message ($message)
 Display a system message on next page load. More...
 
 register_error ($error)
 Display an error on next page load. More...
 
 elgg_get_system_messages ()
 Get a copy of the current system messages. More...
 
 elgg_set_system_messages (\Elgg\SystemMessages\RegisterSet $set)
 Set the system messages. More...
 
 elgg_register_event_handler ($event, $object_type, $callback, $priority=500)
 
 elgg_unregister_event_handler ($event, $object_type, $callback)
 Unregisters a callback for an event. More...
 
 elgg_clear_event_handlers ($event, $object_type)
 Clears all callback registrations for a event. More...
 
 elgg_trigger_event ($event, $object_type, $object=null)
 
 elgg_trigger_before_event ($event, $object_type, $object=null)
 Trigger a "Before event" indicating a process is about to begin. More...
 
 elgg_trigger_after_event ($event, $object_type, $object=null)
 Trigger an "After event" indicating a process has finished. More...
 
 elgg_trigger_deprecated_event ($event, $object_type, $object=null, $message=null, $version=null)
 Trigger an event normally, but send a notice about deprecated use if any handlers are registered. More...
 
 elgg_register_plugin_hook_handler ($hook, $type, $callback, $priority=500)
 
 elgg_unregister_plugin_hook_handler ($hook, $entity_type, $callback)
 Unregister a callback as a plugin hook. More...
 
 elgg_clear_plugin_hook_handlers ($hook, $type)
 Clears all callback registrations for a plugin hook. More...
 
 elgg_trigger_plugin_hook ($hook, $type, $params=null, $returnvalue=null)
 
 elgg_trigger_deprecated_plugin_hook ($hook, $type, $params=null, $returnvalue=null, $message=null, $version=null)
 Trigger an plugin hook normally, but send a notice about deprecated use if any handlers are registered. More...
 
 elgg_get_ordered_hook_handlers ($hook, $type)
 Returns an ordered array of hook handlers registered for $hook and $type. More...
 
 elgg_get_ordered_event_handlers ($event, $type)
 Returns an ordered array of event handlers registered for $event and $type. More...
 
 elgg_log ($message, $level=\Psr\Log\LogLevel::NOTICE)
 Log a message. More...
 
 elgg_dump ($value)
 Logs $value to PHP's error_log(). More...
 
 elgg_get_version ($human_readable=false)
 Get the current Elgg version information. More...
 
 elgg_deprecated_notice ($msg, $dep_version, $backtrace_level=1)
 Log a notice about deprecated use of a function, view, etc. More...
 
 elgg_http_build_url (array $parts, $html_encode=true)
 Builds a URL from the a parts array like one returned by parse_url(). More...
 
 elgg_add_action_tokens_to_url ($url, $html_encode=false)
 Adds action tokens to URL. More...
 
 elgg_http_remove_url_query_element ($url, $element)
 Removes an element from a URL's query string. More...
 
 elgg_http_add_url_query_elements ($url, array $elements)
 Sets elements in a URL's query string. More...
 
 elgg_http_url_is_identical ($url1, $url2, $ignore_params=['offset', 'limit'])
 Test if two URLs are functionally identical. More...
 
 elgg_http_get_signed_url ($url, $expires=false)
 Signs provided URL with a SHA256 HMAC key. More...
 
 elgg_http_validate_signed_url ($url)
 Validates if the HMAC signature of the URL is valid. More...
 
 elgg_signed_request_gatekeeper ()
 Validates if the HMAC signature of the current request is valid Issues 403 response if signature is invalid. More...
 
 elgg_extract ($key, $array, $default=null, $strict=true)
 Checks for $array[$key] and returns its value if it exists, else returns $default. More...
 
 elgg_extract_class (array $array, $existing=[], $extract_key= 'class')
 Extract class names from an array, optionally merging into a preexisting set. More...
 
 elgg_call (int $flags, Closure $closure)
 Calls a callable autowiring the arguments using public DI services and applying logic based on flags. More...
 
 elgg_sort_3d_array_by_value (&$array, $element, $sort_order=SORT_ASC, $sort_type=SORT_LOCALE_STRING)
 Sorts a 3d array by specific element. More...
 
 ini_get_bool ($ini_get_arg)
 Return the state of a php.ini setting as a bool. More...
 
 elgg_get_ini_setting_in_bytes ($setting)
 Returns a PHP INI setting in bytes. More...
 
 is_not_null ($string)
 Returns true is string is not empty, false, or null. More...
 
 _elgg_services ()
 Get the global service provider. More...
 
 _elgg_ajax_page_handler ($segments)
 Serve individual views for Ajax. More...
 
 _elgg_is_valid_options_for_batch_operation ($options, $type)
 Checks if there are some constraints on the options array for potentially dangerous operations. More...
 
 _elgg_walled_garden_init ()
 Checks the status of the Walled Garden and forwards to a login page if required. More...
 
 _elgg_walled_garden_menu ($hook, $type, $return_value, $params)
 Adds home link to walled garden menu. More...
 
 _elgg_walled_garden_remove_public_access ($hook, $type, $accesses)
 Remove public access for walled gardens. More...
 
 _elgg_init ()
 Elgg's main init. More...
 
 _elgg_init_cli_commands (\Elgg\Hook $hook)
 Initialize Cli commands. More...
 
 _elgg_register_routes ()
 Register core routes. More...
 
 _elgg_register_actions ()
 Register core actions. More...
 
 _elgg_api_test ($hook, $type, $value, $params)
 Adds unit tests for the general API. More...
 

Variables

return function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks)
 

Function Documentation

_elgg_ajax_page_handler (   $segments)

Serve individual views for Ajax.

/ajax/view/<view_name>?<key/value params> /ajax/form/<action_name>?<key/value params>

Parameters
string[]$segments URL segments (not including "ajax")
Returns
false|ResponseBuilder
See also
elgg_register_ajax_view() ajax

Definition at line 1311 of file elgglib.php.

_elgg_api_test (   $hook,
  $type,
  $value,
  $params 
)

Adds unit tests for the general API.

Parameters
string$hookunit_test
string$typesystem
array$valuearray of test files
array$paramsempty

unit_tests system

Returns
array

Definition at line 1653 of file elgglib.php.

_elgg_init ( )

Elgg's main init.

Handles core actions, the JS pagehandler, and the shutdown function.

init system

Returns
void
See also
::handlePageOutput

Definition at line 1551 of file elgglib.php.

_elgg_init_cli_commands ( \Elgg\Hook  $hook)

Initialize Cli commands.

commands cli

Parameters
\Elgg\Hook$hookHook
Returns
[]

Definition at line 1582 of file elgglib.php.

_elgg_is_valid_options_for_batch_operation (   $options,
  $type 
)

Checks if there are some constraints on the options array for potentially dangerous operations.

Parameters
array$optionsOptions array
string$typeOptions type: metadata, annotation or river
Returns
bool

Definition at line 1401 of file elgglib.php.

_elgg_register_actions ( )

Register core actions.

Returns
void

Definition at line 1616 of file elgglib.php.

_elgg_register_routes ( )

Register core routes.

Returns
void

Definition at line 1602 of file elgglib.php.

_elgg_services ( )

Get the global service provider.

Returns
Examples:
/root/Elgg/engine/classes/ElggBatch.php, /root/Elgg/engine/lib/output.php, and /root/Elgg/engine/lib/views.php.

Definition at line 1292 of file elgglib.php.

_elgg_walled_garden_init ( )

Checks the status of the Walled Garden and forwards to a login page if required.

If the site is in Walled Garden mode, all page except those registered as plugin pages by { public_pages walled_garden} will redirect to a login page.

Since
1.8.0 init system
Returns
void

Definition at line 1472 of file elgglib.php.

_elgg_walled_garden_menu (   $hook,
  $type,
  $return_value,
  $params 
)

Adds home link to walled garden menu.

Parameters
string$hook'register'
string$type'menu:walled_garden'
array$return_valueCurrent menu items
array$paramsOptional menu parameters
Returns
array

Definition at line 1508 of file elgglib.php.

_elgg_walled_garden_remove_public_access (   $hook,
  $type,
  $accesses 
)

Remove public access for walled gardens.

Parameters
string$hook'access:collections:write'
string$type'all'
array$accessescurrent return value
Returns
array

Definition at line 1535 of file elgglib.php.

count_messages (   $register = "")

Counts the number of messages, either globally or in a particular register.

Parameters
string$registerOptionally, the register
Returns
integer The number of messages

Definition at line 345 of file elgglib.php.

elgg ( )

Get a reference to the global Application object.

Returns
Since
2.0.0

Definition at line 19 of file elgglib.php.

elgg_add_action_tokens_to_url (   $url,
  $html_encode = false 
)

Adds action tokens to URL.

As of 1.7.0 action tokens are required on all actions. Use this function to append action tokens to a URL's GET parameters. This will preserve any existing GET parameters.

Note
If you are using { input/form} you don't need to add tokens to the action. The form view automatically handles tokens.
Parameters
string$urlFull action URL
bool$html_encodeHTML encode the url? (default: false)
Returns
string URL with action tokens
Since
1.7.0

Definition at line 894 of file elgglib.php.

elgg_call ( int  $flags,
Closure  $closure 
)

Calls a callable autowiring the arguments using public DI services and applying logic based on flags.

Parameters
int$flagsBitwise flags ELGG_IGNORE_ACCESS ELGG_ENFORCE_ACCESS ELGG_SHOW_DISABLED_ENTITIES ELGG_HIDE_DISABLED_ENTITIES
Closure$closureCallable to call
Returns
mixed

Definition at line 1176 of file elgglib.php.

elgg_clear_event_handlers (   $event,
  $object_type 
)

Clears all callback registrations for a event.

Parameters
string$eventThe name of the event
string$object_typeThe objecttype of the event
Returns
void
Since
2.3

Definition at line 476 of file elgglib.php.

elgg_clear_plugin_hook_handlers (   $hook,
  $type 
)

Clears all callback registrations for a plugin hook.

Parameters
string$hookThe name of the hook
string$typeThe type of the hook
Returns
void
Since
2.0

Definition at line 662 of file elgglib.php.

elgg_define_js (   $name,
  $config 
)

Defines a JS lib as an AMD module.

This is useful for shimming traditional JS or for setting the paths of AMD modules.

Calling multiple times for the same name will:

  • set the preferred path to the last call setting a path
  • overwrite the shimmed AMD modules with the last call setting a shimmed module

Use elgg_require_js($name) to load on the current page.

Calling this function is not needed if your JS are in views named like module/name.js Instead, simply call elgg_require_js("module/name").

Note
The configuration is cached in simplecache, so logic should not depend on user- specific values like get_language().
Parameters
string$nameThe module name
array$configAn array like the following: array 'deps' An array of AMD module dependencies string 'exports' The name of the exported module string 'src' The URL to the JS. Can be relative.
Returns
void
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 119 of file elgglib.php.

elgg_deprecated_notice (   $msg,
  $dep_version,
  $backtrace_level = 1 
)

Log a notice about deprecated use of a function, view, etc.

Parameters
string$msgMessage to log
string$dep_versionHuman-readable release version: 1.7, 1.8, ...
int$backtrace_levelHow many levels back to display the backtrace. Useful if calling from functions that are called from other places (like elgg_view()). Set to -1 for a full backtrace.
Returns
bool
Since
1.7.0

Definition at line 841 of file elgglib.php.

elgg_dump (   $value)

Logs $value to PHP's error_log().

A { debug log} is called. If a handler returns false, it will stop the default logging method.

Note
Use the developers plugin to display logs
Parameters
mixed$valueThe value
Returns
void
Since
1.7.0

Definition at line 802 of file elgglib.php.

elgg_extract (   $key,
  $array,
  $default = null,
  $strict = true 
)

Checks for $array[$key] and returns its value if it exists, else returns $default.

Shorthand for $value = (isset($array['key'])) ? $array['key'] : 'default';

Parameters
string$keyKey to check in the source array
array$arraySource array
mixed$defaultValue to return if key is not found
bool$strictReturn array key if it's set, even if empty. If false, return $default if the array key is unset or empty.
Returns
mixed
Since
1.8.0
Examples:
/root/Elgg/engine/classes/Elgg/FormsService.php, /root/Elgg/engine/classes/ElggBatch.php, and /root/Elgg/engine/lib/views.php.

Definition at line 1131 of file elgglib.php.

elgg_extract_class ( array  $array,
  $existing = [],
  $extract_key = 'class' 
)

Extract class names from an array, optionally merging into a preexisting set.

Parameters
array$arraySource array
string|string[]$existing Existing name(s)
string$extract_keyKey to extract new classes from
Returns
string[]
Since
2.3.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 1153 of file elgglib.php.

elgg_get_file_list (   $directory,
  $exceptions = [],
  $list = [],
  $extensions = null 
)

Returns a list of files in $directory.

Only returns files. Does not recurse into subdirs.

Parameters
string$directoryDirectory to look in
array$exceptionsArray of filenames to ignore
array$listArray of files to append to
mixed$extensionsArray of extensions to allow, null for all. Use a dot: array('.php').
Returns
array Filenames in $directory, in the form $directory/filename.

Definition at line 315 of file elgglib.php.

elgg_get_ini_setting_in_bytes (   $setting)

Returns a PHP INI setting in bytes.

Use this for arithmetic when determining if a file can be uploaded.

Parameters
string$settingThe php.ini setting
Returns
int
Since
1.7.0 http://www.php.net/manual/en/function.ini-get.php
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 1243 of file elgglib.php.

elgg_get_loaded_css ( )

Get the loaded CSS URLs.

Returns
array
Since
1.8.0

Definition at line 244 of file elgglib.php.

elgg_get_loaded_external_files (   $type,
  $location 
)

Get external resource descriptors.

Parameters
string$typeType of file: js or css
string$locationPage location
Returns
array
Since
1.8.0

Definition at line 299 of file elgglib.php.

elgg_get_loaded_js (   $location = 'head')

Get the JavaScript URLs that are loaded.

Parameters
string$location'head' or 'footer'
Returns
array
Since
1.8.0

Definition at line 193 of file elgglib.php.

elgg_get_ordered_event_handlers (   $event,
  $type 
)

Returns an ordered array of event handlers registered for $event and $type.

Parameters
string$eventEvent name
string$typeObject type
Returns
array
Since
2.0.0

Definition at line 767 of file elgglib.php.

elgg_get_ordered_hook_handlers (   $hook,
  $type 
)

Returns an ordered array of hook handlers registered for $hook and $type.

Parameters
string$hookHook name
string$typeHook type
Returns
array
Since
2.0.0

Definition at line 753 of file elgglib.php.

elgg_get_system_messages ( )

Get a copy of the current system messages.

Returns
Since
2.1

Definition at line 379 of file elgglib.php.

elgg_get_version (   $human_readable = false)

Get the current Elgg version information.

Parameters
bool$human_readableWhether to return a human readable version (default: false)
Returns
string|false Depending on success
Since
1.9
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 814 of file elgglib.php.

elgg_http_add_url_query_elements (   $url,
array  $elements 
)

Sets elements in a URL's query string.

Parameters
string$urlThe URL
array$elementsKey/value pairs to set in the URL. If the value is null, the element is removed from the URL.
Returns
string The new URL with the query strings added
Since
1.7.0

Definition at line 942 of file elgglib.php.

elgg_http_build_url ( array  $parts,
  $html_encode = true 
)

Builds a URL from the a parts array like one returned by parse_url().

Note
If only partial information is passed, a partial URL will be returned.
Parameters
array$partsAssociative array of URL components like parse_url() returns 'user' and 'pass' parts are ignored because of security reasons
bool$html_encodeHTML Encode the url?
See also
https://github.com/Elgg/Elgg/pull/8146#issuecomment-91544585
Returns
string Full URL
Since
1.7.0

Definition at line 859 of file elgglib.php.

elgg_http_get_signed_url (   $url,
  $expires = false 
)

Signs provided URL with a SHA256 HMAC key.

Note
Signed URLs do not offer CSRF protection and should not be used instead of action tokens.
Parameters
string$urlURL to sign
string$expiresExpiration time A string suitable for strtotime() Falsey values indicate non-expiring URL
Returns
string

Definition at line 1084 of file elgglib.php.

elgg_http_remove_url_query_element (   $url,
  $element 
)

Removes an element from a URL's query string.

Note
You can send a partial URL string.
Parameters
string$urlFull URL
string$elementThe element to remove
Returns
string The new URL with the query element removed.
Since
1.7.0

Definition at line 928 of file elgglib.php.

elgg_http_url_is_identical (   $url1,
  $url2,
  $ignore_params = ['offset',
'limit']   
)

Test if two URLs are functionally identical.

If $ignore_params is used, neither the name nor its value will be considered when comparing.

The order of GET params doesn't matter.

Parameters
string$url1First URL
string$url2Second URL
array$ignore_paramsGET params to ignore in the comparison
Returns
bool
Since
1.8.0

Definition at line 991 of file elgglib.php.

elgg_http_validate_signed_url (   $url)

Validates if the HMAC signature of the URL is valid.

Parameters
string$urlURL to validate
Returns
bool

Definition at line 1094 of file elgglib.php.

elgg_load_css (   $name)

Load a CSS file for this page.

This must be called before elgg_view_page(). It can be called before the CSS file is registered. If you do not want a CSS file loaded, unregister it.

Parameters
string$nameIdentifier of the CSS file
Returns
void
Since
1.8.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 234 of file elgglib.php.

elgg_load_external_file (   $type,
  $name 
)

Load an external resource for use on this page.

Parameters
string$typeType of file: js or css
string$nameThe identifier for the file
Returns
void
Since
1.8.0

Definition at line 286 of file elgglib.php.

elgg_load_js (   $name)

Load a JavaScript resource on this page.

This must be called before elgg_view_page(). It can be called before the script is registered. If you do not want a script loaded, unregister it.

Parameters
string$nameIdentifier of the JavaScript resource
Returns
void
Since
1.8.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 156 of file elgglib.php.

elgg_log (   $message,
  $level = \Psr\Log\LogLevel::NOTICE 
)

Log a message.

If $level is >= to the debug setting in ->debug, the message will be sent to elgg_dump(). Messages with lower priority than ->debug are ignored.

Note
Use the developers plugin to display logs
Parameters
string$messageUser message
string$levelNOTICE | WARNING | ERROR
Returns
bool
Since
1.7.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 786 of file elgglib.php.

elgg_register_css (   $name,
  $url,
  $priority = null 
)

Register a CSS file for inclusion in the HTML head.

Parameters
string$nameAn identifier for the CSS file
string$urlURL of the CSS file
int$priorityPriority of the CSS file (lower numbers load earlier)
Returns
bool
Since
1.8.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 207 of file elgglib.php.

elgg_register_event_handler (   $event,
  $object_type,
  $callback,
  $priority = 500 
)

Definition at line 449 of file elgglib.php.

elgg_register_external_file (   $type,
  $name,
  $url,
  $location,
  $priority = 500 
)

Core registration function for external files.

Parameters
string$typeType of external resource (js or css)
string$nameIdentifier used as key
string$urlURL
string$locationLocation in the page to include the file
int$priorityLoading priority of the file
Returns
bool
Since
1.8.0

Definition at line 260 of file elgglib.php.

elgg_register_js (   $name,
  $url,
  $location = 'head',
  $priority = null 
)

Register a JavaScript file for inclusion.

This function handles adding JavaScript to a web page. If multiple calls are made to register the same JavaScript file based on the $id variable, only the last file is included. This allows a plugin to add JavaScript from a view that may be called more than once. It also handles more than one plugin adding the same JavaScript.

jQuery plugins often have filenames such as jquery.rating.js. A best practice is to base $name on the filename: "jquery.rating". It is recommended to not use version numbers in the name.

The JavaScript files can be local to the server or remote (such as Google's CDN).

Note
Since 2.0, scripts with location "head" will also be output in the footer, but before those with location "footer".
Parameters
string$nameAn identifier for the JavaScript library
string$urlURL of the JavaScript file
string$locationPage location: head or footer. (default: head)
int$priorityPriority of the JS file (lower numbers load earlier)
Returns
bool
Since
1.8.0
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 91 of file elgglib.php.

elgg_register_plugin_hook_handler (   $hook,
  $type,
  $callback,
  $priority = 500 
)
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 634 of file elgglib.php.

elgg_require_js (   $name)

Request that Elgg load an AMD module onto the page.

Parameters
string$nameThe AMD module name.
Returns
void
Since
1.9.0

Definition at line 168 of file elgglib.php.

elgg_set_http_header (   $header,
  $replace = true 
)

Set a response HTTP header.

See also
header()
Parameters
string$headerHeader
bool$replaceReplace existing header
Returns
void
Since
2.3
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 57 of file elgglib.php.

elgg_set_system_messages ( \Elgg\SystemMessages\RegisterSet  $set)

Set the system messages.

This will overwrite the state of all messages and errors!

Parameters
\Elgg\SystemMessages\RegisterSet$setSet of messages
Returns
void
Since
2.1

Definition at line 390 of file elgglib.php.

elgg_signed_request_gatekeeper ( )

Validates if the HMAC signature of the current request is valid Issues 403 response if signature is invalid.

Returns
void
Exceptions

Definition at line 1105 of file elgglib.php.

elgg_sort_3d_array_by_value ( $array,
  $element,
  $sort_order = SORT_ASC,
  $sort_type = SORT_LOCALE_STRING 
)

Sorts a 3d array by specific element.

Warning
Will re-index numeric indexes.
Note
This operates the same as the built-in sort functions. It sorts the array and returns a bool for success.

Do this: elgg_sort_3d_array_by_value($my_array); Not this: $my_array = elgg_sort_3d_array_by_value($my_array);

Parameters
array$arrayArray to sort
string$elementElement to sort by
int$sort_orderPHP sort order http://us2.php.net/array_multisort
int$sort_typePHP sort type http://us2.php.net/sort
Returns
bool

Definition at line 1198 of file elgglib.php.

elgg_trigger_after_event (   $event,
  $object_type,
  $object = null 
)

Trigger an "After event" indicating a process has finished.

Unlike regular events, all the handlers will be called, their return values ignored.

To register for an after event, append ":after" to the event name when registering.

Parameters
string$eventThe event type. The fired event type will be appended with ":after".
string$object_typeThe object type
string$objectThe object involved in the event
Returns
true
See also
elgg_trigger_before_event()

Definition at line 553 of file elgglib.php.

elgg_trigger_before_event (   $event,
  $object_type,
  $object = null 
)

Trigger a "Before event" indicating a process is about to begin.

Like regular events, a handler returning false will cancel the process and false will be returned.

To register for a before event, append ":before" to the event name when registering.

Parameters
string$eventThe event type. The fired event type will be appended with ":before".
string$object_typeThe object type
mixed$objectThe object involved in the event
Returns
bool False if any handler returned false, otherwise true
See also
elgg_trigger_event()
elgg_trigger_after_event()

Definition at line 534 of file elgglib.php.

elgg_trigger_deprecated_event (   $event,
  $object_type,
  $object = null,
  $message = null,
  $version = null 
)

Trigger an event normally, but send a notice about deprecated use if any handlers are registered.

Parameters
string$eventThe event type
string$object_typeThe object type
string$objectThe object involved in the event
string$messageThe deprecation message
string$versionHuman-readable release version: 1.9, 1.10, ...
Returns
bool
See also
elgg_trigger_event()

Definition at line 570 of file elgglib.php.

elgg_trigger_deprecated_plugin_hook (   $hook,
  $type,
  $params = null,
  $returnvalue = null,
  $message = null,
  $version = null 
)

Trigger an plugin hook normally, but send a notice about deprecated use if any handlers are registered.

Parameters
string$hookThe name of the plugin hook
string$typeThe type of the plugin hook
mixed$paramsSupplied params for the hook
mixed$returnvalueThe value of the hook, this can be altered by registered callbacks
string$messageThe deprecation message
string$versionHuman-readable release version: 1.9, 1.10, ...
Returns
mixed
See also
elgg_trigger_plugin_hook()
Since
3.0

Definition at line 739 of file elgglib.php.

elgg_trigger_event (   $event,
  $object_type,
  $object = null 
)

Definition at line 513 of file elgglib.php.

elgg_trigger_plugin_hook (   $hook,
  $type,
  $params = null,
  $returnvalue = null 
)
elgg_unregister_css (   $name)

Unregister a CSS file.

Parameters
string$nameThe identifier for the CSS file
Returns
bool
Since
1.8.0

Definition at line 219 of file elgglib.php.

elgg_unregister_event_handler (   $event,
  $object_type,
  $callback 
)

Unregisters a callback for an event.

Parameters
string$eventThe event type
string$object_typeThe object type
callable$callbackThe callback. Since 1.11, static method callbacks will match dynamic methods
Returns
bool true if a handler was found and removed
Since
1.7

Definition at line 463 of file elgglib.php.

elgg_unregister_external_file (   $type,
  $name 
)

Unregister an external file.

Parameters
string$typeType of file: js or css
string$nameThe identifier of the file
Returns
bool
Since
1.8.0

Definition at line 273 of file elgglib.php.

elgg_unregister_js (   $name)

Unregister a JavaScript file.

Parameters
string$nameThe identifier for the JavaScript library
Returns
bool
Since
1.8.0

Definition at line 141 of file elgglib.php.

elgg_unregister_plugin_hook_handler (   $hook,
  $entity_type,
  $callback 
)

Unregister a callback as a plugin hook.

Parameters
string$hookThe name of the hook
string$entity_typeThe name of the type of entity (eg "user", "object" etc)
callable$callbackThe PHP callback to be removed. Since 1.11, static method callbacks will match dynamic methods
Returns
void
Since
1.8.0

Definition at line 649 of file elgglib.php.

elgg_unrequire_js (   $name)

Cancel a request to load an AMD module onto the page.

Note
The elgg, jquery, and jquery-ui modules cannot be cancelled.
Parameters
string$nameThe AMD module name.
Returns
void
Since
2.1.0

Definition at line 181 of file elgglib.php.

forward (   $location = "",
  $reason = 'system' 
)

Forward to $location.

Sends a 'Location: $location' header and exits. If headers have already been sent, throws an exception.

Parameters
string$locationURL to forward to browser to. This can be a path relative to the network's URL.
string$reasonShort explanation for why we're forwarding. Set to '404' to forward to error page. Default message is 'system'.
Returns
void
Exceptions
SecurityException|InvalidParameterException

Definition at line 37 of file elgglib.php.

ini_get_bool (   $ini_get_arg)

Return the state of a php.ini setting as a bool.

Warning
Using this on ini settings that are not boolean will be inaccurate!
Parameters
string$ini_get_argThe INI setting
Returns
bool Depending on whether it's on or off

Definition at line 1223 of file elgglib.php.

is_not_null (   $string)

Returns true is string is not empty, false, or null.

Function to be used in array_filter which returns true if $string is not null.

Parameters
string$stringThe string to test
Returns
bool

Definition at line 1278 of file elgglib.php.

register_error (   $error)

Display an error on next page load.

Parameters
string | array$errorError or errors to add
Returns
bool

Definition at line 368 of file elgglib.php.

system_message (   $message)

Display a system message on next page load.

Parameters
string | array$messageMessage or messages to add
Returns
bool

Definition at line 356 of file elgglib.php.

Variable Documentation

See also
::loadCore Do not do work here. Just register for events.

Definition at line 1664 of file elgglib.php.