Project

General

Profile

Actions

Feature #69814

closed

ModuleTemplate API

Added by Mathias Schreiber over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend API
Target version:
Start date:
2015-09-15
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:
Remote Sprint

Description

Challenge

Currently all DocHeaders are implemented on their own.
This means we have about 80 DocHeaders which are equal but not the same.
The main challenge is to provide extension developers with all tools they need to build decent backend modules while maintaining control of the docHeader itself.

Solution

We will provide a replacement for DocumentTemplate which provides an easy-to-use API which is on the other hand flexible enough to tackle all tasks we currently think of.
At the same time we will remove the amount of duplicate marker based templates.

The API uses the Fluent-API approach and has been built to supply maximum IDE code completion support.

Parts of a docHeader

Currently a typical docHeader is split up into the following sections:
  • Top Bar
    • Context Sensitive Help Icon
    • Select Menu(s)
    • Path
    • RecordInformation incl. Clickmenu
  • Bottom Bar
    • Left Button Bar
    • Right Button Bar

API Components

Buttons

InputButton

Used to generate a <button> element.

LinkButton

Used to generate links

SplitButton

A mixed component accepting multiple button objects and renders them into a condensed form.

Examples of usages

Adding a button

$openInNewWindowButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()
    ->makeLinkButton()
    ->setHref('#')
    ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow', TRUE))
    ->setIcon($this->iconFactory->getIcon('actions-window-open', Icon::SIZE_SMALL))
    ->setOnClick(htmlspecialchars($aOnClick));
$this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton($openInNewWindowButton, ButtonBar::BUTTON_POSITION_RIGHT);

Adding a menu with menu items

$languageMenu = $this->moduleTemplate->getDocHeaderComponent()->getModuleMenuRegistry()->makeMenu()
    ->setIdentifier('_langSelector')
    ->setLabel($this->getLanguageService()->sL('LLL:EXT:lang/locallang_general.xlf:LGL.language', TRUE));
$menuItem = $languageMenu->makeMenuItem()
    ->setTitle($lang['title'] . $newTranslation)
    ->setHref($href);
if((int)$lang['uid'] === $currentLanguage) {
    $menuItem->setActive(TRUE);
}
$languageMenu->addMenuItem($menuItem);
$this->moduleTemplate->getDocHeaderComponent()->getModuleMenuRegistry()->addMenu($languageMenu);

Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Epic #69841: Roll out of ModuleTemplate APIClosed2015-09-15

Actions
Related to TYPO3 Core - Bug #71386: Wrong title in rst fileClosedFrank Nägler2015-11-06

Actions
Precedes TYPO3 Core - Bug #70065: Cannot create bookmarkClosed2015-09-24

Actions
Precedes TYPO3 Core - Bug #70063: Invalid/missing CSRF tokenClosed2015-09-24

Actions
Actions #1

Updated by Gerrit Code Review over 8 years ago

  • Status changed from In Progress to Under Review

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

Actions #2

Updated by Gerrit Code Review over 8 years ago

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

Actions #3

Updated by Gerrit Code Review over 8 years ago

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

Actions #4

Updated by Gerrit Code Review over 8 years ago

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

Actions #5

Updated by Gerrit Code Review over 8 years ago

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

Actions #6

Updated by Gerrit Code Review over 8 years ago

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

Actions #7

Updated by Gerrit Code Review over 8 years ago

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

Actions #8

Updated by Gerrit Code Review over 8 years ago

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

Actions #9

Updated by Gerrit Code Review over 8 years ago

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

Actions #10

Updated by Gerrit Code Review over 8 years ago

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

Actions #11

Updated by Gerrit Code Review over 8 years ago

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

Actions #12

Updated by Gerrit Code Review over 8 years ago

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

Actions #13

Updated by Gerrit Code Review over 8 years ago

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

Actions #14

Updated by Gerrit Code Review over 8 years ago

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

Actions #15

Updated by Gerrit Code Review over 8 years ago

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

Actions #16

Updated by Gerrit Code Review over 8 years ago

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

Actions #17

Updated by Gerrit Code Review over 8 years ago

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

Actions #18

Updated by Gerrit Code Review over 8 years ago

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

Actions #19

Updated by Gerrit Code Review over 8 years ago

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

Actions #20

Updated by Gerrit Code Review over 8 years ago

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

Actions #21

Updated by Gerrit Code Review over 8 years ago

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

Actions #22

Updated by Gerrit Code Review over 8 years ago

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

Actions #23

Updated by Gerrit Code Review over 8 years ago

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

Actions #24

Updated by Gerrit Code Review over 8 years ago

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

Actions #25

Updated by Gerrit Code Review over 8 years ago

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

Actions #26

Updated by Gerrit Code Review over 8 years ago

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

Actions #27

Updated by Gerrit Code Review over 8 years ago

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

Actions #28

Updated by Gerrit Code Review over 8 years ago

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

Actions #29

Updated by Gerrit Code Review over 8 years ago

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

Actions #30

Updated by Gerrit Code Review over 8 years ago

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

Actions #31

Updated by Gerrit Code Review over 8 years ago

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

Actions #32

Updated by Gerrit Code Review over 8 years ago

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

Actions #33

Updated by Gerrit Code Review over 8 years ago

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

Actions #34

Updated by Gerrit Code Review over 8 years ago

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

Actions #35

Updated by Anja Leichsenring over 8 years ago

  • Sprint Focus changed from On Location Sprint to Stabilization Sprint
Actions #36

Updated by Gerrit Code Review over 8 years ago

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

Actions #37

Updated by Gerrit Code Review over 8 years ago

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

Actions #38

Updated by Mathias Schreiber over 8 years ago

  • Target version changed from 7.5 to 7 LTS
  • Sprint Focus changed from Stabilization Sprint to Remote Sprint
Actions #39

Updated by Gerrit Code Review over 8 years ago

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

Actions #40

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 http://review.typo3.org/43465

Actions #41

Updated by Gerrit Code Review over 8 years ago

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

Actions #42

Updated by Gerrit Code Review over 8 years ago

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

Actions #43

Updated by Gerrit Code Review over 8 years ago

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

Actions #44

Updated by Gerrit Code Review over 8 years ago

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

Actions #45

Updated by Gerrit Code Review over 8 years ago

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

Actions #46

Updated by Gerrit Code Review over 8 years ago

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

Actions #47

Updated by Gerrit Code Review over 8 years ago

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

Actions #48

Updated by Gerrit Code Review over 8 years ago

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

Actions #49

Updated by Mathias Schreiber over 8 years ago

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

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF