Extension Plugins » History » Version 2
Max Milbers, 07/07/2011 02:38 PM
| 1 | 1 | Max Milbers | h1. Extension Plugins |
|---|---|---|---|
| 2 | |||
| 3 | 2 | Max Milbers | Extension plugins are used both in the front-end and the backend. They should be created as classes deriving from the base class *VmExtendedPlugin*: |
| 4 | |||
| 5 | <pre><code class="php"> |
||
| 6 | public function __construct (&$subject, $config=array()) { |
||
| 7 | parent::__construct($subject, $config); |
||
| 8 | $this->_path = JPATH_PLUGINS.DS.$this->getName(); |
||
| 9 | JPlugin::loadLanguage('plg_vmextended_'.$this->getName()); |
||
| 10 | } |
||
| 11 | </code></pre> |
||
| 12 | |||
| 13 | Below is the list with events and a description on what moment they are fired. |
||
| 14 | |||
| 15 | * *onVmAdminController()* - This event is fired, when the called view was not found in the backend maincontroller. It allows to add new views to virtuemart 2. |
||
| 16 | +Return:+ |
||
| 17 | It must execute the controller in the plugin. |
||
| 18 | +Parameters:+ |
||
| 19 | # (String ) Name of the controller |
||
| 20 | |||
| 21 | * *onVmSiteController()* - This event is fired, when the called view was not found in the frontend maincontroller. It allows to add new views to virtuemart 2. |
||
| 22 | +Return:+ |
||
| 23 | It must execute the controller in the plugin. |
||
| 24 | +Parameters:+ |
||
| 25 | # (String ) Name of the controller |
||
| 26 | |||
| 27 | * *onVmSqlRemove()* Plugs into the updater model to remove additional VM data (useful if the plugin depends on fields in a VM table) |
||
| 28 | |||
| 29 | * *onVmSqlRestore()* Plugs into the updater model to reinstall additional VM data (useful if the plugin depends on fields in a VM table) |
||
| 30 | |||
| 31 | * *plgVmAfterUserStore()* |
||
| 32 | +Return:+ |
||
| 33 | $data the manipulated data |
||
| 34 | +Parameters:+ |
||
| 35 | # (array $data) formdata as array |
||
| 36 | |||
| 37 | * *plgVmOnUserStore()* |
||
| 38 | +Return:+ |
||
| 39 | nothing special |
||
| 40 | +Parameters:+ |
||
| 41 | # (array $data) formdata as array |
||
| 42 | 1 | Max Milbers | |
| 43 | Back to [[Plugin system]] |