Classes/Controller/ManagementController.php
protected function getButtons()
    {
        /** @var UriBuilder $uriBuilder */
        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);

        $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();

        // Create new
        $newRecordButton = $buttonBar->makeLinkButton()
            ->setHref((string)$uriBuilder->buildUriFromRoute(
                'record_edit',
                [
                    'edit' => ['sys_redirect' => ['new'],
                ],
                'returnUrl' => (string)$uriBuilder->buildUriFromRoute('site_redirects'),
            ]
            ))
            ->setTitle($this->getLanguageService()->getLL('redirect_add_text'))
            ->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));
        $buttonBar->addButton($newRecordButton, ButtonBar::BUTTON_POSITION_LEFT, 10);

        // Reload
        $reloadButton = $buttonBar->makeLinkButton()
            ->setHref(GeneralUtility::getIndpEnv('REQUEST_URI'))
            ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.reload'))
            ->setIcon($this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
        $buttonBar->addButton($reloadButton, ButtonBar::BUTTON_POSITION_RIGHT);

        // Shortcut
        $mayMakeShortcut = $this->getBackendUserAuthentication()->mayMakeShortcut();
        if ($mayMakeShortcut) {
            $getVars = ['id', 'route'];

            $shortcutButton = $buttonBar->makeShortcutButton()
                ->setModuleName('site_redirects')
                ->setGetVariables($getVars);
            $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT);
        }
    }
protected function getButtons()
    {
        /** @var UriBuilder $uriBuilder */
        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);

        $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();

        // Create new
        $newRecordButton = $buttonBar->makeLinkButton()
            ->setHref((string)$uriBuilder->buildUriFromRoute(
                'record_edit',
                [
                    'edit' => ['sys_redirect' => ['new'],
                ],
                'returnUrl' => (string)$uriBuilder->buildUriFromRoute('site_redirects'),
            ]
            ))
            ->setTitle($this->getLanguageService()->getLL('redirect_add_text'))
            ->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));
        $buttonBar->addButton($newRecordButton, ButtonBar::BUTTON_POSITION_LEFT, 10);

        // Reload
        $reloadButton = $buttonBar->makeLinkButton()
            ->setHref(GeneralUtility::getIndpEnv('REQUEST_URI'))
            ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.reload'))
            ->setIcon($this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
        $buttonBar->addButton($reloadButton, ButtonBar::BUTTON_POSITION_RIGHT);

        // Shortcut
        $mayMakeShortcut = $this->getBackendUserAuthentication()->mayMakeShortcut();
        if ($mayMakeShortcut) {
            $getVars = ['id', 'route'];

            $shortcutButton = $buttonBar->makeShortcutButton()
                ->setModuleName('site_redirects')
                ->setGetVariables($getVars);
            $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT);
        }
    }
protected function getButtons ( ) { /** @var UriBuilder $uriBuilder */ $ uriBuilder = GeneralUtility :: makeInstance ( UriBuilder :: class ) ; $ buttonBar = $ this -> moduleTemplate -> getDocHeaderComponent ( ) -> getButtonBar ( ) ; // Create new $ newRecordButton = $ buttonBar -> makeLinkButton ( ) -> setHref ( ( string ) $ uriBuilder -> buildUriFromRoute ( 'record_edit' , [ 'edit' => [ 'sys_redirect' => [ 'new' ] , ] , 'returnUrl' => ( string ) $ uriBuilder -> buildUriFromRoute ( 'site_redirects' ) , ] ) ) -> setTitle ( $ this -> getLanguageService ( ) -> getLL ( 'redirect_add_text' ) ) -> setIcon ( $ this -> iconFactory -> getIcon ( 'actions-add' , Icon :: SIZE_SMALL ) ) ; $ buttonBar -> addButton ( $ newRecordButton , ButtonBar :: BUTTON_POSITION_LEFT , 10 ) ; // Reload $ reloadButton = $ buttonBar -> makeLinkButton ( ) -> setHref ( GeneralUtility :: getIndpEnv ( 'REQUEST_URI' ) ) -> setTitle ( $ this -> getLanguageService ( ) -> sL ( 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.reload' ) ) -> setIcon ( $ this -> iconFactory -> getIcon ( 'actions-refresh' , Icon :: SIZE_SMALL ) ) ; $ buttonBar -> addButton ( $ reloadButton , ButtonBar :: BUTTON_POSITION_RIGHT ) ; // Shortcut $ mayMakeShortcut = $ this -> getBackendUserAuthentication ( ) -> mayMakeShortcut ( ) ; if ( $ mayMakeShortcut ) { $ getVars = [ 'id' , 'route' ] ; $ shortcutButton = $ buttonBar -> makeShortcutButton ( ) -> setModuleName ( 'site_redirects' ) -> setGetVariables ( $ getVars ) ; $ buttonBar -> addButton ( $ shortcutButton , ButtonBar :: BUTTON_POSITION_RIGHT ) ; } }
Create document header buttons
Create document header buttons