Elgg  Version 3.0
Functions
deprecated-3.0.php File Reference

Go to the source code of this file.

Functions

 unset_config ($name)
 Removes a config setting. More...
 
 set_config ($name, $value)
 Add or update a config setting. More...
 
 get_config ($name)
 Gets a configuration value. More...
 
 elgg_register_admin_menu_item ($section, $menu_id, $parent_id=null, $priority=100)
 Add an admin area section or child section. More...
 
 register_metadata_as_independent ($type, $subtype= '*')
 Mark entities with a particular type and subtype as having access permissions that can be changed independently from their parent entity. More...
 
 is_metadata_independent ($type, $subtype)
 Determines whether entities of a given type and subtype should not change their metadata in line with their parent entity. More...
 
 elgg_get_entities_from_attributes (array $options=[])
 Gets entities based upon attributes in secondary tables. More...
 
 ban_user ($user_guid, $reason="")
 Ban a user. More...
 
 unban_user ($user_guid)
 Unban a user. More...
 
 make_user_admin ($user_guid)
 Makes user $guid an admin. More...
 
 remove_user_admin ($user_guid)
 Removes user $guid's admin flag. More...
 
 elgg_get_user_validation_status ($user_guid)
 Gets the validation status of a user. More...
 
 elgg_set_user_validation_status ($user_guid, $status, $method= '')
 Set the validation status for a user. More...
 
 set_last_action ($user)
 Sets the last action time of the given user to right now. More...
 
 set_last_login ($user_guid)
 Sets the last logon time of the given user to right now. More...
 
 update_metadata ($id, $name, $value, $value_type)
 Update a specific piece of metadata. More...
 
 create_metadata ($entity_guid, $name, $value, $value_type= '', $ignored1=null, $ignored2=null, $allow_multiple=false)
 Create a new metadata object, or update an existing one. More...
 
 get_user_access_collections ($owner_guid)
 Returns access collections owned by the entity. More...
 
 elgg_get_entities_from_metadata (array $options=[])
 Returns entities based upon metadata. More...
 
 elgg_list_entities_from_metadata ($options)
 Returns a list of entities filtered by provided metadata. More...
 
 elgg_get_entities_from_annotations (array $options=[])
 Returns entities based upon annotations. More...
 
 elgg_list_entities_from_annotations ($options=[])
 Returns a viewable list of entities from annotations. More...
 
 elgg_get_entities_from_relationship ($options)
 Return entities matching a given query joining against a relationship. More...
 
 elgg_list_entities_from_relationship (array $options=[])
 Returns a viewable list of entities by relationship. More...
 
 elgg_get_entities_from_private_settings (array $options=[])
 Returns entities based upon private settings. More...
 
 elgg_list_entities_from_access_id (array $options=[])
 Lists entities from an access collection. More...
 
 elgg_get_entities_from_access_id (array $options=[])
 Return entities based upon access id. More...
 
 elgg_get_entities_from_annotation_calculation ($options)
 Get entities ordered by a mathematical calculation on annotation values. More...
 
 elgg_list_entities_from_annotation_calculation ($options)
 List entities from an annotation calculation. More...
 
 _elgg_set_metastring_based_object_enabled_by_id ($id, $enabled, $type)
 Enables or disables a metastrings-based object by its id. More...
 
 _elgg_get_metastring_based_object_from_id ($id, $type)
 Returns a singular metastring-based object by its ID. More...
 
 _elgg_delete_metastring_based_object_by_id ($id, $type)
 Deletes a metastring-based object by its id. More...
 
 get_metadata_url ($id)
 Get the URL for this metadata. More...
 
 create_annotation ($entity_guid, $name, $value, $value_type= '', $owner_guid=0, $access_id=ACCESS_PRIVATE)
 Create a new annotation. More...
 
 update_annotation ($annotation_id, $name, $value, $value_type, $owner_guid, $access_id)
 Update an annotation. More...
 
 elgg_batch_delete_callback ($object)
 Delete objects with a delete() method. More...
 
 sanitise_filepath ($path, $append_slash=true)
 Sanitise file paths ensuring that they begin and end with slashes etc. More...
 
 get_private_setting ($entity_guid, $name)
 Gets a private setting for an entity. More...
 
 get_all_private_settings ($entity_guid)
 Return an array of all private settings. More...
 
 set_private_setting ($entity_guid, $name, $value)
 Sets a private setting for an entity. More...
 
 remove_private_setting ($entity_guid, $name)
 Deletes a private setting for an entity. More...
 
 remove_all_private_settings ($entity_guid)
 Deletes all private settings for an entity. More...
 
 elgg_batch_enable_callback ($object)
 Enable objects with an enable() method. More...
 
 elgg_batch_disable_callback ($object)
 Disable objects with a disable() method. More...
 
 elgg_register_page_handler ($identifier, callable $function)
 Registers a page handler for a particular identifier. More...
 
 elgg_unregister_page_handler ($identifier)
 Unregister a page handler for an identifier. More...
 
 gatekeeper ()
 Alias of elgg_gatekeeper() More...
 
 admin_gatekeeper ()
 Alias of elgg_admin_gatekeeper() 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_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...
 
 get_data ($query, $callback=null, array $params=[])
 Retrieve rows from the database. More...
 
 get_data_row ($query, $callback=null, array $params=[])
 Retrieve a single row from the database. More...
 
 insert_data ($query, array $params=[])
 Insert a row into the database. More...
 
 update_data ($query, array $params=[], $get_num_rows=false)
 Update a row in the database. More...
 
 delete_data ($query, array $params=[])
 Remove a row from the database. More...
 
 register_translations ($path, $load_all=false, $language=null)
 When given a full path, finds translation files and loads them. More...
 
 reload_all_translations ()
 Reload all translations from all registered paths. More...
 
 elgg_list_registered_entities (array $options=[])
 Returns a viewable list of entities based on the registered types. More...
 
 elgg_get_upgrade_file_version ($filename)
 Returns the version of the upgrade filename. More...
 
 elgg_get_upgrade_files ($upgrade_path=null)
 Returns a list of upgrade files relative to the $upgrade_path dir. More...
 
 get_entity_dates ($type= '', $subtype= '', $container_guid=0, $ignored=0, $order_by= 'e.time_created')
 Returns a list of months in which entities were updated or created. More...
 
 add_group_tool_option ($name, $options=[])
 Adds a group tool option. More...
 
 remove_group_tool_option ($name)
 Removes a group tool option based on name. More...
 
 elgg_get_group_tool_options (\ElggGroup $group=null)
 Function to return available group tool options. More...
 

