engine/lib/elgglib.php File Reference

Go to the source code of this file.

Namespaces

namespace  Elgg::Core
 

Activate a plugin or plugins.


Enumerations

enum  ACCESS_DEFAULT
enum  ACCESS_PRIVATE
enum  ACCESS_LOGGED_IN
enum  ACCESS_PUBLIC
enum  ACCESS_FRIENDS
enum  ELGG_ENTITIES_ANY_VALUE
enum  ELGG_ENTITIES_NO_VALUE
enum  REFERRER
enum  REFERER

Functions

 _elgg_autoload ($class)
 Autoload classes.
 elgg_register_classes ($dir)
 Register all files found in $dir as classes Need to be named MyClass.php.
 elgg_register_class ($class, $location)
 Register a classname to a file.
 elgg_register_library ($name, $location)
 Register a php library.
 elgg_load_library ($name)
 Load a php library.
 forward ($location="", $reason= 'system')
 Forward to $location.
 elgg_register_js ($name, $url, $location= 'head', $priority=null)
 Register a JavaScript file for inclusion.
 elgg_unregister_js ($name)
 Unregister a JavaScript file.
 elgg_load_js ($name)
 Load a JavaScript resource on this page.
 elgg_get_loaded_js ($location= 'head')
 Get the JavaScript URLs that are loaded.
 elgg_register_css ($name, $url, $priority=null)
 Register a CSS file for inclusion in the HTML head.
 elgg_unregister_css ($name)
 Unregister a CSS file.
 elgg_load_css ($name)
 Load a CSS file for this page.
 elgg_get_loaded_css ()
 Get the loaded CSS URLs.
 elgg_register_external_file ($type, $name, $url, $location, $priority=500)
 Core registration function for external files.
 elgg_unregister_external_file ($type, $name)
 Unregister an external file.
 elgg_load_external_file ($type, $name)
 Load an external resource for use on this page.
 elgg_get_loaded_external_files ($type, $location)
 Get external resource descriptors.
 elgg_bootstrap_externals_data_structure ($type)
 Bootstraps the externals data structure in $CONFIG.
 elgg_get_file_list ($directory, $exceptions=array(), $list=array(), $extensions=NULL)
 Returns a list of files in $directory.
 sanitise_filepath ($path, $append_slash=TRUE)
 Sanitise file paths ensuring that they begin and end with slashes etc.
 system_messages ($message=null, $register="success", $count=false)
 Queues a message to be displayed.
 count_messages ($register="")
 Counts the number of messages, either globally or in a particular register.
 system_message ($message)
 Display a system message on next page load.
 register_error ($error)
 Display an error on next page load.
 elgg_register_event_handler ($event, $object_type, $callback, $priority=500)
 Register a callback as an Elgg event handler.
 elgg_unregister_event_handler ($event, $object_type, $callback)
 Unregisters a callback for an event.
 elgg_trigger_event ($event, $object_type, $object=null)
 Trigger an Elgg Event and run all handler callbacks registered to that event, type.
 elgg_register_plugin_hook_handler ($hook, $type, $callback, $priority=500)
 Register a callback as a plugin hook handler.
 elgg_unregister_plugin_hook_handler ($hook, $entity_type, $callback)
 Unregister a callback as a plugin hook.
 elgg_trigger_plugin_hook ($hook, $type, $params=null, $returnvalue=null)
 Trigger a Plugin Hook and run all handler callbacks registered to that hook:type.
 _elgg_php_exception_handler ($exception)
 Intercepts, logs, and displays uncaught exceptions.
 _elgg_php_error_handler ($errno, $errmsg, $filename, $linenum, $vars)
 Intercepts catchable PHP errors.
 elgg_log ($message, $level= 'NOTICE')
 Display or log a message.
 elgg_dump ($value, $to_screen=TRUE, $level= 'NOTICE')
 Logs or displays $value.
 elgg_deprecated_notice ($msg, $dep_version, $backtrace_level=1)
 Sends a notice about deprecated use of a function, view, etc.
 current_page_url ()
 Returns the current page's complete URL.
 full_url ()
 Return the full URL of the current page.
 elgg_http_build_url (array $parts, $html_encode=TRUE)
 Builds a URL from the a parts array like one returned by parse_url().
 elgg_add_action_tokens_to_url ($url, $html_encode=FALSE)
 Adds action tokens to URL.
 elgg_http_remove_url_query_element ($url, $element)
 Removes an element from a URL's query string.
 elgg_http_add_url_query_elements ($url, array $elements)
 Adds an element or elements to a URL's query string.
 elgg_http_url_is_identical ($url1, $url2, $ignore_params=array('offset', 'limit'))
 Test if two URLs are functionally identical.
 elgg_extract ($key, array $array, $default=null, $strict=true)
 Checks for $array[$key] and returns its value if it exists, else returns $default.
 elgg_sort_3d_array_by_value (&$array, $element, $sort_order=SORT_ASC, $sort_type=SORT_LOCALE_STRING)
 Sorts a 3d array by specific element.
 ini_get_bool ($ini_get_arg)
 Return the state of a php.ini setting as a bool.
 elgg_get_ini_setting_in_bytes ($setting)
 Returns a PHP INI setting in bytes.
 is_not_null ($string)
 Returns true is string is not empty, false, or null.
 elgg_normalise_plural_options_array ($options, $singulars)
 Normalise the singular keys in an options array to plural keys.
 _elgg_shutdown_hook ()
 Emits a shutdown:system event upon PHP shutdown, but before database connections are dropped.
 elgg_js_page_handler ($page)
 Serve javascript pages.
 elgg_ajax_page_handler ($page)
 Serve individual views for Ajax.
 elgg_css_page_handler ($page)
 Serve CSS.
 elgg_cacheable_view_page_handler ($page, $type)
 Serves a JS or CSS view with headers for caching.
 elgg_sql_reverse_order_by_clause ($order_by)
 Reverses the ordering in an ORDER BY clause.
 elgg_batch_enable_callback ($object)
 Enable objects with an enable() method.
 elgg_batch_disable_callback ($object)
 Disable objects with a disable() method.
 elgg_batch_delete_callback ($object)
 Delete objects with a delete() method.
 elgg_is_valid_options_for_batch_operation ($options, $type)
 Checks if there are some constraints on the options array for potentially dangerous operations.
 elgg_walled_garden_index ($hook, $type, $value, $params)
 Intercepts the index page when Walled Garden mode is enabled.
 _elgg_walled_garden_ajax_handler ($page)
 Serve walled garden sections.
 elgg_walled_garden ()
 Checks the status of the Walled Garden and forwards to a login page if required.
 _elgg_walled_garden_remove_public_access ($hook, $type, $accesses)
 Remove public access for walled gardens.
 _elgg_engine_boot ()
 Boots the engine.
 elgg_init ()
 Elgg's main init.
 elgg_api_test ($hook, $type, $value, $params)
 Adds unit tests for the general API.

