Module development: Difference between revisions

Jump to navigation Jump to search
Line 358: Line 358:
'''When''': If in your PHP pages, you use javascript functions not available in Dolibarr (in file lib_head.js)
'''When''': If in your PHP pages, you use javascript functions not available in Dolibarr (in file lib_head.js)


If you need to use your own javascript functions inside your PHP pages, it is necessary to have your functions defined into a javascript file '''mymodule.js''' to be included inside the HTML HEAD section.
If you need to use your own javascript functions inside your PHP pages, it is necessary to have your functions, defined into your  javascript file '''htdocs/mymodule/js/mymodule.js''', included into the HTML HEAD section.
To ask Dolibarr that forge this header to include your own javascript file, you must just declare your file inside the module descriptor.
To ask Dolibarr that forge this header to include your own javascript file, you must just provide it to the llxHeader() function called by your page.


This feature is not yet available.
Example:
<source lang="php">
$morejs=array("/monmodule/js/monmodule.js");
llxHeader('','Titre','','','','',$morejs,'',0,0);
</source>


= [[File:Art.png]] Run your own code on any Dolibarr event (optional) =
= [[File:Art.png]] Run your own code on any Dolibarr event (optional) =

Navigation menu