FIxed context menu in layers so they hide selector boxes when displayed by MSIE
authorKasper Skårhøj <kasper@typo3.org>
Sun, 21 Dec 2003 21:14:07 +0000 (21:14 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Sun, 21 Dec 2003 21:14:07 +0000 (21:14 +0000)
Redid Renes changes to tcemain/tceforms - he will have apply them to his branch or local version only
Fixed bug in EM

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@105 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_tceforms.php
t3lib/class.t3lib_tcemain.php
typo3/mod/tools/em/index.php
typo3/template.php

index f0db8c6..b154f93 100755 (executable)
@@ -1143,41 +1143,6 @@ class t3lib_TCEforms     {
                                // Register the required number of elements:
                        $this->requiredElements[$PA['itemFormElName']] = array($minitems,$maxitems,'imgName'=>$table.'_'.$row['uid'].'_'.$field);
 
-
-                       if($config['treeView'] AND $config['foreign_table']) {
-                               global $TCA, $LANG;
-
-                               require_once(PATH_t3lib.'class.t3lib_treeview.php');
-                               $treeViewObj = t3lib_div::makeInstance('t3lib_TCEforms_SelectTreeView');
-       
-                               $treeViewObj->table = $config['foreign_table'];
-                               $treeViewObj->init();
-                               $treeViewObj->backPath = $this->backPath;
-                               $treeViewObj->parentField = $TCA[$config['foreign_table']]['ctrl']['treeParentField'];
-                               $treeViewObj->expandAll=1;
-                               $treeViewObj->expandFirst=1;
-                               $treeViewObj->ext_IconMode = '1'; // no context menu on icons
-                               $treeViewObj->title = $LANG->sL($TCA[$config['foreign_table']]['ctrl']['title']);
-                               $treeViewObj->TCEforms_itemFormElName = $PA['itemFormElName'];
-                                                       
-                               $treeContent=$treeViewObj->getBrowsableTree();
-                               
-                               #if ($this->docLarge)   $cols = round($cols*$this->form_largeComp);
-                               #$width = ceil($cols*$this->form_rowsToStylewidth);
-                               $width=240;
-                               
-                               $config['autoSizeMax'] = t3lib_div::intInRange($config['autoSizeMax'],0);
-                               $height = $config['autoSizeMax'] ? t3lib_div::intInRange($itemArrayC+1,t3lib_div::intInRange($size,1),$config['autoSizeMax']) : $size;;
-                                       // hardcoded: 12 is the height of the font
-                               $height=$height*13;     
-                                               
-                               $divStyle = 'position:relative; left:0px; top:0px; height:'.$height.'px; width:'.$width.'px;border:solid 1px;overflow:auto;background:#fff;';                   
-                               $thumbnails='<div  name="'.$PA['itemFormElName'].'_selTree" style="'.htmlspecialchars($divStyle).'">';
-                               $thumbnails.=$treeContent;
-                               $thumbnails.='</div>';  
-                                                       
-                       } else {
-
                        $sOnChange = 'setFormValueFromBrowseWin(\''.$PA['itemFormElName'].'\',this.options[this.selectedIndex].value,this.options[this.selectedIndex].text); '.implode('',$PA['fieldChangeFunc']);
 
                                // Put together the select form with selected elements:
@@ -1186,15 +1151,6 @@ class t3lib_TCEforms     {
                                $thumbnails.= '<option value="'.htmlspecialchars($p[1]).'">'.htmlspecialchars($p[0]).'</option>';
                        }
                        $thumbnails.= '</select>';
-                               $sOnChange = 'setFormValueFromBrowseWin(\''.$PA['itemFormElName'].'\',this.options[this.selectedIndex].value,this.options[this.selectedIndex].text); '.implode('',$PA['fieldChangeFunc']);
-       
-                                       // Put together the select form with selected elements:
-                               $thumbnails='<select style="width:200 px;" name="'.$PA['itemFormElName'].'_sel"'.$this->insertDefStyle('select').($size?' size="'.$size.'"':'').' onchange="'.htmlspecialchars($sOnChange).'"'.$PA['onFocus'].'>';
-                               foreach($selItems as $p)        {
-                                       $thumbnails.= '<option value="'.htmlspecialchars($p[1]).'">'.htmlspecialchars($p[0]).'</option>';
-                               }
-                               $thumbnails.= '</select>';
-                       }
 
                                // Perform modification of the selected items array:
                        $itemArray = t3lib_div::trimExplode(',',$PA['itemFormElValue'],1);
index e4989ed..051e397 100755 (executable)
@@ -407,51 +407,12 @@ class t3lib_TCEmain       {
 
 
 
-       /**
-        * Init the userProcFuncs registered by $GLOBALS['TBE_MODULES_EXT']['TCEmain']['addProcFunc']
-        * 
-        * @return      void
-        */
-       function initUserProcFunc() {
-               if (is_array($this->userProcFunc) AND count($this->userProcFunc)) {
-                               // init already done
-                       return;
-               }
-               $this->userProcFunc=array();
-               if (is_array($GLOBALS['TBE_MODULES_EXT']['TCEmain']['addProcFuncClasses']))     {
-                       foreach($GLOBALS['TBE_MODULES_EXT']['TCEmain']['addProcFuncClasses'] as $className => $classFile)       {
 
-                               if (@is_file($classFile))       {
-                                       require_once($classFile);
 
-                                       $this->userProcFunc[$key]['obj'] = t3lib_div::makeInstance($className);
-                                       $this->userProcFunc[$key]['obj']->pObj = &$this;
-                               }
-                       }
-               }
-       }
 
-       /**
-        * 
-        * @param       string          name of the user function
-        * @param       mixed           first parameter for the user function (will be passed as reference)
-        * @return      void
-        * @see initUserProcFunc()
-        */
-       function callUserProcFunc($func, &$refArg) {
-               // func_get_args() does not support pass as reference so the first param is defined that way
-               foreach($this->userProcFunc as $key => $userProcFuncObj)        {
-                       if (@is_callable(array($this->userProcFunc[$key]['obj'],$func)))        {
-                               $arg_list = func_get_args();
-                               unset($arg_list[0]); //$func
-                               $arg_list[1]=&$refArg;
-                               call_user_func_array(array($this->userProcFunc[$key]['obj'], $func),$arg_list);
 
 
 
-                       }
-               }
-       }
 
        /*********************************************
         *
@@ -467,11 +428,6 @@ class t3lib_TCEmain        {
         */
        function process_datamap() {
                global $TCA;
-               
-                       // calling user functions before the datamap will be processed
-               $this->initUserProcFunc();      
-               $this->callUserProcFunc('processDatamap',$this->datamap);
-               
                reset ($this->datamap);
 
                        // Organize tables so that the pages-table are always processed first. This is required if you want to make sure that content pointing to a new page will be created.
@@ -512,12 +468,6 @@ class t3lib_TCEmain        {
                                                        debug("INCOMING RECORD: ".$table.":".$id);
                                                        debug($incomingFieldArray);
                                                }
-                                               
-                                               
-                                                               // call user functions before processing and check
-                                               $this->callUserProcFunc('processIncomingFieldArray',$incomingFieldArray,$table,$id);
-                                               
-                                               
                                                        // ******************************
                                                        // Checking access to the record
                                                        // ******************************
@@ -614,10 +564,6 @@ class t3lib_TCEmain        {
                                                                $fieldArray[$TCA[$table]["ctrl"]["tstamp"]]=time();
                                                        }
 
-
-                                                               // call user functions right before writing to DB
-                                                       $this->callUserProcFunc('processFieldArray',$fieldArray,$table,$id,$status);
-
                                                                // Performing insert/update
                                                        if ($status=="new")     {
 //                                                             if ($pid_value<0)       {$fieldArray = $this->fixCopyAfterDuplFields($table,$id,abs($pid_value),0,$fieldArray);}        // Out-commented 02-05-02: I couldn't understand WHY this is needed for NEW records. Obviously to proces records being copied? Problem is that the fields are not set anyways and the copying function should basically take care of this!
index 3f23bb2..6d079ec 100755 (executable)
@@ -858,9 +858,11 @@ EXTENSION KEYS:
                $eInfo["_TECH_INFO"]=unserialize($fetchData["techinfo"]);
                $tempFiles=unserialize($fetchData["files"]);
 
-               reset($tempFiles);
-               while(list($fk)=each($tempFiles))       {
-                       if (!strstr($fk,"/"))   $eInfo["files"][]=$fk;
+               if (is_array($tempFiles))       {
+                       reset($tempFiles);
+                       while(list($fk)=each($tempFiles))       {
+                               if (!strstr($fk,"/"))   $eInfo["files"][]=$fk;
+                       }
                }
                
                $content='<strong>'.$fetchData["_ICON"]." &nbsp;".$eInfo["EM_CONF"]["title"].'</strong><br /><br />';
@@ -1587,14 +1589,16 @@ EXTENSION KEYS:
                if (!$remote)   $lines[]='<tr class="bgColor4"><td>Download password:</td><td>'.$info["EM_CONF"]["download_password"].'</td>'.$this->helpCol("download_password").'</tr>';
 
                        // Installation status:
-               sort($info["files"]);
                $lines[]='<tr><td>&nbsp;</td><td></td>'.$this->helpCol("").'</tr>';
                $lines[]='<tr class="bgColor5"><td colspan=2><strong>Installation status:</strong></td>'.$this->helpCol("").'</tr>';
                if (!$remote)   {
                        $lines[]='<tr class="bgColor4"><td>Type of install:</td><td>'.$this->typeLabels[$info["type"]].' - <em>'.$this->typeDescr[$info["type"]].'</em></td>'.$this->helpCol("type").'</tr>';
                        $lines[]='<tr class="bgColor4"><td>Double installs?</td><td>'.$this->extInformationArray_dbInst($info["doubleInstall"],$info["type"]).'</td>'.$this->helpCol("doubleInstall").'</tr>';
                }
-               $lines[]='<tr class="bgColor4"><td>Root files:</td><td>'.implode("<br />",$info["files"]).'</td>'.$this->helpCol("rootfiles").'</tr>';
+               if (is_array($info["files"]))   {
+                       sort($info["files"]);
+                       $lines[]='<tr class="bgColor4"><td>Root files:</td><td>'.implode("<br />",$info["files"]).'</td>'.$this->helpCol("rootfiles").'</tr>';
+               }
 
                if (!$remote)   {
                        $techInfo = $this->makeDetailedExtensionAnalysis($eKey,$info,1);
index 8c4007a..4b95226 100755 (executable)
@@ -1300,6 +1300,7 @@ $str.=$this->docBodyTagBegin().
                                                tempLayerObjCss.left = GLV_x+"px";
                                                tempLayerObjCss.top = GLV_y+"px";
                                                tempLayerObjCss.visibility = "visible";
+                                               if (bw.ie5)     showHideSelectorBoxes("hidden");
 
                                                GLV_isVisible[level]=1;
                                                GLV_curLayerWidth[level] = tempLayerObj.width;
@@ -1317,6 +1318,8 @@ $str.=$this->docBodyTagBegin().
                                        GL_getObjCss("contentMenu"+level).visibility = "hidden";
                                        GL_getObj("contentMenu"+level).el.innerHTML = "";
                                        GLV_isVisible[level]=0;
+                                       
+                                       if (bw.ie5 && level==0) showHideSelectorBoxes("visible");
                                }
                                        // debugObj(obj,name)
                                function debugObj(obj,name)     {       //
@@ -1332,6 +1335,15 @@ $str.=$this->docBodyTagBegin().
                                        layerObj = GL_getObj("contentMenu1");
                                        layerObjCss = GL_getObjCss("contentMenu1");
                                }
+                               function showHideSelectorBoxes(action)  {       // This function by Michiel van Leening
+                                       for (i=0;i<document.forms.length;i++) {
+                                               for (j=0;j<document.forms[i].elements.length;j++) {
+                                                       if(document.forms[i].elements[j].type=="select-one") {
+                                                               document.forms[i].elements[j].style.visibility=action;
+                                                       }
+                                               }
+                                       }                                       
+                               }
                        /*]]>*/
                        </script>               
                        ';