Elgg  Version 3.0
plugins.php
Go to the documentation of this file.
1 <?php
18  return _elgg_services()->plugins->generateEntities();
19 }
20 
29  return _elgg_services()->plugins->get($plugin_id);
30 }
31 
44  return _elgg_services()->plugins->exists($id);
45 }
46 
55  return _elgg_services()->plugins->getMaxPriority();
56 }
57 
66  return _elgg_services()->plugins->isActive($plugin_id);
67 }
68 
76 function elgg_get_plugins($status = 'active') {
77  return _elgg_services()->plugins->find($status);
78 }
79 
92 function elgg_get_all_plugin_user_settings($user_guid = 0, $plugin_id = null, $return_obj = false) {
94  if (!$plugin) {
95  return [];
96  }
97 
98  $settings = $plugin->getAllUserSettings($user_guid);
99 
100  return $return_obj ? (object) $settings : $settings;
101 }
102 
116  return _elgg_services()->plugins->setUserSetting($name, $value, $user_guid, $plugin_id);
117 }
118 
131  return _elgg_services()->plugins->unsetUserSetting($name, $user_guid, $plugin_id);
132 }
133 
147  return _elgg_services()->plugins->getUserSetting($name, $user_guid, $plugin_id, $default);
148 }
149 
162  return _elgg_services()->plugins->setSetting($name, $value, $plugin_id);
163 }
164 
177  return _elgg_services()->plugins->getSetting($name, $plugin_id, $default);
178 }
179 
191  return _elgg_services()->plugins->unsetSetting($name, $plugin_id);
192 }
193 
204  return _elgg_services()->plugins->unsetAllSettings($plugin_id);
205 }
206 
236  return _elgg_services()->plugins->getEntitiesFromUserSettings($options);
237 }
238 
253  return $value;
254 }
255 
262 function _elgg_plugins_init() {
263 
264  if (elgg_is_admin_logged_in()) {
265  elgg_register_ajax_view('object/plugin/full');
266  elgg_register_ajax_view('object/plugin/details');
267  }
268 
269  elgg_register_plugin_hook_handler('unit_test', 'system', '_elgg_plugins_test');
270 }
271 
275 return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
276  $events->registerHandler('init', 'system', '_elgg_plugins_init');
277 };
$plugin
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
elgg_unset_plugin_setting($name, $plugin_id)
Unsets a plugin setting.
Definition: plugins.php:190
$params
Saves global plugin settings.
Definition: save.php:13
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:57
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.
Definition: plugins.php:92
elgg_set_plugin_setting($name, $value, $plugin_id)
Set a setting for a plugin.
Definition: plugins.php:161
elgg_unset_all_plugin_settings($plugin_id)
Unsets all plugin settings for a plugin.
Definition: plugins.php:203
Events service.
$type
Definition: delete.php:21
elgg_get_plugin_setting($name, $plugin_id, $default=null)
Get setting for a plugin.
Definition: plugins.php:176
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Definition: elgglib.php:634
$options
Elgg admin footer.
Definition: footer.php:6
$user_guid
Validate a user.
Definition: validate.php:6
$id
River item delete action.
Definition: delete.php:6
Base class for events and hooks.
$plugin_id
Definition: save.php:15
elgg_set_plugin_user_setting($name, $value, $user_guid=0, $plugin_id=null)
Set a user specific setting for a plugin.
Definition: plugins.php:115
_elgg_get_max_plugin_priority()
Returns the highest priority of the plugins.
Definition: plugins.php:54
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
Definition: views.php:133
$default
Definition: checkbox.php:35
elgg_get_plugin_user_setting($name, $user_guid=0, $plugin_id=null, $default=null)
Get a user specific setting for a plugin.
Definition: plugins.php:146
elgg_get_plugins($status= 'active')
Returns an ordered list of plugins.
Definition: plugins.php:76
elgg_plugin_exists($id)
Returns if a plugin exists in the system.
Definition: plugins.php:43
_elgg_plugins_init()
Initialize the plugin system.
Definition: plugins.php:262
elgg_unset_plugin_user_setting($name, $user_guid=0, $plugin_id=null)
Unsets a user-specific plugin setting.
Definition: plugins.php:130
elgg_is_active_plugin($plugin_id)
Returns if a plugin is active for a current site.
Definition: plugins.php:65
elgg_get_entities_from_plugin_user_settings(array $options=[])
Returns entities based upon plugin user settings.
Definition: plugins.php:235
_elgg_plugins_test($hook, $type, $value, $params)
Runs unit tests for plugin API.
Definition: plugins.php:251
$value
Definition: debugging.php:7
class
Definition: placeholder.php:21
_elgg_services()
Get the global service provider.
Definition: elgglib.php:1292
$settings
Definition: settings.php:3
_elgg_generate_plugin_entities()
Elgg plugins library Contains functions for managing plugins.
Definition: plugins.php:17
elgg_get_plugin_from_id($plugin_id)
Returns an object with the path $path.
Definition: plugins.php:28