Exemple #1
0
 /**
  * adds the overlay icon to a page with a theme set
  *
  * @param $table
  * @param $row
  * @param $status
  * @return void
  */
 public function overrideIconOverlay($table, &$row, &$status)
 {
     if ($table === 'pages') {
         if (CheckPageUtility::hasTheme($row['uid']) > 0) {
             $status['themefound'] = TRUE;
         }
     }
 }
 /**
  * @todo missing docblock
  */
 public static function find($pid)
 {
     // Check the own page first
     if (CheckPageUtility::hasThemeableSysTemplateRecord($pid)) {
         return $pid;
     }
     // ..then the rootline pages
     $rootLineUtility = new RootlineUtility($pid);
     $pages = $rootLineUtility->get();
     foreach ($pages as $page) {
         if (CheckPageUtility::hasThemeableSysTemplateRecord($page['pid'])) {
             return $page['pid'];
         }
     }
     return NULL;
 }
 /**
  * activate a theme.
  *
  * @param string $theme
  *
  * @return void
  */
 public function setThemeAction($theme = null)
 {
     $sysTemplateRecordUid = CheckPageUtility::getThemeableSysTemplateRecord($this->id);
     if ($sysTemplateRecordUid !== false && $theme !== null) {
         $record = ['sys_template' => [$sysTemplateRecordUid => ['tx_themes_skin' => $theme]]];
         $tce = new \TYPO3\CMS\Core\DataHandling\DataHandler();
         $tce->stripslashes_values = 0;
         $user = clone $this->getBackendUser();
         $user->user['admin'] = 1;
         $tce->start($record, [], $user);
         $tce->process_datamap();
         $tce->clear_cacheCmd('pages');
     } else {
         $this->flashMessageContainer->add('Problem selecting theme');
     }
     $this->redirect('index');
 }
Exemple #4
0
 /**
  * activate a theme
  *
  * @param string $theme
  * @return void
  */
 public function setThemeAction($theme = NULL)
 {
     $sysTemplateRecordUid = CheckPageUtility::getThemeableSysTemplateRecord($this->id);
     if ($sysTemplateRecordUid !== FALSE && $theme !== NULL) {
         $record = array('sys_template' => array($sysTemplateRecordUid => array('tx_themes_skin' => $theme)));
         $tce = new \TYPO3\CMS\Core\DataHandling\DataHandler();
         $tce->stripslashes_values = 0;
         $user = clone $GLOBALS['BE_USER'];
         $user->user['admin'] = 1;
         $tce->start($record, array(), $user);
         $tce->process_datamap();
         $tce->clear_cacheCmd('pages');
     } else {
         $this->flashMessageContainer->add('Problem selecting theme');
     }
     $this->redirect('index');
 }