Enumeration Type Documentation

Definition at line 2252 of file elgglib.php.

Definition at line 2256 of file elgglib.php.

Definition at line 2254 of file elgglib.php.

Definition at line 2253 of file elgglib.php.

Definition at line 2255 of file elgglib.php.

Definition at line 2266 of file elgglib.php.

Definition at line 2275 of file elgglib.php.

enum REFERER

Definition at line 2294 of file elgglib.php.

enum REFERRER

Definition at line 2284 of file elgglib.php.


Function Documentation

_elgg_autoload ( class  ) 

Autoload classes.

Parameters:
string $class The name of the class
Returns:
void
Exceptions:
Exception private

Definition at line 23 of file elgglib.php.

_elgg_engine_boot (  ) 

Boots the engine.

1. sets error handlers 2. connects to database 3. verifies the installation suceeded 4. loads application configuration 5. loads i18n data 6. loads site configuration

private

Definition at line 2153 of file elgglib.php.

_elgg_php_error_handler ( errno,
errmsg,
filename,
linenum,
vars 
)

Intercepts catchable PHP errors.

Warning:
This function should never be called directly.

Definition at line 1075 of file elgglib.php.

_elgg_php_exception_handler ( exception  ) 

Intercepts, logs, and displays uncaught exceptions.

Warning:
This function should never be called directly.
See also:
http://www.php.net/set-exception-handler
Parameters:
Exception $exception The exception being handled
Returns:
void private

Definition at line 1013 of file elgglib.php.

_elgg_shutdown_hook (  ) 

Emits a shutdown:system event upon PHP shutdown, but before database connections are dropped.

Register for the shutdown:system event to perform functions at the end of page loads.

Warning:
Using this event to perform long-running functions is not very useful. Servers will hold pages until processing is done before sending them out to the browser.
See also:
http://www.php.net/register-shutdown-function
Returns:
void
See also:
register_shutdown_hook() private

Definition at line 1771 of file elgglib.php.

