*/
use TYPO3\CMS\Core\Page\PageRenderer;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
* = Examples =
*
* <code title="All options">
- * <f:be.pageRenderer pageTitle="foo" loadExtJs="true" loadExtJsTheme="false" extJsAdapter="jQuery" enableExtJsDebug="true" loadJQuery="true" includeCssFiles="0: '{f:uri.resource(path:\'Css/Styles.css\')}'" includeJsFiles="0: '{f:uri.resource(path:\'JavaScript/Library1.js\')}', 1: '{f:uri.resource(path:\'JavaScript/Library2.js\')}'" addJsInlineLabels="{0: 'label1', 1: 'label2'}" />
+ * <f:be.pageRenderer pageTitle="foo" includeCssFiles="0: '{f:uri.resource(path:\'Css/Styles.css\')}'" includeJsFiles="0: '{f:uri.resource(path:\'JavaScript/Library1.js\')}', 1: '{f:uri.resource(path:\'JavaScript/Library2.js\')}'" addJsInlineLabels="{0: 'label1', 1: 'label2'}" />
* </code>
* <output>
*
* Custom CSS file EXT:your_extension/Resources/Public/Css/styles.css and
* JavaScript files EXT:your_extension/Resources/Public/JavaScript/Library1.js and EXT:your_extension/Resources/Public/JavaScript/Library2.js
- * will be loaded, plus ExtJS and jQuery and some inline labels for usage in JS code.
+ * will be loaded, plus some inline labels for usage in JS code.
* </output>
*/
class PageRendererViewHelper extends AbstractViewHelper
{
parent::initializeArguments();
$this->registerArgument('pageTitle', 'string', 'title tag of the module. Not required by default, as BE modules are shown in a frame', false, '');
- $this->registerArgument('loadExtJs', 'bool', 'specifies whether to load ExtJS library. Defaults to FALSE. This option will be removed in TYPO3 v9', false, false);
- $this->registerArgument('loadExtJsTheme', 'bool', 'whether to load ExtJS "grey" theme. Defaults to FALSE. This option will be removed in TYPO3 v9', false, true);
- $this->registerArgument('enableExtJsDebug', 'bool', 'if TRUE, debug version of ExtJS is loaded. Use this for development only. This option will be removed in TYPO3 v9', false, false);
- $this->registerArgument('loadJQuery', 'bool', 'whether to load jQuery library. Defaults to FALSE. This option will be removed in TYPO3 v9', false, false);
$this->registerArgument('includeCssFiles', 'array', 'List of custom CSS file to be loaded');
$this->registerArgument('includeJsFiles', 'array', 'List of custom JavaScript file to be loaded');
$this->registerArgument('addJsInlineLabels', 'array', 'Custom labels to add to JavaScript inline labels');
$this->registerArgument('includeRequireJsModules', 'array', 'List of RequireJS modules to be loaded');
- $this->registerArgument('jQueryNamespace', 'string', 'Store the jQuery object in a specific namespace. This option will be removed in TYPO3 v9');
$this->registerArgument('addInlineSettings', 'array', 'Adds Javascript Inline Setting');
}
public function render()
{
$pageTitle = $this->arguments['pageTitle'];
- $loadExtJs = $this->arguments['loadExtJs'];
- $loadExtJsTheme = $this->arguments['loadExtJsTheme'];
- $enableExtJsDebug = $this->arguments['enableExtJsDebug'];
- $loadJQuery = $this->arguments['loadJQuery'];
$includeCssFiles = $this->arguments['includeCssFiles'];
$includeJsFiles = $this->arguments['includeJsFiles'];
$addJsInlineLabels = $this->arguments['addJsInlineLabels'];
$includeRequireJsModules = $this->arguments['includeRequireJsModules'];
- $jQueryNamespace = $this->arguments['jQueryNamespace'];
$addInlineSettings = $this->arguments['addInlineSettings'];
if ($pageTitle) {
$this->pageRenderer->setTitle($pageTitle);
}
- if ($loadExtJs) {
- GeneralUtility::logDeprecatedViewHelperAttribute(
- 'loadExtJs',
- $this->renderingContext,
- 'Setting "loadExtJs" and "loadExtJsTheme" in PageRenderer ViewHelper is deprecated, the option will be removed in TYPO3 v9'
- );
- $this->pageRenderer->loadExtJS(true, $loadExtJsTheme);
- if ($enableExtJsDebug) {
- GeneralUtility::logDeprecatedViewHelperAttribute(
- 'enableExtJsDebug',
- $this->renderingContext,
- 'Setting "enableExtJsDebug" in PageRenderer ViewHelper is deprecated, the option will be removed in TYPO3 v9'
- );
- $this->pageRenderer->enableExtJsDebug();
- }
- }
- if ($loadJQuery) {
- GeneralUtility::logDeprecatedViewHelperAttribute(
- 'loadjQuery',
- $this->renderingContext,
- 'Setting "loadjQuery" and "jQueryNamespace" in PageRenderer ViewHelper are deprecated, the option will be removed in TYPO3 v9'
- );
- $jQueryNamespace = $jQueryNamespace ?: PageRenderer::JQUERY_NAMESPACE_DEFAULT;
- $this->pageRenderer->loadJquery(null, null, $jQueryNamespace);
- }
// Include custom CSS and JS files
if (is_array($includeCssFiles) && count($includeCssFiles) > 0) {
foreach ($includeCssFiles as $addCssFile) {