Commit | Line | Data |
---|---|---|
c8b654e0 MS |
1 | --- |
2 | title: User Menu Package Installation Plugin | |
3 | sidebar: sidebar | |
4 | permalink: package_pip_user-menu.html | |
5 | folder: package/pip | |
6 | parent: package_pip | |
7 | --- | |
8 | ||
9 | Registers new user menu items. | |
10 | ||
11 | ## Components | |
12 | ||
13 | Each item is described as an `<usermenuitem>` element with the mandatory attribute `name`. | |
14 | ||
15 | ### `<parent>` | |
16 | ||
17 | {% include callout.html content="Optional" type="info" %} | |
18 | ||
19 | The item’s parent item. | |
20 | ||
21 | ### `<showorder>` | |
22 | ||
23 | {% include callout.html content="Optional" type="info" %} | |
24 | ||
25 | Specifies the order of this item within the parent item. | |
26 | ||
27 | ### `<controller>` | |
28 | ||
29 | The fully qualified class name of the target controller. | |
30 | If not specified this item serves as a category. | |
31 | ||
32 | ### `<link>` | |
33 | ||
34 | Additional components if `<controller>` is set, | |
35 | the full external link otherwise. | |
36 | ||
37 | ### `<iconclassname>` | |
38 | ||
39 | {% include tip.html content="Use an icon only for top-level items." %} | |
40 | ||
41 | Name of the Font Awesome icon class. | |
42 | ||
43 | ### `<options>` | |
44 | ||
45 | {% include callout.html content="Optional" type="info" %} | |
46 | ||
47 | The options element can contain a comma-separated list of options of which at least one needs to be enabled for the menu item to be shown. | |
48 | ||
49 | ### `<permissions>` | |
50 | ||
51 | {% include callout.html content="Optional" type="info" %} | |
52 | ||
53 | The permissions element can contain a comma-separated list of permissions of which the active user needs to have at least one for the menu item to be shown. | |
54 | ||
55 | ### `<classname>` | |
56 | ||
57 | The name of the class providing the user menu item’s behaviour, | |
58 | the class has to implement the `wcf\system\menu\user\IUserMenuItemProvider` interface. | |
59 | ||
60 | ||
61 | ||
62 | ## Example | |
63 | ||
64 | ```xml | |
65 | <?xml version="1.0" encoding="UTF-8"?> | |
66 | <data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/vortex/userMenu.xsd"> | |
67 | <import> | |
68 | <usermenuitem name="wcf.user.menu.foo"> | |
69 | <iconclassname>fa-home</iconclassname> | |
70 | </usermenuitem> | |
71 | ||
72 | <usermenuitem name="wcf.user.menu.foo.bar"> | |
73 | <controller>wcf\page\FooBarListPage</controller> | |
74 | <parent>wcf.user.menu.foo</parent> | |
75 | <permissions>user.foo.canBar</permissions> | |
76 | <classname>wcf\system\menu\user\FooBarMenuItemProvider</classname> | |
77 | </usermenuitem> | |
78 | ||
79 | <usermenuitem name="wcf.user.menu.foo.baz"> | |
80 | <controller>wcf\page\FooBazListPage</controller> | |
81 | <parent>wcf.user.menu.foo</parent> | |
82 | <permissions>user.foo.canBaz</permissions> | |
83 | <options>module_foo_bar</options> | |
84 | </usermenuitem> | |
85 | </import> | |
86 | </data> | |
87 | ``` |