src/Contao/View/Contao2BackendView/GlobalButtonRenderer.php
public function render()
    {
        /** @var CommandInterface[] $commands */
        $commands = $this
            ->environment
            ->getDataDefinition()
            ->getDefinition(Contao2BackendViewDefinitionInterface::NAME)
            ->getGlobalCommands()
            ->getCommands();

        if (!\is_array($commands)) {
            $commands = [];
        }

        $buttons = [];
        foreach ($commands as $command) {
            if ($command->isDisabled()) {
                continue;
            }
            $buttons[$command->getName()] = $this->renderButton($command);
        }

        $buttonsEvent = new GetGlobalButtonsEvent($this->environment);
        $buttonsEvent->setButtons($buttons);
        $this->dispatcher->dispatch(GetGlobalButtonsEvent::NAME, $buttonsEvent);

        return '<div id="tl_buttons">' . \implode('', $buttonsEvent->getButtons()) . '</div>';
    }
public function render()
    {
        /** @var CommandInterface[] $commands */
        $commands = $this
            ->environment
            ->getDataDefinition()
            ->getDefinition(Contao2BackendViewDefinitionInterface::NAME)
            ->getGlobalCommands()
            ->getCommands();

        if (!\is_array($commands)) {
            $commands = [];
        }

        $buttons = [];
        foreach ($commands as $command) {
            if ($command->isDisabled()) {
                continue;
            }
            $buttons[$command->getName()] = $this->renderButton($command);
        }

        $buttonsEvent = new GetGlobalButtonsEvent($this->environment);
        $buttonsEvent->setButtons($buttons);
        $this->dispatcher->dispatch(GetGlobalButtonsEvent::NAME, $buttonsEvent);

        return '<div id="tl_buttons">' . \implode('', $buttonsEvent->getButtons()) . '</div>';
    }
public function render ( ) { /** @var CommandInterface[] $commands */ $ commands = $ this -> environment -> getDataDefinition ( ) -> getDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) -> getGlobalCommands ( ) -> getCommands ( ) ; if ( ! \ is_array ( $ commands ) ) { $ commands = [ ] ; } $ buttons = [ ] ; foreach ( $ commands as $ command ) { if ( $ command -> isDisabled ( ) ) { continue ; } $ buttons [ $ command -> getName ( ) ] = $ this -> renderButton ( $ command ) ; } $ buttonsEvent = new GetGlobalButtonsEvent ( $ this -> environment ) ; $ buttonsEvent -> setButtons ( $ buttons ) ; $ this -> dispatcher -> dispatch ( GetGlobalButtonsEvent :: NAME , $ buttonsEvent ) ; return '<div id="tl_buttons">' . \ implode ( '' , $ buttonsEvent -> getButtons ( ) ) . '</div>' ; }
Generate all global operation buttons for a view.

@return string
Generate all global operation buttons for a view .