|
|
| Line 460: |
Line 460: |
| 前往“主页->设置->模块/应用”页面,您应该会看到一个齿轮图标,允许您访问配置页面,并且您应该能够修改这些选项并将其保存到数据库中。 | | 前往“主页->设置->模块/应用”页面,您应该会看到一个齿轮图标,允许您访问配置页面,并且您应该能够修改这些选项并将其保存到数据库中。 |
|
| |
|
| ==增加菜单条目 (可选)== | | ==设置菜单项 (可选)== |
| '''何时''': 如果您创建了PHP页面,则必须从Dolibarr菜单中的菜单条目中访问这些页面。 | | '''何时''' :如果您创建了PHP页面,则必须从Dolibarr菜单访问这些屏幕页面。 |
|
| |
|
| ===增加菜单条目=== | | ===设置菜单项=== |
| For this, you must define into the module descriptor, the array this->menu that declare all menus added by your module.
| | 为此,您需要在模块描述符文件中定义数组 this->menu,该数组用于声明菜单。 |
| This array contains entries that will appear once your module is activated.
| | |
| The example module descriptor file '''modMyModule.class.php''' contains an example to declare a top menu and also its left menu entries.
| | 此数组包含模块激活后将显示在菜单中的所有条目。 |
| | |
| | 模块描述符文件的示例文件 '''modMyModule.class.php''' 中有一个声明顶部菜单及其相关的左侧菜单项的示例。 |
| | |
| | 以下是描述符文件中菜单项声明的示例: |
|
| |
|
| This is the example of code to declare your own menu entries in a module descriptor file:
| |
| <syntaxhighlight lang="PHP"> | | <syntaxhighlight lang="PHP"> |
| // Main menu entries | | // Main menu entries |
| Line 506: |
Line 509: |
| </syntaxhighlight> | | </syntaxhighlight> |
|
| |
|
| To show menu or not depending on a permission, modify property '''perms''' in array. See chapter on permissions later to see how to add permissions.
| | 若要根据权限限制对菜单的访问,请更改数组的 '''perms''' 属性。有关如何添加权限的更多信息,请参阅后面有关权限的章节。 |
|
| |
|
| ===测试菜单=== | | ===测试您的菜单项=== |
| Disable and reenable your module under Dolibarr module setup page, menus entries must appear (if property 'enabled' is declaration array is ok).
| | 在Dolibarr中禁用并重新激活您的模块,然后应该会出现菜单项(如果 “enabled”为真)。 |
|
| |
|
| ==新增权限 (可选)== | | ==新增权限 (可选)== |