[BUGFIX] Hide version selector if workspaces are used
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Template / FrontendDocumentTemplate.php
1 <?php
2 namespace TYPO3\CMS\Backend\Template;
3
4 /**
5 * Extension class for "template" - used in the context of frontend editing.
6 */
7 class FrontendDocumentTemplate extends \TYPO3\CMS\Backend\Template\DocumentTemplate {
8
9 /**
10 * Gets instance of PageRenderer
11 *
12 * @return \TYPO3\CMS\Core\Page\PageRenderer
13 */
14 public function getPageRenderer() {
15 if (!isset($this->pageRenderer)) {
16 $this->pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
17 }
18 return $this->pageRenderer;
19 }
20
21 /**
22 * Used in the frontend context to insert header data via TSFE->additionalHeaderData.
23 * Mimics header inclusion from template->startPage().
24 *
25 * @return void
26 */
27 public function insertHeaderData() {
28 $this->backPath = ($GLOBALS['TSFE']->backPath = TYPO3_mainDir);
29 $this->pageRenderer->setBackPath($this->backPath);
30 $this->docStyle();
31 // Add applied JS/CSS to $GLOBALS['TSFE']
32 if ($this->JScode) {
33 $this->pageRenderer->addHeaderData($this->JScode);
34 }
35 if (count($this->JScodeArray)) {
36 foreach ($this->JScodeArray as $name => $code) {
37 $this->pageRenderer->addJsInlineCode($name, $code, FALSE);
38 }
39 }
40 }
41
42 }
43
44
45 ?>