Function Documentation

_elgg_delete_metastring_based_object_by_id (   $id,
  $type 
)

Deletes a metastring-based object by its id.

Parameters
int$idThe object's ID
string$typeThe object's metastring type: annotation or metadata
Returns
bool

Definition at line 940 of file deprecated-3.0.php.

_elgg_get_metastring_based_object_from_id (   $id,
  $type 
)

Returns a singular metastring-based object by its ID.

Parameters
int$idThe metastring-based object's ID
string$typeThe type: annotation or metadata
Returns

Definition at line 909 of file deprecated-3.0.php.

_elgg_set_metastring_based_object_enabled_by_id (   $id,
  $enabled,
  $type 
)

Enables or disables a metastrings-based object by its id.

Warning
To enable disabled metastrings you must first use access_show_hidden_entities().
Parameters
int$idThe object's ID
string$enabledValue to set to: yes or no
string$typeMetastring type: metadata or annotation
Returns
bool
Exceptions
InvalidParameterException

Definition at line 874 of file deprecated-3.0.php.

add_group_tool_option (   $name,
  $options = [] 
)

Adds a group tool option.

See also
remove_group_tool_option()
Parameters
string$nameTool ID
array$optionsTool config options

string $label Label to appear on the group edit form bool $default_on Is the tool enabled by default? int $priority Module priority

Returns
void
Since
1.5.0

Definition at line 1732 of file deprecated-3.0.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
Exceptions

Definition at line 1359 of file deprecated-3.0.php.

ban_user (   $user_guid,
  $reason = "" 
)

Ban a user.

Parameters
int$user_guidThe user guid
string$reasonA reason
Returns
bool

Definition at line 198 of file deprecated-3.0.php.

create_annotation (   $entity_guid,
  $name,
  $value,
  $value_type = '',
  $owner_guid = 0,
  $access_id = ACCESS_PRIVATE 
)

