Methods summary
protected
|
|
public
|
#
__construct( mixed $plugin )
Loads the plugin by GUID or path.
Loads the plugin by GUID or path.
Parameters
- $plugin
mixed $plugin The GUID of the ElggPlugin object or the path of the plugin to load.
Throws
Warning
Unlike other ElggEntity objects, you cannot null instantiate ElggPlugin. You
must point it to an actual plugin GUID or location.
Overrides
|
public
boolean
|
#
save( )
Save the plugin object. Make sure required values exist.
Save the plugin object. Make sure required values exist.
Returns
boolean
Throws
See
Overrides
|
public
string
|
#
getID( )
Returns the ID (dir name) of this plugin
Returns the ID (dir name) of this plugin
Returns
string
|
public
string
|
#
getFriendlyName( )
Returns the manifest's name if available, otherwise the ID.
Returns the manifest's name if available, otherwise the ID.
Returns
string
Since
1.8.1
|
public
string
|
#
getPath( )
Returns the plugin's full path with trailing slash.
Returns the plugin's full path with trailing slash.
Returns
string
|
public
boolean
|
#
setID( string $id )
Sets the location of this plugin.
Sets the location of this plugin.
Parameters
- $id
string $id The path to the plugin's dir.
Returns
boolean
|
public
array
|
#
getAvailableTextFiles( )
Returns an array of available markdown files for this plugin
Returns an array of available markdown files for this plugin
Returns
array
|
public
integer
|
#
getPriority( )
Gets the plugin's load priority.
Gets the plugin's load priority.
Returns
integer
|
public
boolean
|
#
setPriority( mixed $priority, mixed $site_guid = null )
Sets the priority of the plugin
Sets the priority of the plugin
Parameters
- $priority
mixed $priority The priority to set. One of +1, -1, first, last, or a number. If given
a number, this will displace all plugins at that number and set their priorities
+1
- $site_guid
mixed $site_guid Optional site GUID.
Returns
boolean
|
public
mixed
|
#
getSetting( string $name )
Returns a plugin setting
Parameters
- $name
string $name The setting name
Returns
mixed
|
public
array
|
#
getAllSettings( )
Returns an array of all settings saved for this plugin.
Returns an array of all settings saved for this plugin.
Returns
array An array of key/value pairs.
Note
Unlike user settings, plugin settings are not namespaced.
|
public
boolean
|
#
setSetting( string $name, string $value )
Set a plugin setting for the plugin
Set a plugin setting for the plugin
Parameters
- $name
string $name The name to set
- $value
string $value The value to set
Returns
boolean
|
public
boolean
|
#
unsetSetting( string $name )
Removes a plugin setting name and value.
Removes a plugin setting name and value.
Parameters
- $name
string $name The setting name to remove
Returns
boolean
|
public
boolean
|
#
unsetAllSettings( )
Removes all settings for this plugin.
Removes all settings for this plugin.
Returns
boolean
|
public
mixed
|
#
getUserSetting( string $name, integer $user_guid = null )
Returns a user's setting for this plugin
Returns a user's setting for this plugin
Parameters
- $name
string $name The setting name
- $user_guid
integer $user_guid The user GUID
Returns
mixed The setting string value or false
|
public
array
|
#
getAllUserSettings( integer $user_guid = null )
Returns an array of all user settings saved for this plugin for the user.
Returns an array of all user settings saved for this plugin for the user.
Parameters
- $user_guid
integer $user_guid The user GUID. Defaults to logged in.
Returns
array An array of key/value pairs.
Note
Plugin settings are saved with a prefix. This removes that prefix.
|
public
mixed
|
#
setUserSetting( string $name, string $value, integer $user_guid = null )
Sets a user setting for a plugin
Sets a user setting for a plugin
Parameters
- $name
string $name The setting name
- $value
string $value The setting value
- $user_guid
integer $user_guid The user GUID
Returns
mixed The new setting ID or false
|
public
boolean
|
#
unsetUserSetting( string $name, integer $user_guid = null )
Removes a user setting name and value.
Removes a user setting name and value.
Parameters
- $name
string $name The user setting name
- $user_guid
integer $user_guid The user GUID
Returns
boolean
|
public
boolean
|
#
unsetAllUserSettings( integer $user_guid )
Removes all User Settings for this plugin
Removes all User Settings for this plugin
Use removeAllUsersSettings() to remove all user settings for all
users. (Note the plural 'Users'.)
Parameters
- $user_guid
integer $user_guid The user GUID to remove user settings.
Returns
boolean
|
public
boolean
|
#
isValid( )
Returns if the plugin is complete, meaning has all required files and Elgg
can read them and they make sense.
Returns if the plugin is complete, meaning has all required files and Elgg
can read them and they make sense.
Returns
boolean
|
public
boolean
|
#
isActive( integer $site_guid = null )
Is this plugin active?
Parameters
- $site_guid
integer $site_guid Optional site guid.
Returns
boolean
|
public
boolean
|
#
canActivate( mixed $site_guid = null )
Checks if this plugin can be activated on the current Elgg installation.
Checks if this plugin can be activated on the current Elgg installation.
Parameters
- $site_guid
mixed $site_guid Optional site guid
Returns
boolean
|
public
boolean
|
#
activate( mixed $site_guid = null )
Actives the plugin for the current site.
Actives the plugin for the current site.
Parameters
- $site_guid
mixed $site_guid Optional site GUID.
Returns
boolean
|
public
boolean
|
#
deactivate( mixed $site_guid = null )
Deactivates the plugin.
Parameters
- $site_guid
mixed $site_guid Optional site GUID.
Returns
boolean
|
public
true
|
#
start( integer $flags )
Start the plugin.
Parameters
- $flags
integer $flags Start flags for the plugin. See the constants in lib/plugins.php for
details.
Returns
true
Throws
|
protected
mixed
|
#
includeFile( string $filename )
Includes one of the plugins files
Includes one of the plugins files
Parameters
- $filename
string $filename The name of the file
Returns
mixed The return value of the included file (or 1 if there is none)
Throws
|
protected
boolean
|
#
canReadFile( string $filename )
Checks whether a plugin file with the given name exists
Checks whether a plugin file with the given name exists
Parameters
- $filename
string $filename The name of the file
Returns
boolean
|
protected
true
|
#
registerViews( )
Registers the plugin's views
Registers the plugin's views
Returns
true
Throws
|
protected
true
|
#
registerLanguages( )
Registers the plugin's languages
Registers the plugin's languages
Returns
true
Throws
|
protected
true
|
#
registerClasses( )
Registers the plugin's classes
Registers the plugin's classes
Returns
true
Throws
|
public
mixed
|
#
get( string $name )
Get a value from private settings.
Get a value from private settings.
Parameters
Returns
mixed
Overrides
|
public
boolean
|
#
set( string $name, mixed $value )
Save a value as private setting or attribute.
Save a value as private setting or attribute.
Attributes include title and description.
Parameters
- $name
string $name Name
- $value
mixed $value Value
Returns
boolean
Overrides
|
public
string|null
|
#
getError( )
Returns the last error message registered.
Returns the last error message registered.
Returns
string|null
|
public
ElggPluginManifest
|
#
getManifest( )
Returns this plugin's ElggPluginManifest object
Returns this plugin's ElggPluginManifest object
Returns
|
public
ElggPluginPackage
|
#
getPackage( )
Returns this plugin's ElggPluginPackage object
Returns this plugin's ElggPluginPackage object
Returns
|