Skip to content

Commit

Permalink
allow admin components to skip being shown in the admin menu
Browse files Browse the repository at this point in the history
This is related to #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.
  • Loading branch information
splitbrain committed Apr 16, 2024
1 parent 821c061 commit 31afae8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions inc/Extension/AdminPlugin.php
Expand Up @@ -59,6 +59,16 @@ public function getMenuSort()
return 1000;
}

/**
* Return true if the plugin should be shown in the admin menu
*
* @return bool
*/
public function showInMenu()
{
return true;
}

/**
* Carry out required processing
*/
Expand Down
1 change: 1 addition & 0 deletions inc/Ui/Admin.php
Expand Up @@ -135,6 +135,7 @@ protected function getPluginList()

// check permissions
if (!$obj->isAccessibleByCurrentUser()) continue;
if (!$obj->showInMenu()) continue;

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

0 comments on commit 31afae8

Please sign in to comment.