439
edits
No edit summary |
(→Implementation: Added $deleteonunactive info thank's to LaMakina + format of a const declaration) |
||
| Line 16: | Line 16: | ||
<source lang="php"> | <source lang="php"> | ||
$this->const = array( 0=>array('MAIN_MODULE_YOURMODULENAME_HOOKS', 'chaine', 'productcard:invoicecard:propalcard', 'Hooks list for managing printing functions of the CustomFields module', 0); | $this->const = array( | ||
0=>array('MAIN_MODULE_YOURMODULENAME_HOOKS', 'chaine', 'productcard:invoicecard:propalcard', 'Hooks list for managing printing functions of the CustomFields module', 0, 'current', 1) | |||
); | |||
</source> | </source> | ||
Note: format of a const declaration: | |||
<source lang="php"> | |||
$key=>array($const_name,$type,$value,$description,$visible_on_admin_panel=0,$entity='current',$deleteonunactive=0), | |||
$key2=>... | |||
</source> | |||
With $key being a positive number. | |||
Of course change YourModuleName with your own module's name. | Of course change YourModuleName with your own module's name. | ||
| Line 23: | Line 31: | ||
Then you get the value at the third index, which is a string with contexts separated by a comma. | Then you get the value at the third index, which is a string with contexts separated by a comma. | ||
'''IMPORTANT''': Be careful: do not forget to DISABLE then RENABLE the module in the admin panel to accept the new const values, 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 const values, because these constants are only added to the database when enabling the module. And please note that the const is updated because the last parameter is set to 1 (which represent $deleteonunactive) which by default is set to 0 to preserve the constants even when the module is disabled. | ||
2- You will overload a hook (a function) with your own. | 2- You will overload a hook (a function) with your own. | ||
edits