Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
1c785ba3
Commit
1c785ba3
authored
Jan 31, 2019
by
Côme Chilliet
Browse files
✨
feat(management) Allow subclasses to add actions to existing submenus
issue
#5135
parent
8c7e87c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/management/actions/class_SubMenuAction.inc
View file @
1c785ba3
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment