Esempio n. 1
0
 /**
  * Sets mandatory parameters for the view (pageRenderer)
  *
  * @return void
  */
 protected function setupPage()
 {
     // Yes, hardcoded on purpose
     $this->pageRenderer->setXmlPrologAndDocType('<!DOCTYPE html>');
     $this->pageRenderer->setCharSet('utf-8');
     $this->pageRenderer->setLanguage('default');
     $this->pageRenderer->addMetaTag('<meta name="viewport" content="width=device-width, initial-scale=1">');
 }
 /**
  * Tests the addInlineLanguageLabelFile() method.
  *
  * @test
  */
 public function areInlineLanguageLabelsSelectedAndStripped()
 {
     $this->fixture->setLanguage($GLOBALS['LANG']->lang);
     $this->fixture->addInlineLanguageLabelFile('EXT:lang/locallang_core.xml', 'labels.', 'lock');
     $out = $this->fixture->render();
     $this->assertContains('edRecord', $out);
     $this->assertContains('edRecord_content', $out);
     $this->assertContains('edRecordUser', $out);
 }
 /**
  * Initializing the getLL variables needed.
  *
  * @return void
  */
 public function initLLvars()
 {
     // Init languageDependencies list
     $this->languageDependencies = array();
     // Setting language key and split index:
     $this->lang = $this->config['config']['language'] ?: 'default';
     $this->pageRenderer->setLanguage($this->lang);
     // Finding the requested language in this list based
     // on the $lang key being inputted to this function.
     /** @var $locales Locales */
     $locales = GeneralUtility::makeInstance(Locales::class);
     $locales->initialize();
     // Language is found. Configure it:
     if (in_array($this->lang, $locales->getLocales())) {
         $this->languageDependencies[] = $this->lang;
         foreach ($locales->getLocaleDependencies($this->lang) as $language) {
             $this->languageDependencies[] = $language;
         }
     }
     // Setting charsets:
     $this->renderCharset = $this->csConvObj->parse_charset($this->config['config']['renderCharset'] ? $this->config['config']['renderCharset'] : 'utf-8');
     // Rendering charset of HTML page.
     $this->metaCharset = $this->csConvObj->parse_charset($this->config['config']['metaCharset'] ? $this->config['config']['metaCharset'] : $this->renderCharset);
 }
Esempio n. 4
0
 /**
  * Initializes the page renderer object
  */
 protected function initPageRenderer()
 {
     if ($this->pageRenderer !== null) {
         return;
     }
     $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
     $this->pageRenderer->setLanguage($GLOBALS['LANG']->lang);
     $this->pageRenderer->enableConcatenateFiles();
     $this->pageRenderer->enableCompressCss();
     $this->pageRenderer->enableCompressJavascript();
     // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
     foreach ($this->jsFilesNoConcatenation as $file) {
         $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file, 'text/javascript', true, false, '', true);
     }
     // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
     foreach ($this->jsFiles as $file) {
         $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file);
     }
     if ((int) $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1) {
         $this->pageRenderer->enableDebugMode();
     }
 }
Esempio n. 5
0
 /**
  * Gets instance of PageRenderer configured with the current language, file references and debug settings
  *
  * @return \TYPO3\CMS\Core\Page\PageRenderer
  */
 public function getPageRenderer()
 {
     if (!isset($this->pageRenderer)) {
         $this->pageRenderer = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Page\\PageRenderer');
         $this->pageRenderer->setLanguage($GLOBALS['LANG']->lang);
         $this->pageRenderer->addCssLibrary($GLOBALS['BACK_PATH'] . 'contrib/normalize/normalize.css', 'stylesheet', 'all', '', TRUE, TRUE);
         $this->pageRenderer->enableConcatenateFiles();
         $this->pageRenderer->enableCompressCss();
         $this->pageRenderer->enableCompressJavascript();
         // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
         foreach ($this->jsFilesNoConcatenation as $file) {
             $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file, 'text/javascript', TRUE, FALSE, '', TRUE);
         }
         // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
         foreach ($this->jsFiles as $file) {
             $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file);
         }
     }
     if ((int) $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1) {
         $this->pageRenderer->enableDebugMode();
     }
     return $this->pageRenderer;
 }
Esempio n. 6
0
 /**
  * Gets instance of PageRenderer configured with the current language, file references and debug settings
  *
  * @return \TYPO3\CMS\Core\Page\PageRenderer
  */
 public function getPageRenderer()
 {
     if (!isset($this->pageRenderer)) {
         $this->pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Page\\PageRenderer');
         $this->pageRenderer->setTemplateFile(TYPO3_mainDir . 'templates/template_page_backend.html');
         $this->pageRenderer->setLanguage($GLOBALS['LANG']->lang);
         $this->pageRenderer->enableConcatenateFiles();
         $this->pageRenderer->enableCompressCss();
         $this->pageRenderer->enableCompressJavascript();
         // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
         foreach ($this->jsFiles as $file) {
             $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file);
         }
     }
     if (intval($GLOBALS['TYPO3_CONF_VARS']['BE']['debug']) === 1) {
         $this->pageRenderer->enableDebugMode();
     }
     return $this->pageRenderer;
 }