plugin.php
This file provides the framework for a plugin architecture.
Documentation on how to write plugins might show up some time.
This function is used for hooks which are to return true or false. If $priority is > 0, any one or more trues will override any falses. If $priority < 0, then one or more falses will override any trues.
Priority 0 means majority rules. Ties will be broken with $tie
If any plugin on this hook wants to modify the $args plugin parameter, it simply has to use call-by-reference syntax in the hook function that it has registered for the current hook. Note that this is in addition to (entirely independent of) the return value for this hook.
Check a plugin's other plugin dependencies.
Determines whether or not all of the given plugin's required plugins are installed and up to the proper version, and if they are activated if required.
By default, the desired plugin must be currently activated, and if it is not, this function will return FALSE. By overriding the default value of $force_inclusion, this function will attempt to grab dependency information from the given plugin even if it is not activated (plugin still has to be unpackaged and set in place in the plugins directory). Use with care - some plugins might break SquirrelMail when this is used.
NOTE that if a plugin does not report whether or not it has other plugin dependencies, this function will return TRUE, although that is possibly incorrect or misleading.
Check a plugin's version.
Returns TRUE if the given plugin is installed, activated and is at minimum version $a.$b.$c. If any one of those conditions fails, FALSE will be returned (careful of plugins that are sufficiently versioned but are not activated).
By overriding the default value of $force_inclusion, this function will attempt to grab versioning information from the given plugin even if it is not activated (the plugin still has to be unpackaged and set in place in the plugins directory). Use with care - some plugins might break SquirrelMail when this is used.
Note that this function assumes plugin versioning is consistently applied in the same fashion that SquirrelMail versions are, with the exception that an applicable SquirrelMail version may be appended to the version number (which will be ignored herein). That is, plugin version number schemes are expected in the following format: 1.2.3, or 1.2.3-1.4.0.
Any characters after the third number indicating things such as beta or release candidate versions are discarded, so formats such as the following will also work, although extra information about beta versions can possibly confuse the desired results of the version check: 1.2.3-beta4, 1.2.3.RC2, and so forth.
This function executes a hook that allows for an arbitrary return value from each plugin that will be merged into one array (or one string if all return values are strings) and returned to the core hook location.
Note that unlike PHP's array_merge function, matching array keys will not overwrite each other, instead, values under such keys will be concatenated if they are both strings, or merged if they are arrays (in the same (non-overwrite) manner recursively).
Plugins returning non-arrays (strings, objects, etc) will have their output added to the end of the ultimate return array, unless ALL values returned are strings, in which case one string with all returned strings concatenated together is returned (unless $force_array is TRUE).
If any plugin on this hook wants to modify the $args plugin parameter, it simply has to use call-by-reference syntax in the hook function that it has registered for the current hook. Note that this is in addition to (entirely independent of) the return value for this hook.
This function executes a plugin hook.
It includes an arbitrary return value that is managed by all plugins on the same hook and returned to the core hook location.
The desired format of the return value should be defined by the context in which the hook is called.
Note that the master return value for this hook is passed to each plugin after the main argument(s) value/array as a convenience only - to show what the current return value is even though it is liable to be changed by other plugins.
If any plugin on this hook wants to modify the $args plugin parameter, it simply has to use call-by-reference syntax in the hook function that it has registered for the current hook. Note that this is in addition to (entirely independent of) the return value for this hook.
Get a plugin's other plugin dependencies.
Determines and returns all the other plugins that a given plugin requires, as well as the minimum version numbers of the required plugins and whether or not they need to be activated.
By default, the desired plugin must be currently activated, and if it is not, this function will return FALSE. By overriding the default value of $force_inclusion, this function will attempt to grab dependency information from the given plugin even if it is not activated (plugin still has to be unpackaged and set in place in the plugins directory). Use with care - some plugins might break SquirrelMail when this is used.
By turning on the $do_parse argument (it is on by default), the version string for each required plugin will be parsed by SquirrelMail into a SquirrelMail-compatible version string (such as "1.2.3") if it is not already. See notes about version formatting under the get_plugin_version() function documentation.
Get a certain plugin requirement.
Attempts to find the given plugin requirement value in the given plugin's informational array, and returns it or NULL if it was not found.
Some plugins have different values for the same requirement depending on the SquirrelMail version, and this function is smart enough to take that into account.
By default, the desired plugin must be currently activated, and if it is not, this function will return NULL. By overriding the default value of $force_inclusion, this function will attempt to grab requirement information from the given plugin even if it is not activated (plugin still has to be unpackaged and set in place in the plugins directory). Use with care - some plugins might break SquirrelMail when this is used.
Get a plugin's version.
Determines and returns a plugin's version.
By default, the desired plugin must be currently activated, and if it is not, this function will return FALSE. By overriding the default value of $force_inclusion, this function will attempt to grab versioning information from the given plugin even if it is not activated (plugin still has to be unpackaged and set in place in the plugins directory). Use with care - some plugins might break SquirrelMail when this is used.
By turning on the $do_parse argument, the version string will be parsed by SquirrelMail into a SquirrelMail-compatible version string (such as "1.2.3") if it is not already.
Note that this assumes plugin versioning is consistently applied in the same fashion that SquirrelMail versions are, with the exception that an applicable SquirrelMail version may be appended to the version number (which will be ignored herein). That is, plugin version number schemes are expected in the following format: 1.2.3, or 1.2.3-1.4.0.
Any characters after the third version number indicating things such as beta or release candidate versions are discarded, so formats such as the following will also work, although extra information about beta versions can possibly confuse the desired results of the version check: 1.2.3-beta4, 1.2.3.RC2, and so forth.
Check if plugin is enabled
Do not use, use checkForJavascript() instead.
This function checks whether the user's USER_AGENT is known to be broken. If so, returns true and the plugin is invisible to the offending browser. *** THIS IS A TEST FOR JAVASCRIPT SUPPORT ***
This function adds a plugin.
Documentation generated on Mon, 13 Jan 2020 04:23:21 +0100 by phpDocumentor 1.4.3