Hooks system: Difference between revisions

m
(added list of contexts and added a few infos in implementation)
Line 74: Line 74:
Of course change YourModuleName with your own module's name.
Of course change YourModuleName with your own module's name.


Note: you can access the current module's context with print('Module context: '.$object->context); (put this inside the module's php file where the hook resides)
Note: you can find the current module's context with print('Module context: '.$object->context); (put this inside the module's php file where the hook resides and that you want to hook).


'''IMPORTANT''': Be careful: do not forget to DISABLE then RENABLE the module in the admin panel to accept the new context, because these constants are only added to the database when enabling the module.
'''IMPORTANT''': Be careful: do not forget to DISABLE then RENABLE the module in the admin panel to accept the new context, because these constants are only added to the database when enabling the module.
439

edits