Added User TSconfig option "options.checkPageLanguageOverlay" so flexforms only show...
authorKasper Skårhøj <kasper@typo3.org>
Fri, 9 Oct 2009 07:04:34 +0000 (07:04 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Fri, 9 Oct 2009 07:04:34 +0000 (07:04 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6117 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_tceforms.php

index 25f0400..994511e 100644 (file)
@@ -2419,10 +2419,26 @@ class t3lib_TCEforms    {
                        $langDisabled = $dataStructArray['meta']['langDisable'] ? 1 : 0;
 
                        $editData['meta']['currentLangId']=array();
+
+                               // Look up page overlays:
+                       $checkPageLanguageOverlay = $GLOBALS['BE_USER']->getTSConfigVal('options.checkPageLanguageOverlay')?TRUE:FALSE;
+                       if ($checkPageLanguageOverlay)  {
+                               $pageOverlays = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                                       '*',
+                                       'pages_language_overlay',
+                                       'pid='.intval($row['pid']).
+                                               t3lib_BEfunc::deleteClause('pages_language_overlay').
+                                               t3lib_BEfunc::versioningPlaceholderClause('pages_language_overlay'),
+                                       '',
+                                       '',
+                                       '',
+                                       'sys_language_uid'
+                               );
+                       }
                        $languages = $this->getAvailableLanguages();
 
                        foreach($languages as $lInfo)   {
-                               if ($GLOBALS['BE_USER']->checkLanguageAccess($lInfo['uid']))    {
+                               if ($GLOBALS['BE_USER']->checkLanguageAccess($lInfo['uid']) && (!$checkPageLanguageOverlay || $lInfo['uid']<=0 || is_array($pageOverlays[$lInfo['uid']])))      {
                                        $editData['meta']['currentLangId'][] =  $lInfo['ISOcode'];
                                }
                        }