* Fixed bug; All page types (doktype) was shown to uses even if they were not all...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_tceforms.php
index 5987005..ab9518e 100755 (executable)
@@ -1084,13 +1084,20 @@ class t3lib_TCEforms    {
                if ($config['itemsProcFunc']) $selItems = $this->procItems($selItems,$PA['fieldTSConfig']['itemsProcFunc.'],$config,$table,$row,$field);
 
                        // Possibly remove some items:
-               $removeItems=t3lib_div::trimExplode(',',$PA['fieldTSConfig']['removeItems'],1);
+               $removeItems = t3lib_div::trimExplode(',',$PA['fieldTSConfig']['removeItems'],1);
                foreach($selItems as $tk => $p) {
                        if (in_array($p[1],$removeItems))       {
                                unset($selItems[$tk]);
                        } else if (isset($PA['fieldTSConfig']['altLabels.'][$p[1]])) {
                                $selItems[$tk][0]=$this->sL($PA['fieldTSConfig']['altLabels.'][$p[1]]);
                        }
+
+                               // Removing doktypes with no access:
+                       if ($table.'.'.$field == 'pages.doktype')       {
+                               if (!($GLOBALS['BE_USER']->isAdmin() || t3lib_div::inList($GLOBALS['BE_USER']->groupData['pagetypes_select'],$p[1])))   {
+                                       unset($selItems[$tk]);
+                               }
+                       }
                }
 
                        // Creating the label for the "No Matching Value" entry.