TYPO3 CMS  TYPO3_7-6
ContainerViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * *
12  * This script is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
14  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
15  * General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU Lesser General Public *
18  * License along with the script. *
19  * If not, see http://www.gnu.org/licenses/lgpl.html *
20  * *
21  * The TYPO3 project - inspiring people to share! *
22  * */
23 
26 
51 {
70  public function render($pageTitle = '', $enableClickMenu = true, $loadExtJs = false, $loadExtJsTheme = true, $enableExtJsDebug = false, $loadJQuery = false, $includeCssFiles = null, $includeJsFiles = null, $addJsInlineLabels = null, $includeRequireJsModules = null, $jQueryNamespace = null)
71  {
72  $pageRenderer = $this->getPageRenderer();
73  $doc = $this->getDocInstance();
74  $doc->JScode .= $doc->wrapScriptTags($doc->redirectUrls());
75 
76  // Load various standard libraries
77  if ($enableClickMenu) {
78  $doc->getContextMenuCode();
79  }
80  if ($loadExtJs) {
81  $pageRenderer->loadExtJS(true, $loadExtJsTheme);
82  if ($enableExtJsDebug) {
83  $pageRenderer->enableExtJsDebug();
84  }
85  }
86  if ($loadJQuery) {
87  $jQueryNamespace = $jQueryNamespace ?: PageRenderer::JQUERY_NAMESPACE_DEFAULT;
88  $pageRenderer->loadJquery(null, null, $jQueryNamespace);
89  }
90  // Include custom CSS and JS files
91  if (is_array($includeCssFiles) && count($includeCssFiles) > 0) {
92  foreach ($includeCssFiles as $addCssFile) {
93  $pageRenderer->addCssFile($addCssFile);
94  }
95  }
96  if (is_array($includeJsFiles) && count($includeJsFiles) > 0) {
97  foreach ($includeJsFiles as $addJsFile) {
98  $pageRenderer->addJsFile($addJsFile);
99  }
100  }
101  if (is_array($includeRequireJsModules) && count($includeRequireJsModules) > 0) {
102  foreach ($includeRequireJsModules as $addRequireJsFile) {
103  $pageRenderer->loadRequireJsModule($addRequireJsFile);
104  }
105  }
106  // Add inline language labels
107  if (is_array($addJsInlineLabels) && count($addJsInlineLabels) > 0) {
108  $extensionKey = $this->controllerContext->getRequest()->getControllerExtensionKey();
109  foreach ($addJsInlineLabels as $key) {
110  $label = LocalizationUtility::translate($key, $extensionKey);
111  $pageRenderer->addInlineLanguageLabel($key, $label);
112  }
113  }
114  // Render the content and return it
115  $output = $this->renderChildren();
116  $output = $doc->startPage($pageTitle) . $output;
117  $output .= $doc->endPage();
118  return $output;
119  }
120 }
static translate($key, $extensionName, $arguments=null)
render($pageTitle='', $enableClickMenu=true, $loadExtJs=false, $loadExtJsTheme=true, $enableExtJsDebug=false, $loadJQuery=false, $includeCssFiles=null, $includeJsFiles=null, $addJsInlineLabels=null, $includeRequireJsModules=null, $jQueryNamespace=null)