_elgg_walled_garden_ajax_handler ( page  ) 

Serve walled garden sections.

Parameters:
array $page Array of URL segments
Returns:
string private

Definition at line 2086 of file elgglib.php.

_elgg_walled_garden_remove_public_access ( hook,
type,
accesses 
)

Remove public access for walled gardens.

Parameters:
string $hook
string $type
array $accesses
Returns:
array private

Definition at line 2134 of file elgglib.php.

count_messages ( register = ""  ) 

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

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

Definition at line 589 of file elgglib.php.

current_page_url (  ) 

Returns the current page's complete URL.

The current URL is assembled using the network's wwwroot and the request URI in $_SERVER as populated by the web server. This function will include any schemes, usernames and passwords, and ports.

Returns:
string The current page URL.

Definition at line 1308 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 $url Full action URL
bool $html_encode HTML encode the url? (default: false)
Returns:
string URL with action tokens
Since:
1.7.0 http://docs.elgg.org/Tutorials/Actions

Definition at line 1407 of file elgglib.php.

elgg_ajax_page_handler ( page  ) 

Serve individual views for Ajax.

/ajax/view/<name of="" view>="">?<key/value params>

Parameters:
array $page The page array
Returns:
bool ajax private

Definition at line 1815 of file elgglib.php.

elgg_api_test ( hook,
type,
value,
params 
)

Adds unit tests for the general API.

Parameters:
string $hook unit_test
string $type system
array $value array of test files
array $params empty

unit_tests system

Returns:
array private

Definition at line 2239 of file elgglib.php.

elgg_batch_delete_callback ( object  ) 

Delete objects with a delete() method.

Used as a callback for ElggBatch.

Parameters:
object $object The object to disable
Returns:
bool private

Definition at line 1982 of file elgglib.php.

elgg_batch_disable_callback ( object  ) 

Disable objects with a disable() method.

Used as a callback for ElggBatch.

Parameters:
object $object The object to disable
Returns:
bool private

Definition at line 1968 of file elgglib.php.

elgg_batch_enable_callback ( object  ) 

Enable objects with an enable() method.

Used as a callback for ElggBatch.

Parameters:
object $object The object to enable
Returns:
bool private

Definition at line 1954 of file elgglib.php.

elgg_bootstrap_externals_data_structure ( type  ) 

Bootstraps the externals data structure in $CONFIG.

Parameters:
string $type The type of external, js or css. private

Definition at line 431 of file elgglib.php.

elgg_cacheable_view_page_handler ( page,
type 
)

Serves a JS or CSS view with headers for caching.

/<css||js>/name/of/view.<last_cache>.<css||js>

Parameters:
array $page The page array
string $type The type: js or css
Returns:
bool private

Definition at line 1874 of file elgglib.php.

elgg_css_page_handler ( page  ) 

Serve CSS.

Serves CSS from the css views directory with headers for caching control

Parameters:
array $page The page array
Returns:
bool css private

Definition at line 1854 of file elgglib.php.

elgg_deprecated_notice ( msg,
dep_version,
backtrace_level = 1 
)

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

This function either displays or logs the deprecation message, depending upon the deprecation policies in CODING.txt. Logged messages are sent with the level of 'WARNING'. Only admins get visual deprecation notices. When non-admins are logged in, the notices are sent to PHP's log through elgg_dump().

A user-visual message will be displayed if $dep_version is greater than 1 minor releases lower than the current Elgg version, or at all lower than the current Elgg major version.

Note:
This will always at least log a warning. Don't use to pre-deprecate things. This assumes we are releasing in order and deprecating according to policy.
See also:
CODING.txt
Parameters:
string $msg Message to log / display.
string $dep_version Human-readable *release* version: 1.7, 1.8, ...
int $backtrace_level How 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 1239 of file elgglib.php.

elgg_dump ( value,
to_screen = TRUE,
level = 'NOTICE' 
)

Logs or displays $value.

If $to_screen is true, $value is displayed to screen. Else, it is handled by PHP's error_log() function.

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

Parameters:
mixed $value The value
bool $to_screen Display to screen?
string $level The debug level
Returns:
void
Since:
1.7.0

Definition at line 1177 of file elgglib.php.

