模块开发: Difference between revisions

Jump to navigation Jump to search
Line 550: Line 550:
</syntaxhighlight>
</syntaxhighlight>


==信息窗 (可选)==
==设置您自己的消息框/widget小组件 (可选)==
'''When''': If your module need to provide one or several new boxes to show on home page.
'''何时''':如果您的模块需要在主页上展示一个或多个消息框。


===信息窗===
===设置您的消息框===
For this, modify the array $this->boxes into the module descriptor file.
为此,请修改模块描述符文件中的数组 $this->boxes。
All you have to do is to add 2 lines for each box file you will create into directory '''htdocs/mymodule/core/boxes'''
 
首先为即将在 '''htdocs/mymodule/core/boxes''' 目录中创建的每个box文件添加2行。
 
例如:


''Example:''
<syntaxhighlight lang="PHP">
<syntaxhighlight lang="PHP">
$this->boxes[0]['file']='mybox0.php@mymodule'
$this->boxes[0]['file']='mybox0.php@mymodule'
Line 566: Line 568:
</syntaxhighlight>
</syntaxhighlight>


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''').
其次,创建文件'''htdocs/mymodule/core/boxes/mybox0.php'''、'''htdocs/mymodule/core/boxes/mybox1.php'''…,以现有的消息框(在 '''htdocs/core/boxes''' 目录中)为示例。


===Test if your box is detected by Dolibarr===
===测试您的消息框是否被 Dolibarr 检测到===
Disable and enabled module.
停用并重新激活模块。


Go into menu '''Home - Setup - Boxes'''.
前往菜单  '''主页 - 设置 - widget小组件''' 。


Your boxes must appear in the list of boxes you can activated. Activate the box and go on home page to see if the box is showing correctly.
您的消息框必须显示在可激活消息框的清单中。激活它们,然后前往'''主页'''并检查它们是否正确显示。


==Define your own export (optional)==
==Define your own export (optional)==
715

edits

Navigation menu