[TYPO3-core] RFC: #16383: BE Module are complicate to render

Steffen Kamper info at sk-typo3.de
Sun Nov 14 18:18:03 CET 2010


Hi,

this is a SVN patch request.

Type: Feature / Cleanup

BT Reference: http://bugs.typo3.org/view.php?id=16383

Branches: trunk

To generate the page of a BE module you have to be carefully and it's 
not easy to concatenate it the right way.
Also many modules forget to call in last step the replace of JS and CSS 
markers (insertStylesAndJS) which lead to forgotten JS/CSS, at least to 
unreplaced markers.

When a module calls $this->doc->startPage, pageRenderer does a render. 
After this point you can't add something to pageRenderer anymore, which 
can lead to problems.

Solution:
Add a shortcut method "render" which does all these steps automatic and 
deliver the complete page.
This is the recommended way to render a BE module with docheader:

1) collect all content and fill markers with content and docheader items
2) call $this->doc->moduleBody to replace template with markers
3) call $this->docrender to complete the page

Example:

// Build the <body> for the module
$this->content = $this->doc->moduleBody($this->pageinfo, 
$docHeaderButtons, $markers);
     // Renders the module page
$this->content = $this->doc->render(
     $GLOBALS['LANG']->getLL('title'),
     $this->content
);

The attached patch change this for all BE modules of core.
This should be adapted in kickstarter as well (for version 4.5+)

vg Steffen
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 16383.patch
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101114/78b6608f/attachment-0001.txt>


More information about the TYPO3-team-core mailing list