public getGlobalButton ( ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetGlobalButtonEvent $event ) : void | ||
$event | ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetGlobalButtonEvent | The event. |
Результат | void |
public function getGlobalButton(GetGlobalButtonEvent $event)
{
if ($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel') {
return;
}
// FIXME: direct access to BackendUser.
if (!\BackendUser::getInstance()->isAdmin) {
$event->setHtml('');
}
}