Skip to content

Commit 31afae8

Browse files
committed
allow admin components to skip being shown in the admin menu
This is related to dokuwiki#4249. At least the farmer plugin provides a top level admin component and several sub components which are loaded from the top component. For this use case it makes sense to be able to hide components from the admin interface. Default remains to show all.
1 parent 821c061 commit 31afae8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

inc/Extension/AdminPlugin.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ public function getMenuSort()
5959
return 1000;
6060
}
6161

62+
/**
63+
* Return true if the plugin should be shown in the admin menu
64+
*
65+
* @return bool
66+
*/
67+
public function showInMenu()
68+
{
69+
return true;
70+
}
71+
6272
/**
6373
* Carry out required processing
6474
*/

inc/Ui/Admin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ protected function getPluginList()
135135

136136
// check permissions
137137
if (!$obj->isAccessibleByCurrentUser()) continue;
138+
if (!$obj->showInMenu()) continue;
138139

139140
if (in_array($p, $this->forAdmins, true)) {
140141
$type = 'admin';

0 commit comments

Comments
 (0)