Index: /Users/mficzel/Documents/workspace/typo3_core/t3lib/class.t3lib_tceforms.php =================================================================== --- /Users/mficzel/Documents/workspace/typo3_core/t3lib/class.t3lib_tceforms.php (revision 2450) +++ /Users/mficzel/Documents/workspace/typo3_core/t3lib/class.t3lib_tceforms.php (working copy) @@ -739,10 +739,6 @@ if (!in_array($theField,$this->excludeElements) && $TCA[$table]['columns'][$theField]) { $this->palFieldArr[$palette][] = $theField; - if ($this->isPalettesCollapsed($table,$palette)) { - $this->hiddenFieldListArr[] = $theField; - } - $part = $this->getSingleField($table,$theField,$row,$parts[1],1,'',$parts[2]); if (is_array($part)) { $palParts[] = $part; @@ -751,6 +747,7 @@ } } } + // Put palette together if there are fields in it: if (count($palParts)) { if ($header) { @@ -760,20 +757,12 @@ $this->palFieldTemplateHeader ); } + $collapsed = $this->isPalettesCollapsed($table,$palette); $out.= $this->intoTemplate(array( - 'PALETTE' => $this->printPalette($palParts) - ), - $this->palFieldTemplate - ); - } - // If a palette is collapsed (not shown in form, but in top frame instead) AND a collapse header string is given, then make that string a link to activate the palette. - if ($this->isPalettesCollapsed($table,$palette) && $collapsedHeader) { - $pC = $this->intoTemplate(array( - 'PALETTE' => $this->wrapOpenPalette('backPath,'gfx/options.gif','width="18" height="16"').' border="0" title="'.htmlspecialchars($this->getLL('l_moreOptions')).'" align="top" alt="" />'.$collapsedHeader.'',$table,$row,$palette), + 'PALETTE' => $this->wrapPaletteField($this->printPalette($palParts), $table, $row ,$palette, $collapsed) ), $this->palFieldTemplate ); - $out.= $pC; } return $out; @@ -3594,23 +3583,40 @@ * * @param string The string to wrap in an A-tag * @param string The table name for which to open the palette. - * @param array The record array - * @param integer The palette pointer. - * @param boolean Determines the output type of the function. - * @return mixed If $retFunc is set, then returns an array with icon code and palette JavaScript function. Otherwise just the icon code. + * @param array The palette pointer. + * @param integer The record array */ - function wrapOpenPalette($header,$table,$row,$palette,$retFunc=0) { - $fieldL=array(); - if (!is_array($this->palFieldArr[$palette])) {$this->palFieldArr[$palette]=array();} - $palFieldN = is_array($this->palFieldArr[$palette]) ? count($this->palFieldArr[$palette]) : 0; - $palJSFunc = 'TBE_EDITOR.palUrl(\''.($table.':'.$row['uid'].':'.$palette).'\',\''.implode(',',$this->palFieldArr[$palette]).'\','.$palFieldN.',\''.$table.'\',\''.$row['uid'].'\',1);'; + function wrapOpenPalette ( $header, $table,$row , $palette ,$retFunc){ + $id = 'TCEFORMS_'.$table.'_'.$palette.'_'.$row['uid']; + $res = ''.$header.''; + return array($res,''); + } - $aOnClick = $this->blur().substr($palJSFunc,0,-3).'0);return false;'; - - $iconCode = ''. - $header. - ''; - return $retFunc ? array($iconCode,$palJSFunc) : $iconCode; + /** + * add the id and the style property to the field palette + * @param string Palette Code + * @param string The table name for which to open the palette. + * @param string Palette ID + * @param string The record array + * @return boolean is collapsed + */ + function wrapPaletteField ( $code, $table, $row, $palette, $collapsed ){ + global $TCA; + // is palette visible + $display = $collapsed ? 'none' : 'block'; + // classnames only for palettes that can be collapsed + if ( !$TCA[$table]['ctrl']['canNotCollapse'] && + !$TCA[$table]['palettes'][$palette]['canNotCollapse'] && + !in_array($palette, explode(',',($TCA[$table]['ctrl']['mainpalette']) ) ) + ) { + $class = "typo3-TCEforms-toggable-paletteContainer"; + } else { + $class = ""; + } + // write + $id = 'TCEFORMS_'.$table.'_'.$palette.'_'.$row['uid']; + $code = '
+ | ###RECORD_ICON### ###TABLE_TITLE### ###ID_NEW_INDICATOR### - ###RECORD_LABEL### | |
+ |