Module development: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 401: Line 401:
=== Define your box ===
=== Define your box ===
For this, modify the array $this->boxes into the module descriptor file.
For this, modify the array $this->boxes into the module descriptor file.
All you have to do is to add one line for each box file you will create into directory '''htdocs/core/boxes'''
All you have to do is to add 2 lines for each box file you will create into directory '''htdocs/mymodule/core/boxes'''


''Example:''
''Example:''
<source lang="php">
<source lang="php">
this->boxes[0][1]='mybox0.php'
$this->boxes[0]['file']='mybox0.php@mymodule'
this->boxes[1][1]='mybox1.php'
$this->boxes[0]['note']='My box 0'
this->boxes[2][1]='mybox2.php'
...
...
$this->boxes[n]['file']='myboxn.php@mymodule'
this->boxes[n][1]='myboxn.php'
$this->boxes[n]['note']='My box n'
</source>
</source>


Then create files mybox0.php, mybox1.php... by copying an example from an existing box file (into directory htdocs/core/boxes).
Then create files '''htdocs/mymodule/core/boxes/mybox0.php''', '''htdocs/mymodule/core/boxes/mybox1.php'''... by copying an example from an existing box file (found into directory '''htdocs/core/boxes''').


=== Test if your box is detected by Dolibarr ===
=== Test if your box is detected by Dolibarr ===

Navigation menu