elgg_extract ( key,
array $  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 $key The key to check.
array $array The array to check against.
mixed $default Default value to return if nothing is found.
bool $strict Return 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

Definition at line 1603 of file elgglib.php.

elgg_get_file_list ( directory,
exceptions = array(),
list = array(),
extensions = NULL 
)

Returns a list of files in $directory.

Only returns files. Does not recurse into subdirs.

Parameters:
string $directory Directory to look in
array $exceptions Array of filenames to ignore
array $list Array of files to append to
mixed $extensions Array 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 463 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 $setting The php.ini setting
Returns:
int
Since:
1.7.0 http://www.php.net/manual/en/function.ini-get.php

Definition at line 1681 of file elgglib.php.

elgg_get_loaded_css (  ) 

Get the loaded CSS URLs.

Returns:
array
Since:
1.8.0

Definition at line 277 of file elgglib.php.

elgg_get_loaded_external_files ( type,
location 
)

Get external resource descriptors.

Parameters:
string $type Type of file: js or css
string $location Page location
Returns:
array
Since:
1.8.0

Definition at line 409 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 226 of file elgglib.php.

elgg_http_add_url_query_elements ( url,
array $  elements 
)

Adds an element or elements to a URL's query string.

Parameters:
string $url The URL
array $elements Key/value pairs to add to the URL
Returns:
string The new URL with the query strings added
Since:
1.7.0

Definition at line 1468 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 $parts Associative array of URL components like parse_url() returns
bool $html_encode HTML Encode the url?
Returns:
string Full URL
Since:
1.7.0

Definition at line 1372 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 $url Full URL
string $element The element to remove
Returns:
string The new URL with the query element removed.
Since:
1.7.0

Definition at line 1440 of file elgglib.php.

elgg_http_url_is_identical ( url1,
url2,
ignore_params = array('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 $url1 First URL
string $url2 Second URL
array $ignore_params GET params to ignore in the comparison
Returns:
bool
Since:
1.8.0

Definition at line 1501 of file elgglib.php.

elgg_init (  ) 

Elgg's main init.

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

init system

Returns:
void private

Definition at line 2182 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 $options Options array
string $type Options type: metadata or annotations
Returns:
bool private

Definition at line 1996 of file elgglib.php.

elgg_js_page_handler ( page  ) 

Serve javascript pages.

Searches for views under js/ and outputs them with special headers for caching control.

Parameters:
array $page The page array
Returns:
bool js private

Definition at line 1800 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 $name Identifier of the CSS file
Returns:
void
Since:
1.8.0

Definition at line 267 of file elgglib.php.

elgg_load_external_file ( type,
name 
)

Load an external resource for use on this page.

Parameters:
string $type Type of file: js or css
string $name The identifier for the file
Returns:
void
Since:
1.8.0

Definition at line 377 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 $name Identifier of the JavaScript resource
Returns:
void
Since:
1.8.0

Definition at line 214 of file elgglib.php.

elgg_load_library ( name  ) 

Load a php library.

Parameters:
string $name The name of the library
Returns:
void
Exceptions:
InvalidParameterException 
Since:
1.8.0

Definition at line 98 of file elgglib.php.

elgg_log ( message,
level = 'NOTICE' 
)

Display or 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.

elgg_dump() outputs all levels but NOTICE to screen by default.

Note:
No messages will be displayed unless debugging has been enabled.
Parameters:
string $message User message
string $level NOTICE | WARNING | ERROR | DEBUG
Returns:
bool
Since:
1.7.0

Definition at line 1126 of file elgglib.php.

elgg_normalise_plural_options_array ( options,
singulars 
)

Normalise the singular keys in an options array to plural keys.

Used in elgg_get_entities*() functions to support shortcutting plural names by singular names.

Parameters:
array $options The options array. $options['keys'] = 'values';
array $singulars A list of singular words to pluralize by adding 's'.
Returns:
array
Since:
1.7.0 private

Definition at line 1733 of file elgglib.php.

elgg_register_class ( class,
location 
)

Register a classname to a file.

Parameters:
string $class The name of the class
string $location The location of the file
Returns:
true
Since:
1.8.0

Definition at line 57 of file elgglib.php.

elgg_register_classes ( dir  ) 

Register all files found in $dir as classes Need to be named MyClass.php.

Parameters:
string $dir The dir to look in
Returns:
void
Since:
1.8.0

Definition at line 40 of file elgglib.php.

elgg_register_css ( name,
url,
priority = null 
)

Register a CSS file for inclusion in the HTML head.

Parameters:
string $name An identifier for the CSS file
string $url URL of the CSS file
int $priority Priority of the CSS file (lower numbers load earlier)
Returns:
bool
Since:
1.8.0

Definition at line 240 of file elgglib.php.

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

Register a callback as an Elgg event handler.

Events are emitted by Elgg when certain actions occur. Plugins can respond to these events or halt them completely by registering a handler as a callback to an event. Multiple handlers can be registered for the same event and will be executed in order of $priority. Any handler returning false will halt the execution chain.

This function is called with the event name, event type, and handler callback name. Setting the optional $priority allows plugin authors to specify when the callback should be run. Priorities for plugins should be 1-1000.

The callback is passed 3 arguments when called: $event, $type, and optional $params.

$event is the name of event being emitted. $type is the type of event or object concerned. $params is an optional parameter passed that can include a related object. See specific event documentation for details on which events pass what parameteres.

If a priority isn't specified it is determined by the order the handler was registered relative to the event and type. For plugins, this generally means the earlier the plugin is in the load order, the earlier the priorities are for any event handlers.

$event and $object_type can use the special keyword 'all'. Handler callbacks registered with $event = all will be called for all events of type $object_type. Similarly, callbacks registered with $object_type = all will be called for all events of type $event, regardless of $object_type. If $event and $object_type both are 'all', the handler callback will be called for all events.

Event handler callbacks are considered in the follow order:

  • Specific registration where 'all' isn't used.
  • Registration where 'all' is used for $event only.
  • Registration where 'all' is used for $type only.
  • Registration where 'all' is used for both.
Warning:
If you use the 'all' keyword, you must have logic in the handler callback to test the passed parameters before taking an action.

When referring to events, the preferred syntax is "event, type".

Definition at line 678 of file elgglib.php.

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

Core registration function for external files.

Parameters:
string $type Type of external resource (js or css)
string $name Identifier used as key
string $url URL
string $location Location in the page to include the file
int $priority Loading priority of the file
Returns:
bool
Since:
1.8.0

Definition at line 293 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).

Parameters:
string $name An identifier for the JavaScript library
string $url URL of the JavaScript file
string $location Page location: head or footer. (default: head)
int $priority Priority of the JS file (lower numbers load earlier)
Returns:
bool
Since:
1.8.0

Definition at line 187 of file elgglib.php.

elgg_register_library ( name,
location 
)

Register a php library.

Parameters:
string $name The name of the library
string $location The location of the file
Returns:
void
Since:
1.8.0

Definition at line 78 of file elgglib.php.

elgg_register_plugin_hook_handler ( hook,
type,
callback,
priority = 500 
)

Register a callback as a plugin hook handler.

Plugin hooks allow developers to losely couple plugins and features by repsonding to and emitting elgg_trigger_plugin_hook() customizable hooks. Handler callbacks can respond to the hook, change the details of the hook, or ignore it.

Multiple handlers can be registered for a plugin hook, and each callback is called in order of priority. If the return value of a handler is not null, that value is passed to the next callback in the call stack. When all callbacks have been run, the final value is passed back to the caller via elgg_trigger_plugin_hook().

Similar to Elgg Events, plugin hook handler callbacks are registered by passing a hook, a type, and a priority.

The callback is passed 4 arguments when called: $hook, $type, $value, and $params.

  • str $hook The name of the hook.
  • str $type The type of hook.
  • mixed $value The return value of the last handler or the default value if no other handlers have been called.
  • mixed $params An optional array of parameters. Used to provide additional information to plugins.

Definition at line 860 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 &$array Array to sort
string $element Element to sort by
int $sort_order PHP sort order {
See also:
http://us2.php.net/array_multisort}
Parameters:
int $sort_type PHP sort type {
See also:
http://us2.php.net/sort}
Returns:
bool

Definition at line 1635 of file elgglib.php.

elgg_sql_reverse_order_by_clause ( order_by  ) 

Reverses the ordering in an ORDER BY clause.

This is achived by replacing asc with desc, or appending desc to the end of the clause.

This is used mostly for elgg_get_entities() and other similar functions.

Parameters:
string $order_by An order by clause private
Returns:
string private

Definition at line 1928 of file elgglib.php.

elgg_trigger_event ( event,
object_type,
object = null 
)

Trigger an Elgg Event and run all handler callbacks registered to that event, type.

This function runs all handlers registered to $event, $object_type or the special keyword 'all' for either or both.

$event is usually a verb: create, update, delete, annotation.

$object_type is usually a noun: object, group, user, annotation, relationship, metadata.

$object is usually an Elgg* object assciated with the event.

Warning:
Elgg events should only be triggered by core. Plugin authors should use trigger_elgg_plugin_hook() instead.

When referring to events, the preferred syntax is "event, type".

Definition at line 762 of file elgglib.php.

elgg_trigger_plugin_hook ( hook,
type,
params = null,
returnvalue = null 
)

Trigger a Plugin Hook and run all handler callbacks registered to that hook:type.

This function runs all handlers regsitered to $hook, $type or the special keyword 'all' for either or both.

Use $params to send additional information to the handler callbacks.

$returnvalue Is the initial value to pass to the handlers, which can then change it. It is useful to use $returnvalue to set defaults. If no handlers are registered, $returnvalue is immediately returned.

$hook is usually a verb: import, get_views, output.

$type is usually a noun: user, ecml, page.

Like Elgg Events, $hook and $type can use the special keyword 'all'. Handler callbacks registered with $hook = all will be called for all hooks of type $type. Similarly, handlers registered with $type = all will be called for all hooks of type $event, regardless of $object_type. If $hook and $type both are 'all', the handler will be called for all hooks.

Definition at line 961 of file elgglib.php.

elgg_unregister_css ( name  ) 

Unregister a CSS file.

Parameters:
string $name The identifier for the CSS file
Returns:
bool
Since:
1.8.0

Definition at line 252 of file elgglib.php.

elgg_unregister_event_handler ( event,
object_type,
callback 
)

Unregisters a callback for an event.

Parameters:
string $event The event type
string $object_type The object type
string $callback The callback
Returns:
void
Since:
1.7

Definition at line 719 of file elgglib.php.

elgg_unregister_external_file ( type,
name 
)

Unregister an external file.

Parameters:
string $type Type of file: js or css
string $name The identifier of the file
Returns:
bool
Since:
1.8.0

Definition at line 352 of file elgglib.php.

elgg_unregister_js ( name  ) 

Unregister a JavaScript file.

Parameters:
string $name The identifier for the JavaScript library
Returns:
bool
Since:
1.8.0

Definition at line 199 of file elgglib.php.

elgg_unregister_plugin_hook_handler ( hook,
entity_type,
callback 
)

Unregister a callback as a plugin hook.

Parameters:
string $hook The name of the hook
string $entity_type The name of the type of entity (eg "user", "object" etc)
callable $callback The PHP callback to be removed
Returns:
void
Since:
1.8.0

Definition at line 901 of file elgglib.php.

elgg_walled_garden (  ) 

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 void private

Definition at line 2111 of file elgglib.php.

elgg_walled_garden_index ( hook,
type,
value,
params 
)
forward ( location = "",
reason = 'system' 
)

Forward to $location.

Sends a 'Location: $location' header and exists. If headers have already been sent, returns FALSE.

Parameters:
string $location URL to forward to browser to. Can be path relative to the network's URL.
string $reason Short explanation for why we're forwarding
Returns:
false False if headers have been sent. Terminates execution if forwarding.
Exceptions:
SecurityException 

Definition at line 139 of file elgglib.php.

full_url (  ) 

Return the full URL of the current page.

Returns:
string The URL

Definition at line 1344 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_arg The INI setting
Returns:
bool Depending on whether it's on or off

Definition at line 1661 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 $string The string to test
Returns:
bool

Definition at line 1712 of file elgglib.php.

register_error ( error  ) 

Display an error on next page load.

See also:
system_messages()
Parameters:
string|array $error Error or errors to add
Returns:
bool

Definition at line 615 of file elgglib.php.

sanitise_filepath ( path,
append_slash = TRUE 
)

Sanitise file paths ensuring that they begin and end with slashes etc.

Parameters:
string $path The path
bool $append_slash Add tailing slash
Returns:
string

Definition at line 495 of file elgglib.php.

system_message ( message  ) 

Display a system message on next page load.

See also:
system_messages()
Parameters:
string|array $message Message or messages to add
Returns:
bool

Definition at line 602 of file elgglib.php.

system_messages ( message = null,
register = "success",
count = false 
)

Queues a message to be displayed.

Messages will not be displayed immediately, but are stored in for later display, usually upon next page load.

The method of displaying these messages differs depending upon plugins and viewtypes. The core default viewtype retrieves messages in views/default/page/shells/default.php and displays messages as javascript popups.

Definition at line 543 of file elgglib.php.

 All Classes Namespaces Files Functions Variables Enumerations
Generated on Sat May 18 00:01:23 2013 for Elgg by  doxygen 1.6.3