31,003
edits
| Line 199: | Line 199: | ||
= [[File:Art.png]] Add your own setup page (optionnal) = | = [[File:Art.png]] Add your own setup page (optionnal) = | ||
'''When''': If your module need to ask user several parameters. | '''When''': If your module need to ask user several parameters. | ||
== | == Create your page to edit parameters == | ||
If your module need several parameters to be setup, you must create a page to edit options (that will be saved into [[Table llx_const|table '''llx_const''']]). | |||
Create a page named '''mymodule_setuppage.php''' that show possibles options and update them into table from a form. | |||
It is a necessary to take an example from a page into directory '''/admin''' that will show you the way to read/save your parameter. | |||
Put this page into directory '''/admin'''. | |||
Then, into the descriptor file of your module, modify the variable config_page_url to set name of this PHP page (without the path that is not necesary if page is inside directory admin). | |||
<pre> | <pre> | ||
$this->config_page_url = array(" | $this->config_page_url = array("mymodule_setuppage.php"); | ||
</pre> | </pre> | ||
== | == Test your page == | ||
Go into page '''Home->Setup->Modules''', you should see a picto at the end of the line of your module to reach your setup page. Click on it, you should be able to view/edit parameters from your page. | |||
= [[File:Art.png]] Define your entries in menu (optionnal) = | = [[File:Art.png]] Define your entries in menu (optionnal) = | ||