Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/user_status/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<navigation>
<id>user_status-menuitem</id>
<name>User status</name>
<route />
<order>1</order>
<type>settings</type>
</navigation>
Expand Down
5 changes: 5 additions & 0 deletions lib/private/App/InfoParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ public function parse($file) {
* @return bool
*/
private function isNavigationItem($data): bool {
// Allow settings navigation items with no route entry
$type = $data['type'] ?? 'link';
if ($type === 'settings') {
return isset($data['name']);
}
return isset($data['name'], $data['route']);
}

Expand Down
8 changes: 5 additions & 3 deletions lib/private/NavigationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,12 @@ private function init() {
continue;
}
foreach ($info['navigations']['navigation'] as $key => $nav) {
$nav['type'] = $nav['type'] ?? 'link';
if (!isset($nav['name'])) {
continue;
}
if (!isset($nav['route'])) {
// Allow settings navigation items with no route entry, all other types require one
if (!isset($nav['route']) && $nav['type'] !== 'settings') {
continue;
}
$role = isset($nav['@attributes']['role']) ? $nav['@attributes']['role'] : 'all';
Expand All @@ -314,8 +316,8 @@ private function init() {
$l = $this->l10nFac->get($app);
$id = $nav['id'] ?? $app . ($key === 0 ? '' : $key);
$order = isset($nav['order']) ? $nav['order'] : 100;
$type = isset($nav['type']) ? $nav['type'] : 'link';
$route = $nav['route'] !== '' ? $this->urlGenerator->linkToRoute($nav['route']) : '';
$type = $nav['type'];
$route = !empty($nav['route']) ? $this->urlGenerator->linkToRoute($nav['route']) : '';
$icon = isset($nav['icon']) ? $nav['icon'] : 'app.svg';
foreach ([$icon, "$app.svg"] as $i) {
try {
Expand Down
2 changes: 1 addition & 1 deletion resources/app-info-shipped.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
<xs:sequence>
<xs:element name="id" type="id" minOccurs="0" maxOccurs="1"/>
<xs:element name="name" type="non-empty-string" minOccurs="1" maxOccurs="1"/>
<xs:element name="route" type="route" minOccurs="1" maxOccurs="1"/>
<xs:element name="route" type="route" minOccurs="0" maxOccurs="1"/>
<xs:element name="icon" type="xs:anyURI" minOccurs="0" maxOccurs="1"/>
<xs:element name="order" type="xs:int" minOccurs="0" maxOccurs="1"/>
<xs:element name="type" type="navigation-type" minOccurs="0" maxOccurs="1"/>
Expand Down
2 changes: 1 addition & 1 deletion resources/app-info.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
<xs:sequence>
<xs:element name="id" type="id" minOccurs="0" maxOccurs="1"/>
<xs:element name="name" type="non-empty-string" minOccurs="1" maxOccurs="1"/>
<xs:element name="route" type="route" minOccurs="1" maxOccurs="1"/>
<xs:element name="route" type="route" minOccurs="0" maxOccurs="1"/>
<xs:element name="icon" type="xs:anyURI" minOccurs="0" maxOccurs="1"/>
<xs:element name="order" type="xs:int" minOccurs="0" maxOccurs="1"/>
<xs:element name="type" type="navigation-type" minOccurs="0" maxOccurs="1"/>
Expand Down