Create a new annotation.

Parameters
int$entity_guidGUID of entity to be annotated
string$nameName of annotation
string$valueValue of annotation
string$value_typeType of value (default is auto detection)
int$owner_guidOwner of annotation (default is logged in user)
int$access_idAccess level of annotation
Returns
int|bool id on success or false on failure

Definition at line 1002 of file deprecated-3.0.php.

create_metadata (   $entity_guid,
  $name,
  $value,
  $value_type = '',
  $ignored1 = null,
  $ignored2 = null,
  $allow_multiple = false 
)

Create a new metadata object, or update an existing one.

Metadata can be an array by setting allow_multiple to true, but it is an indexed array with no control over the indexing.

Parameters
int$entity_guidThe entity to attach the metadata to
string$nameName of the metadata
string$valueValue of the metadata
string$value_type'text', 'integer', or '' for automatic detection
int$ignored1This argument is not used
null$ignored2This argument is not used
bool$allow_multipleAllow multiple values for one key. Default is false
Returns
int|false id of metadata or false if failure

Definition at line 397 of file deprecated-3.0.php.

delete_data (   $query,
array  $params = [] 
)

Remove a row from the database.

Note
Altering the DB invalidates all queries in the query cache
Parameters
string$queryThe SQL query to run
array$paramsQuery params. E.g. [1, 'steve'] or [':id' => 1, ':name' => 'steve']
Returns
int|false The number of affected rows or false on failure
Exceptions
DatabaseException

Definition at line 1511 of file deprecated-3.0.php.

elgg_batch_delete_callback (   $object)

Delete objects with a delete() method.

Used as a callback for .

Parameters
object$objectThe object to disable
Returns
bool

Definition at line 1065 of file deprecated-3.0.php.

elgg_batch_disable_callback (   $object)

Disable objects with a disable() method.

Used as a callback for .

Parameters
object$objectThe object to disable
Returns
bool

Definition at line 1271 of file deprecated-3.0.php.

elgg_batch_enable_callback (   $object)

Enable objects with an enable() method.

Used as a callback for .

Parameters
object$objectThe object to enable
Returns
bool

Definition at line 1252 of file deprecated-3.0.php.

elgg_get_entities_from_access_id ( array  $options = [])

Return entities based upon access id.

Parameters
array$optionsAny options accepted by elgg_get_entities() and access_id => int The access ID of the entity.
See also
elgg_get_entities()
Returns
mixed If count, int. If not count, array. false on errors.
Since
1.7.0

3.0 Use elgg_get_entities()

Definition at line 770 of file deprecated-3.0.php.

elgg_get_entities_from_annotation_calculation (   $options)

Get entities ordered by a mathematical calculation on annotation values.

Note that this function uses elgg_get_annotations() to return a list of entities ordered by a mathematical calculation on annotation values, and elgg_get_entities_from_annotations() to return a count of entities if $options['count'] is set to a truthy value

Parameters
array$optionsAn options array: 'calculation' => The calculation to use. Must be a valid MySQL function. Defaults to sum. Result selected as 'annotation_calculation'. Don't confuse this "calculation" option with the "annotation_calculation" option to elgg_get_annotations(). This "calculation" option is applied to each entity's set of annotations and is selected as annotation_calculation for that row. See the docs for elgg_get_annotations() for proper use of the "annotation_calculation" option. 'order_by' => The order for the sorting. Defaults to 'annotation_calculation desc'. 'annotation_names' => The names of annotations on the entity. 'annotation_values' => The values of annotations on the entity.

'metadata_names' => The name of metadata on the entity. 'metadata_values' => The value of metadata on the entitiy. 'callback' => Callback function to pass each row through. This function is different from other ege* functions, as it uses a metastring-based getter function elgg_get_annotations(), therefore the callback function should be a derivative of entity_row_to_elggstar() and not of row_to_annotation()

Returns
[]|int An array or a count of entities
See also
elgg_get_annotations()
elgg_get_entities_from_annotations()

Definition at line 819 of file deprecated-3.0.php.

elgg_get_entities_from_annotations ( array  $options = [])

Returns entities based upon annotations.

