[TASK] Add disable option for Viewpage language selector 98/43498/7
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Wed, 23 Sep 2015 09:58:40 +0000 (11:58 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 23 Sep 2015 19:43:26 +0000 (21:43 +0200)
Resolves: #70041
Releases: master
Change-Id: I81b4897e5560732b8b530d22b00ad9151ca5fff9
Reviewed-on: http://review.typo3.org/43498
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Documentation/Changelog/7.5/Feature-56282-LanguageSelectorForPageviewModule.rst
typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php

index a9d19bf..5631607 100644 (file)
@@ -6,3 +6,7 @@ Description
 ===========
 
 The pageview module now has a dropdown to select a language for the page preview.
+
+In case you switch languages based on something different than a parameter called ``L`` you can disable the selector by using the following PageTSConfig:
+
+``mod.SHARED.view.disableLanguageSelector = 1``
\ No newline at end of file
index fd7cdc8..56a2de2 100644 (file)
@@ -180,6 +180,9 @@ class ViewModuleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionContr
        protected function getPreviewLanguages() {
                $pageIdToShow = (int)GeneralUtility::_GP('id');
                $modSharedTSconfig = BackendUtility::getModTSconfig($pageIdToShow, 'mod.SHARED');
+               if ($modSharedTSconfig['properties']['view.']['disableLanguageSelector'] === '1') {
+                       return [];
+               }
                $languages = array(
                        0 => isset($modSharedTSconfig['properties']['defaultLanguageLabel'])
                                        ? $modSharedTSconfig['properties']['defaultLanguageLabel'] . ' (' . $this->getLanguageService()->sl('LLL:EXT:lang/locallang_mod_web_list.xlf:defaultLanguage') . ')'