Elgg  Version 3.0
Functions | Variables
plugins.php File Reference

Go to the source code of this file.

Functions

 _elgg_generate_plugin_entities ()
 Elgg plugins library Contains functions for managing plugins. More...
 
 elgg_get_plugin_from_id ($plugin_id)
 Returns an object with the path $path. More...
 
 elgg_plugin_exists ($id)
 Returns if a plugin exists in the system. More...
 
 _elgg_get_max_plugin_priority ()
 Returns the highest priority of the plugins. More...
 
 elgg_is_active_plugin ($plugin_id)
 Returns if a plugin is active for a current site. More...
 
 elgg_get_plugins ($status= 'active')
 Returns an ordered list of plugins. More...
 
 elgg_get_all_plugin_user_settings ($user_guid=0, $plugin_id=null, $return_obj=false)
 Returns an array of all plugin user settings for a user. More...
 
 elgg_set_plugin_user_setting ($name, $value, $user_guid=0, $plugin_id=null)
 Set a user specific setting for a plugin. More...
 
 elgg_unset_plugin_user_setting ($name, $user_guid=0, $plugin_id=null)
 Unsets a user-specific plugin setting. More...
 
 elgg_get_plugin_user_setting ($name, $user_guid=0, $plugin_id=null, $default=null)
 Get a user specific setting for a plugin. More...
 
 elgg_set_plugin_setting ($name, $value, $plugin_id)
 Set a setting for a plugin. More...
 
 elgg_get_plugin_setting ($name, $plugin_id, $default=null)
 Get setting for a plugin. More...
 
 elgg_unset_plugin_setting ($name, $plugin_id)
 Unsets a plugin setting. More...
 
 elgg_unset_all_plugin_settings ($plugin_id)
 Unsets all plugin settings for a plugin. More...
 
 elgg_get_entities_from_plugin_user_settings (array $options=[])
 Returns entities based upon plugin user settings. More...
 
 _elgg_plugins_test ($hook, $type, $value, $params)
 Runs unit tests for plugin API. More...
 
 _elgg_plugins_init ()
 Initialize the plugin system. More...
 

Variables

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

Function Documentation

_elgg_generate_plugin_entities ( )

Elgg plugins library Contains functions for managing plugins.

Discovers plugins in the plugins_path setting and creates entities for them if they don't exist. If there are plugins with entities but not actual files, will disable the entities and mark as inactive. The object holds config data, so don't delete.

Returns
bool
Since
1.8.0

Definition at line 17 of file plugins.php.

_elgg_get_max_plugin_priority ( )

Returns the highest priority of the plugins.

Returns
int
Since
1.8.0

Definition at line 54 of file plugins.php.

_elgg_plugins_init ( )

Initialize the plugin system.

Returns
void

Definition at line 262 of file plugins.php.

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

Runs unit tests for plugin API.

Parameters
string$hookunit_test
string$typesystem
mixed$valueArray of tests
mixed$paramsParams
Returns
array

Definition at line 251 of file plugins.php.

elgg_get_all_plugin_user_settings (   $user_guid = 0,
  $plugin_id = null,
  $return_obj = false 
)

Returns an array of all plugin user settings for a user.

Parameters
int$user_guidThe user GUID or 0 for the currently logged in user.
string$plugin_idThe plugin ID (Required)
bool$return_objReturn settings as an object? This can be used to in reusable views where the settings are passed as $vars['entity'].
Returns
array|object
Since
1.8.0
See also
::getAllUserSettings()

Definition at line 92 of file plugins.php.

elgg_get_entities_from_plugin_user_settings ( array  $options = [])

Returns entities based upon plugin user settings.

Takes all the options for elgg_get_entities_from_private_settings() in addition to the ones below.

Parameters
array$optionsArray in the format:
plugin_id => STR The plugin id. Required.

plugin_user_setting_names => null|ARR private setting names

plugin_user_setting_values => null|ARR metadata values

plugin_user_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".

plugin_user_setting_name_value_pairs_operator => null|STR The operator to use for combining
                                   (name = value) OPERATOR (name = value); default AND
