[BUGFIX] Add namespace argument for inline settings array
[Packages/TYPO3.CMS.git] / typo3 / sysext / belog / Classes / ViewHelpers / Be / InlineSettingsArrayViewHelper.php
1 <?php
2 namespace TYPO3\CMS\Belog\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 to add a additional javascript settings to the backend header
19 *
20 * @author Christian Kuhn <lolli@schwarzbu.ch>
21 * @internal
22 */
23 class InlineSettingsArrayViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper {
24
25 /**
26 * Render additional javascript to page
27 *
28 * @param array $settings Custom JavaScript settings to be added
29 * @param string $namespace Set custom namespace for inline settings array
30 * @return void
31 * @see \TYPO3\CMS\Backend\Template\DocumentTemplate
32 * @see \TYPO3\CMS\Core\Page\PageRenderer
33 */
34 public function render(array $settings, $namespace = '') {
35 $doc = $this->getDocInstance();
36 $pageRenderer = $doc->getPageRenderer();
37 $pageRenderer->addInlineSettingArray($namespace, $settings);
38 }
39
40 }