Hooks system: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 70: Line 70:


where
where
* $parameters is an array of meta-data about the datas contained by the hook (eg: the context, always accessible by $parameters->context).
* '''$parameters''' is an array of meta-data about the datas contained by the hook (eg: the context, always accessible by $parameters->context).
* $object is the object that you may work on. Eg: the product if you are in the productcard context.
* '''$object''' is the object that you may work on. Eg: the product if you are in the productcard context.
* $action is the action if one is conveyed (generally "create", "edit" or "view").
* '''$action''' is the action if one is conveyed (generally "create", "edit" or "view").


Your function should now be called when you access the module/context and you will see the parameters and object and action.
Your function should now be called when you access the module/context and you will see the parameters and object and action.


= List of available Hooks =
= List of available Hooks =
 
{{ToComplete}}
* formObjectOptions: called everytime fields associated to the main object are printed or inputted (eg: creation form, datasheet, edit form, etc..).
* '''formObjectOptions''': called everytime fields associated to the main object are printed or inputted (eg: creation form, datasheet, edit form, etc..).
 
* // TODO: complete the list


How to find the available hooks ?  
How to find the available hooks ?  
Just search for "'''executeHooks('''" and you should easily find all the hooked methods calls.
Just search for "'''executeHooks('''" and you should easily find all the hooked methods calls.