Public Member Functions | Public Attributes

Addon Class Reference

Handle BEdita addons (models, components, etc,..) to enable/disable it and so on. More...

Inheritance diagram for Addon:
AppModel

List of all members.

Public Member Functions

 getAddons ()
 return an array of available addons
 enable ($fileName, $addonType)
 enable addon copying the addon file in the related enabled folder.
 disable ($fileName, $addonType)
 disable addon deleting the addon file from the related enabled folder.
 update ($fileName, $addonType)
 update addon overriding the enabled addon file
 getFolderByFile ($fileName)
 get an array with folders on which $fileName is found starting from BEDITA_ADDONS_PATH
 getFolderByType ($addonType)
 get the folder relative to an addon
 getEnabledFolderByType ($addonType)
 get the "enabled" folder relative to an addon

Public Attributes

 $useTable = false

Detailed Description

Handle BEdita addons (models, components, etc,..) to enable/disable it and so on.

Version:
$Revision$ $LastChangedBy$ $LastChangedDate$

$Id$

Definition at line 31 of file addon.php.


Member Function Documentation

Addon::disable ( fileName,
addonType 
)

disable addon deleting the addon file from the related enabled folder.

If addon is a BEdita object the row on object_types table and all objects of that type are removed

Parameters:
string $fileName, addon file name
string $addonType, the type of addon, i.e. models, helpers, components, ...
Exceptions:
BeditaException 

Definition at line 213 of file addon.php.

References getEnabledFolderByType(), and BeLib::getObject().

Addon::enable ( fileName,
addonType 
)

enable addon copying the addon file in the related enabled folder.

If addon is a BEdita object type a row on object_types table is created

Parameters:
string $fileName, addon file name
string $addonType, the type of addon, i.e. models, helpers, components, ...
Exceptions:
BeditaException 

Definition at line 161 of file addon.php.

References getEnabledFolderByType(), getFolderByType(), and BeLib::getObject().

Addon::getAddons (  ) 

return an array of available addons

Returns:
array in this form array( "models" => array( "objectTypes" => array( "on" => array( 0 => array( "name" => class name, "file" => file name, "objectType" => object type name, "path" => path where to find addon file available, "enabledPath" => path where to find addon file enabled, "type" => "models", "fileNameUsed" => true if file name is already used for model ), 1 => array() .... ), "off" => array( 0 => array( like "on" array ), 1 => array(...)), ... ), "others" => array( "on" => array( 0 => array( "name" => class name, "file" => file name, "objectType" => object type name, "path" => path where to find addon file available, "enabledPath" => path where to find addon file enabled, "type" => "models", "fileNameUsed" => true if file name is already used for model ), 1 => array() .... ), "off" => array( 0 => array( like "on" array ), 1 => array(...)), ... ) ),

"components" => array(like "others" array), "helpers" => array(like "others" array), "behaviors" => array(like "others" array), )

Definition at line 86 of file addon.php.

Addon::getEnabledFolderByType ( addonType  ) 

get the "enabled" folder relative to an addon

Parameters:
string $addonType, the addon type i.e. model, helper, component,...
Returns:
mixed, the folder string or false if folder doesn't found

Definition at line 304 of file addon.php.

References getFolderByType(), and BeLib::getObject().

Referenced by disable(), enable(), and update().

Addon::getFolderByFile ( fileName  ) 

get an array with folders on which $fileName is found starting from BEDITA_ADDONS_PATH

Parameters:
string $fileName, the file name
Returns:
array

Definition at line 273 of file addon.php.

Addon::getFolderByType ( addonType  ) 

get the folder relative to an addon

Parameters:
string $addonType, the addon type i.e. model, helper, component,...
Returns:
mixed, the folder string or false if folder doesn't found

Definition at line 284 of file addon.php.

References BeLib::getObject().

Referenced by enable(), getEnabledFolderByType(), and update().

Addon::update ( fileName,
addonType 
)

update addon overriding the enabled addon file

Parameters:
string $fileName, addon file name
string $addonType, the type of addon, i.e. models, helpers, components, ...
Exceptions:
BeditaException 

Definition at line 244 of file addon.php.

References getEnabledFolderByType(), and getFolderByType().


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:45 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus