31,003
edits
No edit summary |
No edit summary |
||
| Line 11: | Line 11: | ||
To use a hook (overload a function), you first need to already have defined a module (see the wiki for that), and then you need to do 2 things: | To use a hook (overload a function), you first need to already have defined a module (see the wiki for that), and then you need to do 2 things: | ||
1- | 1- add your module to the hooks of the context you want to hook on. | ||
This means that when this context | This means that when this context will happen, your module hook code will be called. | ||
To do that, just edit your /htdocs/ | To do that, just edit your /htdocs/core/modules/modYourModuleName.class.php and edit the $this->module_parts variable with something like this: | ||
<source lang="php"> | <source lang="php"> | ||
$this-> | $this->module_parts = array( | ||
'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module | |||
); | ); | ||
</source> | </source> | ||
Of course change YourModuleName with your own module's name. | Of course change YourModuleName with your own module's name. | ||