Extend disabled_actions config so it accepts also button names (#5903)

pull/5490/merge
JohnDoh 7 years ago committed by Aleksander Machniak
parent f9644ea217
commit a8f0d35ebc

@ -1361,12 +1361,14 @@ EOF;
}
$command = $attrib['command'];
$action = $command ?: $attrib['name'];
if ($attrib['task']) {
$element = $command = $attrib['task'] . '.' . $command;
$command = $attrib['task'] . '.' . $command;
$element = $attrib['task'] . '.' . $action;
}
else {
$element = ($this->env['task'] ? $this->env['task'] . '.' : '') . $command;
$element = ($this->env['task'] ? $this->env['task'] . '.' : '') . $action;
}
if ($disabled_actions === null) {
@ -1374,7 +1376,7 @@ EOF;
}
// remove buttons for disabled actions
if (in_array($element, $disabled_actions)) {
if (in_array($element, $disabled_actions) || in_array($action, $disabled_actions)) {
return '';
}

Loading…
Cancel
Save