allow admin components to skip being shown in the admin menu
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.
This commit is contained in:
parent
821c061a6c
commit
31afae8a52
|
@ -59,6 +59,16 @@ abstract class AdminPlugin extends Plugin
|
|||
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
|
||||
*/
|
||||
|
|
|
@ -135,6 +135,7 @@ class Admin extends Ui
|
|||
|
||||
// check permissions
|
||||
if (!$obj->isAccessibleByCurrentUser()) continue;
|
||||
if (!$obj->showInMenu()) continue;
|
||||
|
||||
if (in_array($p, $this->forAdmins, true)) {
|
||||
$type = 'admin';
|
||||
|
|
Loading…
Reference in New Issue