39         $plugin_dirs = array();
 
   40         $handle = opendir($dir);
 
   43             while ($plugin_dir = readdir($handle)) {
 
   45                 if (substr($plugin_dir, 0, 1) !== 
'.' && is_dir($dir . $plugin_dir)) {
 
   46                     $plugin_dirs[] = $plugin_dir;
 
   79             'subtype' => 
'plugin',
 
   80             'selects' => array(
'plugin_oe.*'),
 
   81             'joins' => array(
"JOIN {$db_prefix}objects_entity plugin_oe on plugin_oe.guid = e.guid"),
 
   87         if (!$known_plugins) {
 
   88             $known_plugins = array();
 
   93         foreach ($known_plugins as $i => 
$plugin) {
 
   98                 unset($known_plugins[$i]);
 
  101             $id_map[
$plugin->getID()] = $i;
 
  106         if (!$physical_plugins) {
 
  115                 $plugin = $known_plugins[$index];
 
  124                 unset($known_plugins[$index]);
 
  136         foreach ($known_plugins as 
$plugin) {
 
  186             'subtype' => 
'plugin',
 
  187             'joins' => array(
"JOIN {$db_prefix}objects_entity oe on oe.guid = e.guid"),
 
  188             'selects' => array(
"oe.title", 
"oe.description"),
 
  189             'wheres' => array(
"oe.title = '$plugin_id'"),
 
  216         return (
$plugin) ? true : 
false;
 
  230         $q = 
"SELECT MAX(CAST(ps.value AS unsigned)) as max 
  231             FROM {$db_prefix}entities e, {$db_prefix}private_settings ps 
  232             WHERE ps.name = '$priority' 
  233             AND ps.entity_guid = e.guid 
  234             AND e.type = 'object' and e.subtype = $plugin_subtype";
 
  238             $max = 
$data[0]->max;
 
  244         return ($max) ? $max : 1;
 
  291         if (!$plugins_path) {
 
  296         if (file_exists(
"$plugins_path/disabled")) {
 
  317                 } 
catch (Exception 
$e) {
 
  319                     $msg = 
_elgg_services()->translator->translate(
'PluginException:CannotStart',
 
  339     function find($status = 
'active', $site_guid = 
null) {
 
  345             $site_guid = 
$site->guid;
 
  351             'subtype' => 
'plugin',
 
  353             'selects' => array(
'plugin_oe.*'),
 
  355                 "JOIN {$db_prefix}private_settings ps on ps.entity_guid = e.guid",
 
  356                 "JOIN {$db_prefix}objects_entity plugin_oe on plugin_oe.guid = e.guid" 
  358             'wheres' => array(
"ps.name = '$priority'"),
 
  359             'order_by' => 
"CAST(ps.value as unsigned), e.guid",
 
  365                 $options[
'relationship'] = 
'active_plugin';
 
  366                 $options[
'relationship_guid'] = $site_guid;
 
  367                 $options[
'inverse_relationship'] = 
true;
 
  371                 $options[
'wheres'][] = 
"NOT EXISTS ( 
  372                         SELECT 1 FROM {$db_prefix}entity_relationships active_er 
  373                         WHERE active_er.guid_one = e.guid 
  374                             AND active_er.relationship = 'active_plugin' 
  375                             AND active_er.guid_two = $site_guid)";
 
  414         $order = array_values($order);
 
  416         $missing_plugins = array();
 
  436         if (
$return && $missing_plugins) {
 
  440             foreach ($missing_plugins as 
$plugin) {
 
  486                     elgg_deprecated_notice(
"You must pass the plugin id to _elgg_namespace_plugin_private_setting() for user settings", 1.9);
 
  526             foreach ($active_plugins as 
$plugin) {
 
  527                 $plugin_provides = array();
 
  528                 $manifest = 
$plugin->getManifest();
 
  530                     $plugin_provides = 
$plugin->getManifest()->getProvides();
 
  532                 if ($plugin_provides) {
 
  533                     foreach ($plugin_provides as $provided) {
 
  534                         $provides[$provided[
'type']][$provided[
'name']] = array(
 
  535                             'version' => $provided[
'version'],
 
  536                             'provided_by' => 
$plugin->getID()
 
  599             $status = version_compare($provided[
'version'], 
$version, $comparison);
 
  606             'value' => $provided[
'version']
 
  630         if (!$dep_system || !$info || !
$type) {
 
  636         switch($comparison) {
 
  663         $strings[
'type'] = $translator->translate(
'ElggPlugin:Dependencies:' . ucwords($dep_system));
 
  669                 $strings[
'name'] = $translator->translate(
'ElggPlugin:Dependencies:Elgg');
 
  670                 $strings[
'expected_value'] = 
"$comparison {$info['version']}";
 
  671                 $strings[
'local_value'] = $dep[
'value'];
 
  672                 $strings[
'comment'] = 
'';
 
  677                 $strings[
'name'] = $translator->translate(
'ElggPlugin:Dependencies:PhpVersion');
 
  678                 $strings[
'expected_value'] = 
"$comparison {$info['version']}";
 
  679                 $strings[
'local_value'] = $dep[
'value'];
 
  680                 $strings[
'comment'] = 
'';
 
  683             case 'php_extension':
 
  685                 $strings[
'name'] = $translator->translate(
'ElggPlugin:Dependencies:PhpExtension', array($info[
'name']));
 
  686                 if ($info[
'version']) {
 
  687                     $strings[
'expected_value'] = 
"$comparison {$info['version']}";
 
  688                     $strings[
'local_value'] = $dep[
'value'];
 
  690                     $strings[
'expected_value'] = 
'';
 
  691                     $strings[
'local_value'] = 
'';
 
  693                 $strings[
'comment'] = 
'';
 
  697                 $strings[
'name'] = $translator->translate(
'ElggPlugin:Dependencies:PhpIni', array($info[
'name']));
 
  698                 $strings[
'expected_value'] = 
"$comparison {$info['value']}";
 
  699                 $strings[
'local_value'] = $dep[
'value'];
 
  700                 $strings[
'comment'] = 
'';
 
  704                 $strings[
'name'] = $translator->translate(
'ElggPlugin:Dependencies:Plugin', array($info[
'name']));
 
  705                 $expected = $info[
'version'] ? 
"$comparison {$info['version']}" : $translator->translate(
'any');
 
  706                 $strings[
'expected_value'] = $expected;
 
  707                 $strings[
'local_value'] = $dep[
'value'] ? $dep[
'value'] : 
'--';
 
  708                 $strings[
'comment'] = 
'';
 
  712                 $expected_priority = ucwords($info[
'priority']);
 
  713                 $real_priority = ucwords($dep[
'value']);
 
  714                 $strings[
'name'] = $translator->translate(
'ElggPlugin:Dependencies:Priority');
 
  715                 $strings[
'expected_value'] = $translator->translate(
"ElggPlugin:Dependencies:Priority:$expected_priority", array($info[
'plugin']));
 
  716                 $strings[
'local_value'] = $translator->translate(
"ElggPlugin:Dependencies:Priority:$real_priority", array($info[
'plugin']));
 
  717                 $strings[
'comment'] = 
'';
 
  721         if ($dep[
'type'] == 
'suggests') {
 
  722             if ($dep[
'status']) {
 
  723                 $strings[
'comment'] = $translator->translate(
'ok');
 
  725                 $strings[
'comment'] = $translator->translate(
'ElggPlugin:Dependencies:Suggests:Unsatisfied');
 
  728             if ($dep[
'status']) {
 
  729                 $strings[
'comment'] = $translator->translate(
'ok');
 
  731                 $strings[
'comment'] = $translator->translate(
'error');
 
  946         return $plugin->unsetAllSettings();
 
  977         if (!isset(
$options[
'plugin_id'])) {
 
  978             elgg_deprecated_notice(
"'plugin_id' is now required for elgg_get_entities_from_plugin_user_settings()", 1.9);
 
  982         $singulars = array(
'plugin_user_setting_name', 
'plugin_user_setting_value',
 
  983             'plugin_user_setting_name_value_pair');
 
  989             'plugin_user_setting_names' => 
'private_setting_names',
 
  990             'plugin_user_setting_values' => 
'private_setting_values',
 
  991             'plugin_user_setting_name_value_pairs' => 
'private_setting_name_value_pairs',
 
  992             'plugin_user_setting_name_value_pairs_operator' => 
'private_setting_name_value_pairs_operator',
 
  995         foreach ($map as 
$plugin => $private) {
 
 1001                 if (!is_array(
$options[$private])) {
 
 1012         $options[
'private_setting_name_prefix'] = $prefix;
 
if(! $collection_name) $id
if($guid==elgg_get_logged_in_user_guid()) $name
if(! $autoload_available) _elgg_services()
$user_guid
Avatar remove action.
getDependencyStrings($dep)
Returns an array of parsed strings for a dependency in the format: array( 'type' => requires,...
setUserSetting($name, $value, $user_guid=0, $plugin_id=null)
Set a user specific setting for a plugin.
reindexPriorities()
Reindexes all plugin priorities starting at 1.
setSetting($name, $value, $plugin_id=null)
Set a setting for a plugin.
setPriorities(array $order)
Reorder plugins to an order specified by the array.
exists($id)
Returns if a plugin exists in the system.
getMaxPriority()
Returns the highest priority of the plugins.
find($status='active', $site_guid=null)
Returns an ordered list of plugins.
getProvides($type=null, $name=null)
Returns an array of all provides from all active plugins.
invalidateProvidesCache()
Deletes all cached data on plugins being provided.
isActive($plugin_id, $site_guid=null)
Returns if a plugin is active for a current site.
getDirsInDir($dir=null)
Returns a list of plugin directory names from a base directory.
unsetSetting($name, $plugin_id=null)
Unsets a plugin setting.
unsetUserSetting($name, $user_guid=0, $plugin_id=null)
Unsets a user-specific plugin setting.
load()
Loads all active plugins in the order specified in the tool admin panel.
generateEntities()
Discovers plugins in the plugins_path setting and creates \ElggPlugin entities for them if they don't...
getSetting($name, $plugin_id=null, $default=null)
Get setting for a plugin.
getAllUserSettings($user_guid=0, $plugin_id=null, $return_obj=false)
Returns an array of all plugin user settings for a user.
getEntitiesFromUserSettings(array $options=array())
Returns entities based upon plugin user settings.
unsetAllSettings($plugin_id=null)
Unsets all plugin settings for a plugin.
namespacePrivateSetting($type, $name, $id=null)
Namespaces a string to be used as a private setting name for a plugin.
checkProvides($type, $name, $version=null, $comparison='ge')
Checks if a plugin is currently providing $type and $name, and optionally checking a version.
getUserSetting($name, $user_guid=0, $plugin_id=null, $default=null)
Get a user specific setting for a plugin.
cache(\ElggPlugin $plugin)
Cache a reference to this plugin by its ID.
global $ELGG_PLUGINS_PROVIDES_CACHE
elgg_get_plugins_path()
Get the plugin path for this installation.
elgg_set_config($name, $value)
Set an Elgg configuration value.
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
get_config($name, $site_guid=0)
Gets a configuration value.
elgg_get_calling_plugin_id($mainfilename=false)
Get the name of the most recent plugin to be called in the call stack (or the plugin that owns the cu...
elgg_get_calling_plugin_entity()
Returns the \ElggPlugin entity of the last plugin called.
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
_elgg_normalize_plural_options_array($options, $singulars)
Normalise the singular keys in an options array to plural keys.
system_message($message)
Display a system message on next page load.
const ELGG_ENTITIES_NO_VALUE
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Sends a notice about deprecated use of a function, view, etc.
access_get_show_hidden_status()
Return current status of showing disabled entities.
access_show_hidden_entities($show_hidden)
Show or hide disabled entities.
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
elgg_add_admin_notice($id, $message)
Write a persistent message to the admin view.
sanitize_string($string)
Sanitize a string for database use.
get_data($query, $callback="")
Retrieve rows from the database.
elgg_get_plugin_from_id($plugin_id)
Returns an \ElggPlugin object with the path $path.
const ELGG_PLUGIN_REGISTER_LANGUAGES
Tells \ElggPlugin::start() to automatically register the plugin's languages.
_elgg_get_plugin_dirs_in_dir($dir=null)
Returns a list of plugin directory names from a base directory.
const ELGG_PLUGIN_REGISTER_VIEWS
Tells \ElggPlugin::start() to automatically register the plugin's views.
const ELGG_PLUGIN_REGISTER_CLASSES
Tells \ElggPlugin::start() to automatically register the plugin's classes.
_elgg_set_plugin_priorities(array $order)
Reorder plugins to an order specified by the array.
elgg_get_plugins($status='active', $site_guid=null)
Returns an ordered list of plugins.
const ELGG_PLUGIN_INTERNAL_PREFIX
Internal settings prefix.
const ELGG_PLUGIN_INCLUDE_START
Tells \ElggPlugin::start() to include the start.php file.
const ELGG_PLUGIN_USER_SETTING_PREFIX
Prefix for plugin setting names.
_elgg_namespace_plugin_private_setting($type, $name, $id=null)
Namespaces a string to be used as a private setting name for a plugin.
_elgg_get_plugins_provides($type=null, $name=null)
Returns an array of all provides from all active plugins.
_elgg_reindex_plugin_priorities()
Reindexes all plugin priorities starting at 1.
get_entity($guid)
Loads and returns an entity object from a guid.
get_subtype_id($type, $subtype)
Return the id for a given subtype.
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
elgg_in_context($context)
Check if this context exists anywhere in the stack.
remove_private_setting($entity_guid, $name)
Deletes a private setting for an entity.
elgg_get_entities_from_private_settings(array $options=array())
Returns entities based upon private settings.
elgg_get_entities_from_relationship($options)
Return entities matching a given query joining against a relationship.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
elgg_get_site_entity($site_guid=0)
Get an \ElggSite entity (default is current site)
if(! $num_display) $db_prefix