20662fa1a217740480c116ee2199ae1dd27c9e94
[Packages/TYPO3.CMS.git] / typo3 / sysext / beuser / Classes / ViewHelpers / Be / ContainerViewHelper.php
1 <?php
2 namespace TYPO3\CMS\Beuser\ViewHelpers\Be;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * View helper which allows you to create extbase based modules in the style of TYPO3 default modules.
19 *
20 * Extends fluid be.container view helper adding a feature to register RequireJS modules.
21 *
22 * @see \TYPO3\CMS\Fluid\ViewHelpers\Be\ContainerViewHelper
23 */
24 class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\ContainerViewHelper {
25
26 /**
27 * Render start page with \TYPO3\CMS\Backend\Template\DocumentTemplate
28 *
29 * @param string $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
30 * @param bool $enableClickMenu If TRUE, loads clickmenu.js required by BE context menus. Defaults to TRUE
31 * @param bool $loadPrototype specifies whether to load prototype library. Defaults to TRUE
32 * @param bool $loadScriptaculous specifies whether to load scriptaculous libraries. Defaults to FALSE
33 * @param string $scriptaculousModule additionales modules for scriptaculous
34 * @param bool $loadExtJs specifies whether to load ExtJS library. Defaults to FALSE
35 * @param bool $loadExtJsTheme whether to load ExtJS "grey" theme. Defaults to FALSE
36 * @param string $extJsAdapter load alternative adapter (ext-base is default adapter)
37 * @param bool $enableExtJsDebug if TRUE, debug version of ExtJS is loaded. Use this for development only
38 * @param bool $loadJQuery whether to load jQuery library. Defaults to FALSE
39 * @param array $includeCssFiles List of custom CSS file to be loaded
40 * @param array $includeJsFiles List of custom JavaScript file to be loaded
41 * @param array $addJsInlineLabels Custom labels to add to JavaScript inline labels
42 * @param bool $includeCsh flag for including CSH
43 * @param array $loadRequireJsModules List of require JS modules to register
44 * @return string
45 */
46 public function render(
47 $pageTitle = '',
48 $enableClickMenu = TRUE,
49 $loadPrototype = TRUE,
50 $loadScriptaculous = FALSE,
51 $scriptaculousModule = '',
52 $loadExtJs = FALSE,
53 $loadExtJsTheme = TRUE,
54 $extJsAdapter = '',
55 $enableExtJsDebug = FALSE,
56 $loadJQuery = FALSE,
57 $includeCssFiles = NULL,
58 $includeJsFiles = NULL,
59 $addJsInlineLabels = NULL,
60 $includeCsh = TRUE,
61 $loadRequireJsModules = NULL
62 ) {
63 $doc = $this->getDocInstance();
64 $pageRenderer = $doc->getPageRenderer();
65
66 if (is_array($loadRequireJsModules)) {
67 foreach ($loadRequireJsModules as $module) {
68 $pageRenderer->loadRequireJsModule($module);
69 }
70 }
71
72 return parent::render(
73 $pageTitle,
74 $enableClickMenu,
75 $loadPrototype,
76 $loadScriptaculous,
77 $scriptaculousModule,
78 $loadExtJs,
79 $loadExtJsTheme,
80 $extJsAdapter,
81 $enableExtJsDebug,
82 FALSE,
83 $includeCssFiles,
84 $includeJsFiles,
85 $addJsInlineLabels,
86 $includeCsh
87 );
88 }
89
90 }