Commit 1c785ba3 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

feat(management) Allow subclasses to add actions to existing submenus

issue #5135
parent 8c7e87c6
......@@ -38,6 +38,17 @@ class SubMenuAction extends Action
}
}
function addAction(Action $action)
{
$this->actions[] = $action;
$names = $action->listActions();
foreach ($names as $name) {
$this->handlers[$name] = $action;
}
/* Rerun registerAction process */
$this->parent->registerAction($this);
}
function setParent(management $parent)
{
parent::setParent($parent);
......@@ -46,7 +57,6 @@ class SubMenuAction extends Action
}
}
function listActions()
{
return array_keys($this->handlers);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment