Skip to content

Commit

Permalink
[BUGFIX] Reverted accidental changes by
Browse files Browse the repository at this point in the history
introduced by 31aa306

Releases: 2_x
  • Loading branch information
Jo Hasenau committed Jan 18, 2016
1 parent 7e53c6f commit 7c2655a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
28 changes: 8 additions & 20 deletions Classes/Controller/EditorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
use KayStrobach\Themes\Utilities\CheckPageUtility;
use KayStrobach\Themes\Utilities\FindParentPageWithThemeUtility;
use KayStrobach\Themes\Utilities\TsParserUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility;

/**
* Class EditorController
Expand Down Expand Up @@ -66,15 +64,12 @@ protected function initializeAction() {
$this->tsParser = new TsParserUtility();

// extension configuration

/** @var \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility */
$configurationUtility = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility');
$extensionConfiguration = $configurationUtility->getCurrentConfiguration('themes');
#$extensionConfiguration['categoriesToShow'] = GeneralUtility::trimExplode(',', $extensionConfiguration['categoriesToShow']);
#$extensionConfiguration['constantsToHide'] = GeneralUtility::trimExplode(',', $extensionConfiguration['constantsToHide']);
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['themes']);
$extensionConfiguration['categoriesToShow'] = GeneralUtility::trimExplode(',', $extensionConfiguration['categoriesToShow']);
$extensionConfiguration['constantsToHide'] = GeneralUtility::trimExplode(',', $extensionConfiguration['constantsToHide']);

// mod.tx_themes.constantCategoriesToShow.value
$externalConstantCategoriesToShow = $this->getBackendUser()->getTSConfig(
$externalConstantCategoriesToShow = $GLOBALS['BE_USER']->getTSConfig(
'mod.tx_themes.constantCategoriesToShow', BackendUtility::getPagesTSconfig($this->id)
);
if ($externalConstantCategoriesToShow['value']) {
Expand All @@ -85,7 +80,7 @@ protected function initializeAction() {
}

// mod.tx_themes.constantsToHide.value
$externalConstantsToHide = $this->getBackendUser()->getTSConfig(
$externalConstantsToHide = $GLOBALS['BE_USER']->getTSConfig(
'mod.tx_themes.constantsToHide', BackendUtility::getPagesTSconfig($this->id)
);
if ($externalConstantsToHide['value']) {
Expand Down Expand Up @@ -113,7 +108,7 @@ public function indexAction() {
$nearestPageWithTheme = $this->id;
$this->view->assign('selectedTheme', $selectedTheme);
$this->view->assign('categories', $this->renderFields($this->tsParser, $this->id, $this->allowedCategories, $this->deniedFields));
$categoriesFilterSettings = $this->getBackendUser()->getModuleData('mod-web_ThemesMod1/Categories/Filter/Settings', 'ses');
$categoriesFilterSettings = $GLOBALS['BE_USER']->getModuleData('mod-web_ThemesMod1/Categories/Filter/Settings', 'ses');
if($categoriesFilterSettings === NULL) {
$categoriesFilterSettings = array();
$categoriesFilterSettings['searchScope'] = 'all';
Expand Down Expand Up @@ -200,7 +195,7 @@ public function setThemeAction($theme = NULL) {
);
$tce = new \TYPO3\CMS\Core\DataHandling\DataHandler();
$tce->stripslashes_values = 0;
$user = clone $this->getBackendUser();
$user = clone $GLOBALS['BE_USER'];
$user->user['admin'] = 1;
$tce->start($record, Array(), $user);
$tce->process_datamap();
Expand Down Expand Up @@ -290,7 +285,7 @@ public function saveCategoriesFilterSettingsAction() {
}
}
// Save settings
$this->getBackendUser()->pushModuleData('mod-web_ThemesMod1/Categories/Filter/Settings', $categoriesFilterSettings);
$GLOBALS['BE_USER']->pushModuleData('mod-web_ThemesMod1/Categories/Filter/Settings', $categoriesFilterSettings);
// Create JSON-String
$response = array();
$response['success'] = '';
Expand All @@ -299,11 +294,4 @@ public function saveCategoriesFilterSettingsAction() {
$json = json_encode($response);
return $json;
}

/**
* @return BackendUserAuthentication
*/
protected function getBackendUser() {
return $GLOBALS['BE_USER'];
}
}
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'description' => '',
'category' => 'fe',
'shy' => 0,
'version' => '2.5.3',
'version' => '2.5.4',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
Expand Down

0 comments on commit 7c2655a

Please sign in to comment.