Project

General

Profile

Actions

Task #71362

closed

Add hook to manipulate docHeader buttons when using the ModuleTemplateAPI

Added by Frans Saris over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2015-11-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The "old" backend module rendering knows the $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['docHeaderButtonsHook'] hook so you are able to manipulate the docHeader buttons. This isn't yet implemented in the new ModuleTemplateAPI

Actions #1

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44569

Actions #2

Updated by Frans Saris over 8 years ago

To easily test the hook add next lines to your typo3conf/AdditionalConfiguration.php

            $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend\Template\Components\ButtonBar']['getButtonsHook']['HookTest'] =
            function($params, TYPO3\CMS\Backend\Template\Components\ButtonBar $buttonBar) {
                $buttons = $params['buttons'];
//                if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('M') === 'web_list') {
                    $iconFactory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconFactory::class);
                    $button = $buttonBar->makeLinkButton();
                    $button->setShowLabelText(true);
                    $button->setIcon($iconFactory->getIcon('actions-system-backend-user-emulate', \TYPO3\CMS\Core\Imaging\Icon::SIZE_SMALL));
                    $button->setTitle('getButtons hook test');
                    $button->setOnClick('alert("Hook works");return false;');

                    $buttons[\TYPO3\CMS\Backend\Template\Components\ButtonBar::BUTTON_POSITION_LEFT][1][] = $button;
//                }
                return $buttons;
            };
Actions #3

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44569

Actions #4

Updated by Frans Saris over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF