Add legal notice and privacy policy links
[GitHub/WoltLab/woltlab.github.io.git] / pages / package / pip / package_pip_user-menu.md
CommitLineData
c8b654e0
MS
1---
2title: User Menu Package Installation Plugin
3sidebar: sidebar
4permalink: package_pip_user-menu.html
5folder: package/pip
6parent: package_pip
7---
8
9Registers new user menu items.
10
11## Components
12
13Each 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
19The item’s parent item.
20
21### `<showorder>`
22
23{% include callout.html content="Optional" type="info" %}
24
25Specifies the order of this item within the parent item.
26
27### `<controller>`
28
29The fully qualified class name of the target controller.
30If not specified this item serves as a category.
31
32### `<link>`
33
34Additional components if `<controller>` is set,
35the full external link otherwise.
36
37### `<iconclassname>`
38
39{% include tip.html content="Use an icon only for top-level items." %}
40
41Name of the Font Awesome icon class.
42
43### `<options>`
44
45{% include callout.html content="Optional" type="info" %}
46
47The 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
53The 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
57The name of the class providing the user menu item’s behaviour,
58the 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```