Returns
mixed int If count, int. If not count, array. false on errors.
Since
1.8.0

Definition at line 235 of file plugins.php.

elgg_get_plugin_from_id (   $plugin_id)

Returns an object with the path $path.

Parameters
string$plugin_idThe id (dir name) of the plugin. NOT the guid.
Returns
|null
Since
1.8.0

Definition at line 28 of file plugins.php.

elgg_get_plugin_setting (   $name,
  $plugin_id,
  $default = null 
)

Get setting for a plugin.

Parameters
string$nameThe name of the setting.
string$plugin_idThe plugin ID (Required)
mixed$defaultThe default value to return if none is set
Returns
mixed
Since
1.8.0
See also
::getSetting()

Definition at line 176 of file plugins.php.

elgg_get_plugin_user_setting (   $name,
  $user_guid = 0,
  $plugin_id = null,
  $default = null 
)

Get a user specific setting for a plugin.

Parameters
string$nameThe name of the setting.
int$user_guidThe user GUID or 0 for the currently logged in user.
string$plugin_idThe plugin ID (Required)
mixed$defaultThe default value to return if none is set
Returns
mixed
Since
1.8.0
See also
::getUserSetting()

Definition at line 146 of file plugins.php.

elgg_get_plugins (   $status = 'active')

Returns an ordered list of plugins.

Parameters
string$statusThe status of the plugins. active, inactive, or all.
Returns
[]
Since
1.8.0

Definition at line 76 of file plugins.php.

elgg_is_active_plugin (   $plugin_id)

Returns if a plugin is active for a current site.

Parameters
string$plugin_idThe plugin ID
Since
1.8.0
Returns
bool

Definition at line 65 of file plugins.php.

elgg_plugin_exists (   $id)

Returns if a plugin exists in the system.

Warning
This checks only plugins that are registered in the system! If the plugin cache is outdated, be sure to regenerate it with _elgg_generate_plugin_objects() first.
Parameters
string$idThe plugin ID.
Since
1.8.0
Returns
bool

Definition at line 43 of file plugins.php.

elgg_set_plugin_setting (   $name,
  $value,
  $plugin_id 
)

Set a setting for a plugin.

Parameters
string$nameThe name of the setting - note, can't be "title".
mixed$valueThe value.
string$plugin_idThe plugin ID (Required)
Returns
bool
Since
1.8.0
See also
::setSetting()

Definition at line 161 of file plugins.php.

elgg_set_plugin_user_setting (   $name,
  $value,
  $user_guid = 0,
  $plugin_id = null 
)

Set a user specific setting for a plugin.

Parameters
string$nameThe name. Note: cannot be "title".
mixed$valueThe value.
int$user_guidThe user GUID or 0 for the currently logged in user.
string$plugin_idThe plugin ID (Required)
Returns
bool
Since
1.8.0
See also
::setUserSetting()

Definition at line 115 of file plugins.php.

elgg_unset_all_plugin_settings (   $plugin_id)

Unsets all plugin settings for a plugin.

Parameters
string$plugin_idThe plugin ID (Required)
Returns
bool
Since
1.8.0
See also
::unsetAllSettings()

Definition at line 203 of file plugins.php.

elgg_unset_plugin_setting (   $name,
  $plugin_id 
)

Unsets a plugin setting.

Parameters
string$nameThe name of the setting.
string$plugin_idThe plugin ID (Required)
Returns
bool
Since
1.8.0
See also
::unsetSetting()

Definition at line 190 of file plugins.php.

elgg_unset_plugin_user_setting (   $name,
  $user_guid = 0,
  $plugin_id = null 
)

Unsets a user-specific plugin setting.

Parameters
string$nameName of the setting
int$user_guidThe user GUID or 0 for the currently logged in user.
string$plugin_idThe plugin ID (Required)
Returns
bool
Since
1.8.0
See also
::unsetUserSetting()

Definition at line 130 of file plugins.php.

Variable Documentation

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

Definition at line 275 of file plugins.php.