Entity creation time is selected as maxtime. To sort based upon this, pass 'order_by' => 'maxtime asc' || 'maxtime desc'

See also
elgg_get_entities()
Parameters
array$optionsArray in format:
annotation_names => null|ARR annotations names

annotation_values => null|ARR annotations values

annotation_name_value_pairs => null|ARR (name = 'name', value => 'value',
'operator' => '=', 'case_sensitive' => true) entries.
Currently if multiple values are sent via an array (value => array('value1', 'value2')
the pair's operator will be forced to "IN".

annotation_name_value_pairs_operator => null|STR The operator to use for combining
(name = value) OPERATOR (name = value); default AND

annotation_case_sensitive => BOOL Overall Case sensitive

order_by_annotation => null|ARR (array('name' => 'annotation_text1', 'direction' => ASC|DESC, 'as' => text|integer),

Also supports array('name' => 'annotation_text1')

annotation_owner_guids => null|ARR guids for annotaiton owners

Returns
mixed If count, int. If not count, array. false on errors.
Since
1.7.0

Definition at line 560 of file deprecated-3.0.php.

elgg_get_entities_from_attributes ( array  $options = [])

Gets entities based upon attributes in secondary tables.

Warning
requires that the entity type be specified and there can only be one type.
See also
elgg_get_entities()
Parameters
array$optionsArray in format:
attribute_name_value_pairs => ARR (
                              'name' => 'name',
                              'value' => 'value',
                              'operand' => '=', (optional)
                              'case_sensitive' => false (optional)
                             )
                             If multiple values are sent via
                          an array ('value' => array('value1', 'value2')
                          the pair's operand will be forced to "IN".

attribute_name_value_pairs_operator => null|STR The operator to use for combining
                                   (name = value) OPERATOR (name = value); default is AND
Returns
[]|mixed If count, int. If not count, array. false on errors.
Since
1.9.0
Exceptions
InvalidArgumentException

Definition at line 176 of file deprecated-3.0.php.

elgg_get_entities_from_metadata ( array  $options = [])

Returns entities based upon metadata.

Also accepts all options available to elgg_get_entities(). Supports the singular option shortcut.

Note
Using metadata_names and metadata_values results in a "names IN (...) AND values IN (...)" clause. This is subtly differently than default multiple metadata_name_value_pairs, which use "(name = value) AND (name = value)" clauses.

When in doubt, use name_value_pairs.

To ask for entities that do not have a metadata value, use a custom where clause like this:

$options['wheres'][] = "NOT EXISTS (
    SELECT 1 FROM {$dbprefix}metadata md
    WHERE md.entity_guid = e.guid
        AND md.name = $name
        AND md.value = $value)";
See also
elgg_get_entities()
Parameters
array$optionsArray in format:
metadata_names => null|ARR metadata names

metadata_values => null|ARR metadata values

metadata_name_value_pairs => null|ARR (
                                    name => 'name',
                                    value => 'value',
                                    'operand' => '=',
                                    'case_sensitive' => true
                                   )
                          Currently if multiple values are sent via
                          an array (value => array('value1', 'value2')
                          the pair's operand will be forced to "IN".
                          If passing "IN" as the operand and a string as the value,
                          the value must be a properly quoted and escaped string.

metadata_name_value_pairs_operator => null|STR The operator to use for combining
                                   (name = value) OPERATOR (name = value); default AND

metadata_case_sensitive => BOOL Overall Case sensitive

order_by_metadata => null|ARR array( 'name' => 'metadata_text1', 'direction' => ASC|DESC, 'as' => text|integer ) Also supports array('name' => 'metadata_text1')

Returns
[]|mixed If count, int. If not count, array. false on errors.
Since
1.7.0

Definition at line 497 of file deprecated-3.0.php.

elgg_get_entities_from_private_settings ( array  $options = [])

Returns entities based upon private settings.

Also accepts all options available to elgg_get_entities(). Supports the singular option shortcut.

See also
elgg_get_entities()
Parameters
array$optionsArray in format:
private_setting_names => null|ARR private setting names

private_setting_values => null|ARR metadata values

private_setting_name_value_pairs => null|ARR (
                                    name => 'name',
                                    value => 'value',
                                    'operand' => '=',
                                   )
                             Currently if multiple values are sent via
                          an array (value => array('value1', 'value2')
                          the pair's operand will be forced to "IN".

private_setting_name_value_pairs_operator => null|STR The operator to use for combining
                                   (name = value) OPERATOR (name = value); default AND

private_setting_name_prefix => STR A prefix to apply to all private settings. Used to namespace plugin user settings or by plugins to namespace their own settings.

Returns
mixed int If count, int. If not count, array. false on errors.
Since
1.8.0

Definition at line 730 of file deprecated-3.0.php.

elgg_get_entities_from_relationship (   $options)

Return entities matching a given query joining against a relationship.

By default the function finds relationship targets. E.g.:

// find groups with a particular member: $options = [ 'relationship' => 'member', 'relationship_guid' => $member->guid, ];

// find people the user has friended $options = [ 'relationship' => 'friend', 'relationship_guid' => $user->guid, ];

// find stuff created by friends (not in groups) $options = [ 'relationship' => 'friend', 'relationship_guid' => $user->guid, 'relationship_join_on' => 'container_guid', ];

To find relationship subjects, set "inverse_relationship" to true. E.g.:

// find members of a particular group $options = [ 'relationship' => 'member', 'relationship_guid' => $group->guid, 'inverse_relationship' => true, ];

// find users who have friended the current user $options = [ 'relationship' => 'friend', 'relationship_guid' => $user->guid, 'inverse_relationship' => true, ];

Note
You may want to specify "type" because relationship types might be used for other entities.

To ask for entities that do not have a particular relationship to an entity, use a custom where clause like the following:

$options['wheres'][] = "NOT EXISTS (
    SELECT 1 FROM {$db_prefix}entity_relationships
        WHERE guid_one = e.guid
        AND relationship = '$relationship'
)";
See also
elgg_get_entities()
Parameters
array$optionsArray in format:

relationship => null|STR Type of the relationship. E.g. "member"

relationship_guid => null|INT GUID of the subject of the relationship, unless "inverse_relationship" is set to true, in which case this will specify the target.

inverse_relationship => false|BOOL Are we searching for relationship subjects? By default, the query finds targets of relationships.

relationship_join_on => null|STR How the entities relate: guid (default), container_guid, or owner_guid Examples using the relationship 'friend':

  1. use 'guid' if you want the user's friends
  2. use 'owner_guid' if you want the entities the user's friends own (including in groups)
  3. use 'container_guid' if you want the entities in the user's personal space (non-group)

relationship_created_time_lower => null|INT Relationship created time lower boundary in epoch time

relationship_created_time_upper => null|INT Relationship created time upper boundary in epoch time

Returns
[]|mixed If count, int. If not count, array. false on errors.
Since
1.7.0

Definition at line 668 of file deprecated-3.0.php.

elgg_get_group_tool_options ( \ElggGroup  $group = null)

Function to return available group tool options.

Parameters
\ElggGroup$groupoptional group
Returns
Collection|Tool[]

Definition at line 1772 of file deprecated-3.0.php.

elgg_get_upgrade_file_version (   $filename)

Returns the version of the upgrade filename.

Parameters
string$filenameThe upgrade filename. No full path.
Returns
int|false
Since
1.8.0

Definition at line 1629 of file deprecated-3.0.php.

elgg_get_upgrade_files (   $upgrade_path = null)

Returns a list of upgrade files relative to the $upgrade_path dir.

Parameters
string$upgrade_pathThe directory that has upgrade scripts
Returns
array|false

Definition at line 1649 of file deprecated-3.0.php.

elgg_get_user_validation_status (   $user_guid)

Gets the validation status of a user.

Parameters
int$user_guidThe user's GUID
Returns
bool|null Null means status was not set for this user.
Since
1.8.0

Definition at line 278 of file deprecated-3.0.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.
Exceptions
InvalidParameterException
SecurityException
Since
1.9.0

Definition at line 1399 of file deprecated-3.0.php.

elgg_list_entities_from_access_id ( array  $options = [])

Lists entities from an access collection.

Parameters
array$optionsSee elgg_list_entities() and elgg_get_entities_from_access_id()
See also
elgg_list_entities()
elgg_get_entities_from_access_id()
Returns
string

Definition at line 750 of file deprecated-3.0.php.

elgg_list_entities_from_annotation_calculation (   $options)

List entities from an annotation calculation.

See also
elgg_get_entities_from_annotation_calculation()
Parameters
array$optionsAn options array.
Returns
string

Definition at line 843 of file deprecated-3.0.php.

elgg_list_entities_from_annotations (   $options = [])

Returns a viewable list of entities from annotations.

Parameters
array$optionsOptions array
See also
elgg_get_entities_from_annotations()
elgg_list_entities()
Returns
string

Definition at line 580 of file deprecated-3.0.php.

elgg_list_entities_from_metadata (   $options)

Returns a list of entities filtered by provided metadata.

See also
elgg_get_entities()
Parameters
array$optionsOptions array
Returns
array
Since
1.7.0

Definition at line 517 of file deprecated-3.0.php.

elgg_list_entities_from_relationship ( array  $options = [])

Returns a viewable list of entities by relationship.

Parameters
array$optionsOptions array for retrieval of entities
See also
elgg_list_entities()
elgg_get_entities_from_relationship()
Returns
string The viewable list of entities

Definition at line 688 of file deprecated-3.0.php.

elgg_list_registered_entities ( array  $options = [])

Returns a viewable list of entities based on the registered types.

See also
elgg_view_entity_list()
Parameters
array$optionsAny elgg_get_entity() options plus:
full_view => BOOL Display full view entities

list_type_toggle => BOOL Display gallery / list switch

allowed_types => true|ARRAY True to show all types or an array of valid types.

pagination => BOOL Display pagination links
Returns
string A viewable list of entities
Since
1.7.0

Definition at line 1569 of file deprecated-3.0.php.

elgg_register_admin_menu_item (   $section,
  $menu_id,
  $parent_id = null,
  $priority = 100 
)

Add an admin area section or child section.

This is a wrapper for elgg_register_menu_item().

Used in conjuction with http://elgg.org/admin/section_id/child_section style page handler. See the documentation at the top of this file for more details on that.

The text of the menu item is obtained from elgg_echo(admin:$parent_id:$menu_id)

This function handles registering the parent if it has not been registered.

Parameters
string$sectionThe menu section to add to
string$menu_idThe unique ID of section
string$parent_idIf a child section, the parent section id
int$priorityThe menu item priority
Returns
bool
Since
1.8.0

Definition at line 86 of file deprecated-3.0.php.

elgg_register_page_handler (   $identifier,
callable  $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
callable$functionYour function name
Returns
bool Depending on success
See also
elgg_register_route()

Definition at line 1307 of file deprecated-3.0.php.

elgg_set_user_validation_status (   $user_guid,
  $status,
  $method = '' 
)

Set the validation status for a user.

Parameters
int$user_guidThe user's GUID
bool$statusValidated (true) or unvalidated (false)
string$methodOptional method to say how a user was validated
Returns
bool
Since
1.8.0

Definition at line 300 of file deprecated-3.0.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 1327 of file deprecated-3.0.php.

gatekeeper ( )

Alias of elgg_gatekeeper()

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

Returns
void
Exceptions

Definition at line 1345 of file deprecated-3.0.php.

get_all_private_settings (   $entity_guid)

Return an array of all private settings.

Parameters
int$entity_guidThe entity GUID
Returns
string[] empty array if no settings
See also
set_private_setting()
get_private_settings()
remove_private_setting()
remove_all_private_settings()

Definition at line 1135 of file deprecated-3.0.php.

get_config (   $name)

Gets a configuration value.

Plugin authors should use elgg_get_config().

Parameters
string$nameThe name of the config value
Returns
mixed|null
See also
set_config()
unset_config()

Definition at line 59 of file deprecated-3.0.php.

get_data (   $query,
  $callback = null,
array  $params = [] 
)

Retrieve rows from the database.

Queries are executed with Elgg\Database::getResultsandresultsareretrievedwith@link\PDO::fetchObject().Ifacallbackfunction$callbackisdefined,eachrowwillbepassedasthesingleargumentto$callback.Ifnocallbackfunctionisdefined,theentireresultsetisreturnedasanarray.@paramstring$queryThequerybeingpassed.@paramcallable$callbackOptionally,thenameofafunctiontocallbacktooneachrow@paramarray$paramsQueryparams.E.g.[1,'steve']or[':id'=>1,':name'=>'steve']@returnarrayAnarrayofdatabaseresultobjectsorcallbackfunctionresults.Ifthequeryreturnednothing,anemptyarray.@throwsDatabaseException\xrefitemdeprecated80.

Definition at line 1438 of file deprecated-3.0.php.

get_data_row (   $query,
  $callback = null,
array  $params = [] 
)

Retrieve a single row from the database.

Similar to get_data() but returns only the first row matched. If a callback function $callback is specified, the row will be passed as the only argument to $callback.

Parameters
string$queryThe query to execute.
callable$callbackA callback function to apply to the row
array$paramsQuery params. E.g. [1, 'steve'] or [':id' => 1, ':name' => 'steve']
Returns
mixed A single database result object or the result of the callback function.
Exceptions
DatabaseException

Definition at line 1458 of file deprecated-3.0.php.

get_entity_dates (   $type = '',
  $subtype = '',
  $container_guid = 0,
  $ignored = 0,
  $order_by = 'e.time_created' 
)

Returns a list of months in which entities were updated or created.

Use this to generate a list of archives by month for when entities were added or updated.

Warning
Months are returned in the form YYYYMM.
Parameters
string$typeThe type of entity
string$subtypeThe subtype of entity
int$container_guidThe container GUID that the entities belong to
int$ignoredIgnored parameter
string$order_byOrder_by SQL order by clause
Returns
array|false Either an array months as YYYYMM, or false on failure

Definition at line 1701 of file deprecated-3.0.php.

get_metadata_url (   $id)

Get the URL for this metadata.

By default this links to the export handler in the current view.

Parameters
int$idMetadata ID
Returns
mixed

Definition at line 978 of file deprecated-3.0.php.

get_private_setting (   $entity_guid,
  $name 
)

Gets a private setting for an entity.

Plugin authors can set private data on entities. By default private data will not be searched or exported.

Note
Internal: Private data is used to store settings for plugins and user settings.
Parameters
int$entity_guidThe entity GUID
string$nameThe name of the setting
Returns
mixed The setting value, or null if does not exist
See also
set_private_setting()
get_all_private_settings()
remove_private_setting()
remove_all_private_settings()

Definition at line 1106 of file deprecated-3.0.php.

get_user_access_collections (   $owner_guid)

Returns access collections owned by the entity.

See also
add_access_collection()
get_members_of_access_collection()
Parameters
int$owner_guidGUID of the owner
Returns
[]|false

Definition at line 432 of file deprecated-3.0.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 1377 of file deprecated-3.0.php.

insert_data (   $query,
array  $params = [] 
)

Insert a row into the database.

Note
Altering the DB invalidates all queries in the query cache
Parameters
string$queryThe query to execute.
array$paramsQuery params. E.g. [1, 'steve'] or [':id' => 1, ':name' => 'steve']
Returns
int|false The database id of the inserted row if a AUTO_INCREMENT field is defined, 0 if not, and false on failure.
Exceptions
DatabaseException

Definition at line 1476 of file deprecated-3.0.php.

is_metadata_independent (   $type,
  $subtype 
)

Determines whether entities of a given type and subtype should not change their metadata in line with their parent entity.

Parameters
string$typeThe type - object, user, etc
string$subtypeThe entity subtype
Returns
bool

Definition at line 142 of file deprecated-3.0.php.

make_user_admin (   $user_guid)

Makes user $guid an admin.

Parameters
int$user_guidUser guid
Returns
bool

Definition at line 238 of file deprecated-3.0.php.

register_metadata_as_independent (   $type,
  $subtype = '*' 
)

Mark entities with a particular type and subtype as having access permissions that can be changed independently from their parent entity.

Parameters
string$typeThe type - object, user, etc
string$subtypeThe subtype; all subtypes by default
Returns
void

Definition at line 127 of file deprecated-3.0.php.

register_translations (   $path,
  $load_all = false,
  $language = null 
)

When given a full path, finds translation files and loads them.

Parameters
string$pathFull path
bool$load_allIf true all languages are loaded, if false only the current language + en are loaded
string$languageLanguage code if other than current + en
Returns
bool success

Definition at line 1527 of file deprecated-3.0.php.

reload_all_translations ( )

Reload all translations from all registered paths.

This is only called by functions which need to know all possible translations.

Returns
void

Definition at line 1543 of file deprecated-3.0.php.

remove_all_private_settings (   $entity_guid)

Deletes all private settings for an entity.

Parameters
int$entity_guidThe Entity GUID
Returns
bool
See also
get_private_setting()
get_all_private_settings()
set_private_setting()
remove_private_settings()

Definition at line 1225 of file deprecated-3.0.php.

remove_group_tool_option (   $name)

Removes a group tool option based on name.

See also
add_group_tool_option()
Parameters
string$nameName of the group tool option
Returns
void
Since
1.7.5

Definition at line 1758 of file deprecated-3.0.php.

remove_private_setting (   $entity_guid,
  $name 
)

Deletes a private setting for an entity.

Parameters
int$entity_guidThe Entity GUID
string$nameThe name of the setting
Returns
bool
See also
get_private_setting()
get_all_private_settings()
set_private_setting()
remove_all_private_settings()

Definition at line 1196 of file deprecated-3.0.php.

remove_user_admin (   $user_guid)

Removes user $guid's admin flag.

Parameters
int$user_guidUser GUID
Returns
bool

Definition at line 258 of file deprecated-3.0.php.

sanitise_filepath (   $path,
  $append_slash = true 
)

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

Parameters
string$pathThe path
bool$append_slashAdd tailing slash
Returns
string

Definition at line 1081 of file deprecated-3.0.php.

set_config (   $name,
  $value 
)

Add or update a config setting.

Plugin authors should use elgg_set_config().

If the config name already exists, it will be updated to the new value.

Parameters
string$nameThe name of the configuration value
mixed$valueIts value
Returns
bool
See also
unset_config()
get_config()

Definition at line 40 of file deprecated-3.0.php.

set_last_action (   $user)

Sets the last action time of the given user to right now.

Parameters
ElggUser | int$userThe user or GUID
Returns
void

Definition at line 320 of file deprecated-3.0.php.

set_last_login (   $user_guid)

Sets the last logon time of the given user to right now.

Parameters
int$user_guidThe user GUID
Returns
void

Definition at line 341 of file deprecated-3.0.php.

set_private_setting (   $entity_guid,
  $name,
  $value 
)

Sets a private setting for an entity.

Parameters
int$entity_guidThe entity GUID
string$nameThe name of the setting
string$valueThe value of the setting
Returns
bool
See also
get_private_setting()
get_all_private_settings()
remove_private_setting()
remove_all_private_settings()

Definition at line 1166 of file deprecated-3.0.php.

unban_user (   $user_guid)

Unban a user.

Parameters
int$user_guidUnban a user.
Returns
bool

Definition at line 218 of file deprecated-3.0.php.

unset_config (   $name)

Removes a config setting.

Parameters
string$nameThe name of the field.
Returns
bool Success or failure
See also
get_config()
set_config()

Definition at line 18 of file deprecated-3.0.php.

update_annotation (   $annotation_id,
  $name,
  $value,
  $value_type,
  $owner_guid,
  $access_id 
)

Update an annotation.

Parameters
int$annotation_idAnnotation ID
string$nameName of annotation
string$valueValue of annotation
string$value_typeType of value
int$owner_guidOwner of annotation
int$access_idAccess level of annotation
Returns
bool

Definition at line 1033 of file deprecated-3.0.php.

update_data (   $query,
array  $params = [],
  $get_num_rows = false 
)

Update a row in the database.

Note
Altering the DB invalidates all queries in the query cache
Parameters
string$queryThe query to run.
array$paramsQuery params. E.g. [1, 'steve'] or [':id' => 1, ':name' => 'steve']
bool$get_num_rowsReturn the number of rows affected (default: false).
Returns
bool
Exceptions
DatabaseException

Definition at line 1494 of file deprecated-3.0.php.

update_metadata (   $id,
  $name,
  $value,
  $value_type 
)

Update a specific piece of metadata.

Parameters
int$idID of the metadata to update
string$nameMetadata name
string$valueMetadata value
string$value_typeValue type
Returns
bool

Definition at line 364 of file deprecated-3.0.php.