/**
  * @param string $theme
  * @return string
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
  */
 public function render($theme)
 {
     $pageId = intval(GeneralUtility::_GET('id'));
     $themeOfPage = $this->themeRepository->findByPageOrRootline($pageId);
     if ($themeOfPage !== NULL && $themeOfPage->getExtensionName() === $theme) {
         return $this->renderThenChild();
     }
     return $this->renderElseChild();
 }
Esempio n. 2
0
 /**
  * renders the given theme
  *
  * @return void
  */
 public function indexAction()
 {
     $this->templateName = $this->evaluateTypoScript('plugin.tx_themes.settings.templateName');
     $templateFile = $this->getTemplateFile();
     if ($templateFile !== NULL) {
         $this->view->setTemplatePathAndFilename($templateFile);
     }
     $this->view->assign('templateName', $this->templateName);
     $this->view->assign('theme', $this->themeRepository->findByPageOrRootline($GLOBALS['TSFE']->id));
 }
Esempio n. 3
0
 /**
  * renders the given theme.
  *
  * @return void
  */
 public function indexAction()
 {
     $this->templateName = $this->evaluateTypoScript('plugin.tx_themes.settings.templateName');
     $templateFile = $this->getTemplateFile();
     if ($templateFile !== null) {
         $this->view->setTemplatePathAndFilename($templateFile);
     }
     $this->view->assign('templateName', $this->templateName);
     $frontendController = $this->getFrontendController();
     $this->view->assign('theme', $this->themeRepository->findByPageOrRootline($frontendController->id));
     // Get page data
     $pageArray = $this->pageRepository->getPage($frontendController->id);
     $pageArray['icon'] = '';
     // Map page icon
     if (isset($pageArray['tx_themes_icon']) && $pageArray['tx_themes_icon'] != '') {
         $setup = $frontendController->tmpl->setup;
         $pageArray['icon'] = $setup['lib.']['icons.']['cssMap.'][$pageArray['tx_themes_icon']];
     }
     $this->view->assign('page', $pageArray);
     $this->view->assign('data', $pageArray);
     $this->view->assign('TSFE', $frontendController);
 }
Esempio n. 4
0
 /**
  * activate a theme.
  *
  * @param string $theme
  *
  * @return void
  */
 public function showThemeDetailsAction($theme = null)
 {
     $themeObject = $this->themeRepository->findByIdentifier($theme);
     $this->view->assign('theme', $themeObject);
 }
 /**
  * @test
  */
 public function findAllTypeTest()
 {
     $this->assertGreaterThanOrEqual('array', gettype($this->fixture->findAll()), 'themes does not contain an array of themes');
 }