src/Contao/View/Contao2BackendView/Subscriber/MultipleHandlerSubscriber.php
public function deactivateGlobalButton(ActionEvent $event)
    {
        $allowedAction = ['selectModelAll', 'selectPropertyAll', 'editAll', 'overrideAll'];
        if (!$this->scopeDeterminator->currentScopeIsBackend()
            || !\in_array($event->getAction()->getName(), $allowedAction)) {
            return;
        }

        $dataDefinition = $event->getEnvironment()->getDataDefinition();
        $backendView    = $dataDefinition->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
        $globalCommands = $backendView->getGlobalCommands();

        $allowedButton = ['close_all_button'];
        if ('selectModelAll' !== $event->getAction()->getName()) {
            $allowedButton[] = 'back_button';
        }

        foreach ($globalCommands->getCommands() as $command) {
            if (\in_array($command->getName(), $allowedButton)) {
                continue;
            }

            $command->setDisabled(true);
        }
    }
public function deactivateGlobalButton(ActionEvent $event)
    {
        $allowedAction = ['selectModelAll', 'selectPropertyAll', 'editAll', 'overrideAll'];
        if (!$this->scopeDeterminator->currentScopeIsBackend()
            || !\in_array($event->getAction()->getName(), $allowedAction)) {
            return;
        }

        $dataDefinition = $event->getEnvironment()->getDataDefinition();
        $backendView    = $dataDefinition->getDefinition(Contao2BackendViewDefinitionInterface::NAME);
        $globalCommands = $backendView->getGlobalCommands();

        $allowedButton = ['close_all_button'];
        if ('selectModelAll' !== $event->getAction()->getName()) {
            $allowedButton[] = 'back_button';
        }

        foreach ($globalCommands->getCommands() as $command) {
            if (\in_array($command->getName(), $allowedButton)) {
                continue;
            }

            $command->setDisabled(true);
        }
    }
public function deactivateGlobalButton ( ActionEvent $ event ) { $ allowedAction = [ 'selectModelAll' , 'selectPropertyAll' , 'editAll' , 'overrideAll' ] ; if ( ! $ this -> scopeDeterminator -> currentScopeIsBackend ( ) || ! \ in_array ( $ event -> getAction ( ) -> getName ( ) , $ allowedAction ) ) { return ; } $ dataDefinition = $ event -> getEnvironment ( ) -> getDataDefinition ( ) ; $ backendView = $ dataDefinition -> getDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) ; $ globalCommands = $ backendView -> getGlobalCommands ( ) ; $ allowedButton = [ 'close_all_button' ] ; if ( 'selectModelAll' !== $ event -> getAction ( ) -> getName ( ) ) { $ allowedButton [ ] = 'back_button' ; } foreach ( $ globalCommands -> getCommands ( ) as $ command ) { if ( \ in_array ( $ command -> getName ( ) , $ allowedButton ) ) { continue ; } $ command -> setDisabled ( true ) ; } }
Deactivate global button their are not useful.

@param ActionEvent $event The event.

@return void
Deactivate global button their are not useful .