tslib/class.tslib_content.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00212   // Includes this class since it is used for parsing HTML
00213 require_once(PATH_t3lib."class.t3lib_parsehtml.php");
00214 
00215         // Object TypoScript library included:
00216 if(t3lib_extMgm::isLoaded('obts')) {
00217         require_once(t3lib_extMgm::extPath('obts').'_tsobject/_tso.php');
00218 }
00219 
00220 
00221 
00222 
00223 
00224 
00225 
00226 
00227 
00228 
00229 
00230 
00231 
00232 
00233 
00234 
00235 
00250 class tslib_cObj {
00251         var $align = Array ('center', 'right', 'left');
00252 
00263         var $image_compression = Array(
00264                 10 => Array('params'=>'', 'ext'=>'gif'),
00265                 11 => Array('params'=>'-colors 128', 'ext'=>'gif'),
00266                 12 => Array('params'=>'-colors 64', 'ext'=>'gif'),
00267                 13 => Array('params'=>'-colors 32', 'ext'=>'gif'),
00268                 14 => Array('params'=>'-colors 16', 'ext'=>'gif'),
00269                 15 => Array('params'=>'-colors 8', 'ext'=>'gif'),
00270 
00271                 30 => Array('params'=>'-colors 256', 'ext'=>'png'),
00272                 31 => Array('params'=>'-colors 128', 'ext'=>'png'),
00273                 32 => Array('params'=>'-colors 64', 'ext'=>'png'),
00274                 33 => Array('params'=>'-colors 32', 'ext'=>'png'),
00275                 34 => Array('params'=>'-colors 16', 'ext'=>'png'),
00276                 35 => Array('params'=>'-colors 8', 'ext'=>'png'),
00277                 39 => Array('params'=>'', 'ext'=>'png'),
00278 
00279                 20 => Array('params'=>'-quality 100', 'ext'=>'jpg'),
00280                 21 => Array('params'=>'-quality 90', 'ext'=>'jpg'),
00281                 22 => Array('params'=>'-quality 80', 'ext'=>'jpg'),
00282                 23 => Array('params'=>'-quality 70', 'ext'=>'jpg'),
00283                 24 => Array('params'=>'-quality 60', 'ext'=>'jpg'),
00284                 25 => Array('params'=>'-quality 50', 'ext'=>'jpg'),
00285                 26 => Array('params'=>'-quality 40', 'ext'=>'jpg'),
00286                 27 => Array('params'=>'-quality 30', 'ext'=>'jpg'),
00287                 28 => Array('params'=>'-quality 20', 'ext'=>'jpg')
00288         );
00289 
00295         var $image_effects = Array(
00296                 1 => '-rotate 90',
00297                 2 => '-rotate 270',
00298                 3 => '-rotate 180',
00299                 10 => '-colorspace GRAY',
00300                 11 => '-sharpen 70',
00301                 20 => '-normalize',
00302                 23 => '-contrast',
00303                 25 => '-gamma 1.3',
00304                 26 => '-gamma 0.8'
00305         );
00306 
00314         var $data = Array();
00315         var $oldData = Array();                         // Used for backup...
00316         var $alternativeData ='';                       // If this is set with an array before stdWrap, it's used instead of $this->data in the data-property in stdWrap
00317         var $parameters = Array();                      // Used by the parseFunc function and is loaded with tag-parameters when parsing tags.
00318         var $currentValKey = 'currentValue_kidjls9dksoje';
00319         var $currentRecord = '';                        // This is set to the [table]:[uid] of the record delivered in the $data-array, if the cObjects CONTENT or RECORD is in operation. Note that $GLOBALS['TSFE']->currentRecord is set to an equal value but always indicating the latest record rendered.
00320         var $currentRecordTotal = 0;            // Set in cObj->RECORDS and cObj->CONTENT to the current number of records selected in a query.
00321         var $currentRecordNumber = 0;           // Incremented in cObj->RECORDS and cObj->CONTENT before each record rendering.
00322         var $parentRecordNumber = 0;            // Incremented in parent cObj->RECORDS and cObj->CONTENT before each record rendering.
00323         var $parentRecord = array();            // If the tslib_cObj was started from CONTENT, RECORD or SEARCHRESULT cObject's this array has two keys, 'data' and 'currentRecord' which indicates the record and data for the parent cObj.
00324         var $regObj;            // This may be set as a reference to the calling object of eg. cObjGetSingle. Anyway, just use it as you like. It's used in productsLib.inc for example.
00325 
00326         // internal
00327         var $INT_include=0;             // Is set to 1 if the instance of this cObj is executed from a PHP_SCRIPT_INT -include script (see pagegen, bottom of document)
00328         var $checkPid_cache = Array();          // This is used by checkPid, that checks if pages are accessible. The $checkPid_cache['page_uid'] is set true or false upon this check featuring a caching function for the next request.
00329         var $checkPid_badDoktypeList = '255';
00330         var $lastTypoLinkUrl='';        // This will be set by typoLink() to the url of the most recent link created.
00331         var $lastTypoLinkTarget='';     // DO. link target.
00332         var $substMarkerCache=array();  // Caching substituteMarkerArrayCached function
00333         var $recordRegister=array();    // Array that registers rendered content elements (or any table) to make sure they are not rendered recursively!
00334 
00344         function start($data,$table='') {
00345                 $this->data = $data;
00346                 $this->currentRecord = $table ? $table.':'.$this->data['uid'] : '';
00347                 $this->parameters = Array();
00348         }
00349 
00359         function setParent($data,$currentRecord)        {
00360                 $this->parentRecord=array('data'=>$data, 'currentRecord'=>$currentRecord);
00361         }
00362 
00363 
00364 
00365 
00366 
00367 
00368 
00369 
00370         /***********************************************
00371          *
00372          * CONTENT_OBJ:
00373          *
00374          ***********************************************/
00375 
00384         function getCurrentVal()        {
00385                 return $this->data[$this->currentValKey];
00386         }
00387 
00395         function setCurrentVal($value)  {
00396                 $this->data[$this->currentValKey] = $value;
00397         }
00398 
00408         function cObjGet($setup,$addKey='')     {
00409                 if (is_array($setup))   {
00410                         $sKeyArray=t3lib_TStemplate::sortedKeyList($setup);
00411                         $content ='';
00412                         foreach($sKeyArray as $theKey)  {
00413                                 $theValue=$setup[$theKey];
00414                                 if (intval($theKey) && !strstr($theKey,'.'))    {
00415                                         $conf=$setup[$theKey.'.'];
00416                                         $content.=$this->cObjGetSingle($theValue,$conf,$addKey.$theKey);        // Get the contentObject
00417                                 }
00418                         }
00419                         return $content;
00420                 }
00421         }
00422 
00432         function cObjGetSingle($name,$conf,$TSkey='__') {
00433                 $content='';
00434                         // Checking that the function is not called eternally. This is done by interrupting at a depth of 100
00435                 $GLOBALS['TSFE']->cObjectDepthCounter--;
00436                 if ($GLOBALS['TSFE']->cObjectDepthCounter>0)    {
00437                         $name = trim($name);
00438                         if ($GLOBALS['TT']->LR) $GLOBALS['TT']->push($TSkey, $name);
00439 
00440                                 // Checking if the COBJ is a reference to another object. (eg. name of 'blabla.blabla = < styles.something')
00441                         if (substr($name,0,1)=='<')     {
00442                                 $key = trim(substr($name,1));
00443                                 $cF = t3lib_div::makeInstance('t3lib_TSparser');
00444                                         // $name and $conf is loaded with the referenced values.
00445                                 $old_conf=$conf;
00446                                 list($name, $conf) = $cF->getVal($key,$GLOBALS['TSFE']->tmpl->setup);
00447                                 if (is_array($old_conf) && count($old_conf))    {
00448                                         $conf = $this->joinTSarrays($conf,$old_conf);
00449 //                                      debug($conf);
00450                                 }
00451                                         // Getting the cObject
00452                                 $GLOBALS['TT']->incStackPointer();
00453                                         $content.=$this->cObjGetSingle($name,$conf,$key);
00454                                 $GLOBALS['TT']->decStackPointer();
00455                         } else {
00456 
00457                                         // Object TypoScript hook:
00458                                 if(t3lib_extMgm::isLoaded('obts') && isset($GLOBALS['OBTS']['tso_list'][$name])) {
00459                                         $content.= obts_dtutil::renderDatatypeContent($name, $GLOBALS['OBTS']['tso_list'][$name], $conf, $this);
00460                                 } else {
00461                                                 // Traditional Content Object branching:
00462                                         switch($name)   {
00463                                                 case 'COBJ_ARRAY':
00464                                                 case 'COA':
00465                                                         $content.=$this->COBJ_ARRAY($conf);
00466                                                 break;
00467                                                 case 'COA_INT':
00468                                                         $content.=$this->COBJ_ARRAY($conf,'INT');
00469                                                 break;
00470                                                 case 'HTML':
00471                                                         $content.=$this->HTML($conf);
00472                                                 break;
00473                                                 case 'TEXT':
00474                                                         $content.=$this->TEXT($conf);
00475                                                 break;
00476                                                 case 'CLEARGIF':
00477                                                         $content.=$this->CLEARGIF($conf);
00478                                                 break;
00479                                                 case 'FILE':
00480                                                         $content.=$this->FILE($conf);
00481                                                 break;
00482                                                 case 'IMAGE':
00483                                                         $content.=$this->IMAGE($conf);
00484                                                 break;
00485                                                 case 'IMG_RESOURCE':
00486                                                         $content.=$this->IMG_RESOURCE($conf);
00487                                                 break;
00488                                                 case 'IMGTEXT':
00489                                                         $content.=$this->IMGTEXT($conf);
00490                                                 break;
00491                                                 case 'CONTENT':
00492                                                         $content.=$this->CONTENT($conf);
00493                                                 break;
00494                                                 case 'RECORDS':
00495                                                         $content.=$this->RECORDS($conf);
00496                                                 break;
00497                                                 case 'HMENU':
00498                                                         $content.=$this->HMENU($conf);
00499                                                 break;
00500                                                 case 'CTABLE':
00501                                                         $content.=$this->CTABLE($conf);
00502                                                 break;
00503                                                 case 'OTABLE':
00504                                                         $content.=$this->OTABLE($conf);
00505                                                 break;
00506                                                 case 'COLUMNS':
00507                                                         $content.=$this->COLUMNS($conf);
00508                                                 break;
00509                                                 case 'HRULER':
00510                                                         $content.=$this->HRULER($conf);
00511                                                 break;
00512                                                 case 'CASE':
00513                                                         $content.=$this->CASEFUNC($conf);
00514                                                 break;
00515                                                 case 'LOAD_REGISTER':
00516                                                 case 'RESTORE_REGISTER':
00517                                                         $this->LOAD_REGISTER($conf,$name);
00518                                                 break;
00519                                                 case 'FORM':
00520                                                         $content.=$this->FORM($conf);
00521                                                 break;
00522                                                 case 'SEARCHRESULT':
00523                                                         $content.=$this->SEARCHRESULT($conf);
00524                                                 break;
00525                                                 case 'PHP_SCRIPT':
00526                                                         $content.=$this->PHP_SCRIPT($conf);
00527                                                 break;
00528                                                 case 'PHP_SCRIPT_EXT':
00529                                                         $content.=$this->PHP_SCRIPT($conf,'EXT');
00530                                                 break;
00531                                                 case 'PHP_SCRIPT_INT':
00532                                                         $content.=$this->PHP_SCRIPT($conf,'INT');
00533                                                 break;
00534                                                 case 'USER':
00535                                                         $content.=$this->USER($conf);
00536                                                 break;
00537                                                 case 'USER_INT':
00538                                                         $content.=$this->USER($conf,'INT');
00539                                                 break;
00540                                                 case 'TEMPLATE':
00541                                                         $content.=$this->TEMPLATE($conf);
00542                                                 break;
00543                                                 case 'EDITPANEL':
00544                                                         if ($GLOBALS['TSFE']->beUserLogin)      {$content.=$this->editPanel($content, $conf);}
00545                                                 break;
00546                                                 case 'MULTIMEDIA':
00547                                                         $content.=$this->MULTIMEDIA($conf);
00548                                                 break;
00549                                         }
00550                                 }
00551                         }
00552                         if ($GLOBALS['TT']->LR) $GLOBALS['TT']->pull($content);
00553                 }
00554                         // Increasing on exit...
00555                 $GLOBALS['TSFE']->cObjectDepthCounter++;
00556                 return $content;
00557         }
00558 
00559 
00560 
00561 
00562 
00563 
00564 
00565         /********************************************
00566          *
00567          * Functions rendering content objects (cObjects)
00568          *
00569          ********************************************/
00570 
00578         function HTML($conf)    {
00579                 return $this->stdWrap($conf['value'],$conf['value.']);
00580         }
00581 
00589         function TEXT($conf)    {
00590                 return $this->stdWrap($conf['value'],$conf);
00591         }
00592 
00600         function CLEARGIF($conf)        {
00601                 $w = $this->stdWrap($conf['width'],$conf['width.']);
00602                 $h = $this->stdWrap($conf['height'],$conf['height.']);
00603                 $w = $w ? $w : 1;
00604                 $h = $h ? $h : 1;
00605                 $wrap = $conf['wrap'] ? $conf['wrap'] : '|<br />';
00606                 $theValue = $this->wrap('<img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$w.'" height="'.$h.'"'.$this->getBorderAttr(' border="0"').' alt="" title="" />', $wrap);
00607 
00608                 return $this->stdWrap($theValue,$conf['stdWrap.']);
00609         }
00610 
00619         function COBJ_ARRAY($conf,$ext='')      {
00620                 $content='';
00621                 switch($ext)    {
00622                         case 'INT':
00623                                 $substKey = $ext.'_SCRIPT.'.$GLOBALS['TSFE']->uniqueHash();
00624                                 $content.='<!--'.$substKey.'-->';
00625                                 $GLOBALS['TSFE']->config[$ext.'incScript'][$substKey] = array(
00626                                         'file'=>$incFile,
00627                                         'conf'=>$conf,
00628                                         'cObj'=>serialize($this),
00629                                         'type'=>'COA'
00630                                 );
00631                         break;
00632                         default:
00633                                 if ($this->checkIf($conf['if.']))       {
00634                                         $content=$this->cObjGet($conf);
00635                                         if ($conf['wrap']) {
00636                                                 $content=$this->wrap($content, $conf['wrap']);
00637                                         }
00638                                         if ($conf['stdWrap.']) {
00639                                                 $content=$this->stdWrap($content, $conf['stdWrap.']);
00640                                         }
00641                                 }
00642                         break;
00643                 }
00644                 return $content;
00645         }
00646 
00655         function USER($conf,$ext='')    {
00656                 $content='';
00657                 switch($ext)    {
00658                         case 'INT':
00659                                 $substKey = $ext.'_SCRIPT.'.$GLOBALS['TSFE']->uniqueHash();
00660                                 $content.='<!--'.$substKey.'-->';
00661                                 $GLOBALS['TSFE']->config[$ext.'incScript'][$substKey] = array(
00662                                         'file' => $incFile,
00663                                         'conf' => $conf,
00664                                         'cObj' => serialize($this),
00665                                         'type' => 'FUNC'
00666                                 );
00667                         break;
00668                         default:
00669                                 $content.=$this->callUserFunction($conf['userFunc'],$conf,'');
00670                         break;
00671                 }
00672                 return $content;
00673         }
00674 
00682         function FILE($conf)    {
00683                 $theValue = $this->fileResource($this->stdWrap($conf['file'],$conf['file.']), trim($this->getAltParam($conf)));
00684                 if ($conf['linkWrap'])  {
00685                         $theValue = $this->linkWrap($theValue,$conf['linkWrap']);
00686                 }
00687                 return $this->wrap($theValue,$conf['wrap']);
00688         }
00689 
00698         function IMAGE($conf)   {
00699                 $content='';
00700                 if ($this->checkIf($conf['if.']))       {
00701                         $theValue = $this->cImage($conf['file'],$conf);
00702                         if ($conf['stdWrap.'])  {
00703                                 $theValue = $this->stdWrap($theValue,$conf['stdWrap.']);
00704                         }
00705                         return $theValue;
00706                 }
00707         }
00708 
00717         function IMG_RESOURCE($conf)    {
00718                 $imgArray = $this->getImgResource($conf['file'],$conf['file.']);
00719                 return $this->stdWrap($imgArray[3],$conf['stdWrap.']);
00720         }
00721 
00729         function IMGTEXT($conf) {
00730                 $content='';
00731                 if (is_array($conf['text.']))   {
00732                         $content.= $this->stdWrap($this->cObjGet($conf['text.'],'text.'),$conf['text.']);       // this gets the surrounding content
00733                 }
00734                 $imgList=trim($this->stdWrap($conf['imgList'],$conf['imgList.']));      // gets images
00735                 if ($imgList)   {
00736                         $imgs = t3lib_div::trimExplode(',',$imgList);
00737                         $imgStart = intval($this->stdWrap($conf['imgStart'],$conf['imgStart.']));
00738 
00739                         $imgCount= count($imgs)-$imgStart;
00740 
00741                         $imgMax = intval($this->stdWrap($conf['imgMax'],$conf['imgMax.']));
00742                         if ($imgMax)    {
00743                                 $imgCount = t3lib_div::intInRange($imgCount,0,$conf['imgMax']); // reduces the number of images.
00744                         }
00745 
00746                         $imgPath = $this->stdWrap($conf['imgPath'],$conf['imgPath.']);
00747 
00748                                 // initialisation
00749                         $caption='';
00750                         if (is_array($conf['caption.']))        {
00751                                 $caption= $this->stdWrap($this->cObjGet($conf['caption.'], 'caption.'),$conf['caption.']);
00752                         }
00753                         $captionArray=array();
00754                         if ($conf['captionSplit'])      {
00755                                 $capSplit = $this->stdWrap($conf['captionSplit.']['token'],$conf['captionSplit.']['token.']);
00756                                 if (!$capSplit) {$capSplit=chr(10);}
00757                                 $caption2= $this->cObjGetSingle($conf['captionSplit.']['cObject'],$conf['captionSplit.']['cObject.'],'captionSplit.cObject');
00758                                 $captionArray=explode($capSplit,$caption2);
00759                                 while(list($ca_key,$ca_val)=each($captionArray))        {
00760                                         $captionArray[$ca_key] = $this->stdWrap(trim($captionArray[$ca_key]), $conf['captionSplit.']['stdWrap.']);
00761                                 }
00762                         }
00763 
00764                         $tablecode='';
00765                         $position=$this->stdWrap($conf['textPos'],$conf['textPos.']);
00766 
00767                         $tmppos = $position&7;
00768                         $contentPosition = $position&24;
00769                         $align = $this->align[$tmppos];
00770                         $cap = ($caption)?1:0;
00771                         $txtMarg = intval($this->stdWrap($conf['textMargin'],$conf['textMargin.']));
00772                         if (!$conf['textMargin_outOfText'] && $contentPosition<16)      {
00773                                 $txtMarg=0;
00774                         }
00775 
00776                         $cols = intval($this->stdWrap($conf['cols'],$conf['cols.']));
00777                         $rows = intval($this->stdWrap($conf['rows'],$conf['rows.']));
00778                         $colspacing = intval($this->stdWrap($conf['colSpace'],$conf['colSpace.']));
00779                         $rowspacing = intval($this->stdWrap($conf['rowSpace'],$conf['rowSpace.']));
00780 
00781                         $border = intval($this->stdWrap($conf['border'],$conf['border.'])) ? 1:0;
00782                         $borderColor = $this->stdWrap($conf['borderCol'],$conf['borderCol.']);
00783                         $borderThickness = intval($this->stdWrap($conf['borderThick'],$conf['borderThick.']));
00784 
00785                         $borderColor=$borderColor?$borderColor:'black';
00786                         $borderThickness=$borderThickness?$borderThickness:1;
00787 
00788                         $caption_align = $this->stdWrap($conf['captionAlign'],$conf['captionAlign.']);
00789                         if (!$caption_align) {
00790                                 $caption_align = $align;
00791                         }
00792                                 // generate cols
00793                         $colCount = ($cols > 1) ? $cols : 1;
00794                         if ($colCount > $imgCount)      {$colCount = $imgCount;}
00795                         $rowCount = ($colCount > 1) ? ceil($imgCount / $colCount) : $imgCount;
00796                                 // generate rows
00797                         if ($rows>1)  {
00798                                 $rowCount = $rows;
00799                                 if ($rowCount > $imgCount)      {$rowCount = $imgCount;}
00800                                 $colCount = ($rowCount>1) ? ceil($imgCount / $rowCount) : $imgCount;
00801                         }
00802 
00803                                 // max Width
00804                         $colRelations = trim($this->stdWrap($conf['colRelations'],$conf['colRelations.']));
00805                         $maxW = intval($this->stdWrap($conf['maxW'],$conf['maxW.']));
00806 
00807                         $maxWInText = intval($this->stdWrap($conf['maxWInText'],$conf['maxWInText.']));
00808                         if (!$maxWInText)       {       // If maxWInText is not set, it's calculated to the 70 % of the max...
00809                                 $maxWInText = round($maxW/100*50);
00810                         }
00811 
00812                         if ($maxWInText && $contentPosition>=16)        {       // inText
00813                                 $maxW = $maxWInText;
00814                         }
00815 
00816                         if ($maxW && $colCount > 0) {   // If there is a max width and if colCount is greater than  column
00817 /*                              debug($border*$borderThickness*2);
00818                                 debug($maxW);
00819                                 debug($colspacing);
00820                                 debug(($maxW-$colspacing*($colCount-1)-$colCount*$border*$borderThickness*2));
00821                                 */
00822                                 $maxW = ceil(($maxW-$colspacing*($colCount-1)-$colCount*$border*$borderThickness*2)/$colCount);
00823                         }
00824                                 // create the relation between rows
00825                         $colMaxW = Array();
00826                         if ($colRelations)      {
00827                                 $rel_parts = explode(':',$colRelations);
00828                                 $rel_total = 0;
00829                                 for ($a=0;$a<$colCount;$a++)    {
00830                                         $rel_parts[$a] = intval($rel_parts[$a]);
00831                                         $rel_total+= $rel_parts[$a];
00832                                 }
00833                                 if ($rel_total) {
00834                                         for ($a=0;$a<$colCount;$a++)    {
00835                                                 $colMaxW[$a] = round(($maxW*$colCount)/$rel_total*$rel_parts[$a]);
00836                                         }
00837                                         if (min($colMaxW)<=0 || max($rel_parts)/min($rel_parts)>10)     {               // The difference in size between the largest and smalles must be within a factor of ten.
00838                                                 $colMaxW = Array();
00839                                         }
00840                                 }
00841                         }
00842                         $image_compression = intval($this->stdWrap($conf['image_compression'],$conf['image_compression.']));
00843                         $image_effects = intval($this->stdWrap($conf['image_effects'],$conf['image_effects.']));
00844                         $image_frames = intval($this->stdWrap($conf['image_frames.']['key'],$conf['image_frames.']['key.']));
00845 
00846                                 // fetches pictures
00847                         $splitArr=array();
00848                         $splitArr['imgObjNum']=$conf['imgObjNum'];
00849                         $splitArr = $GLOBALS['TSFE']->tmpl->splitConfArray($splitArr,$imgCount);
00850 
00851                                 // EqualHeight
00852                         $equalHeight = intval($this->stdWrap($conf['equalH'],$conf['equalH.']));
00853                         if ($equalHeight)       {       // Initiate gifbuilder object in order to get dimensions AND calculate the imageWidth's
00854                                 $gifCreator = t3lib_div::makeInstance('tslib_gifbuilder');
00855                                 $gifCreator->init();
00856                                 $relations = Array();
00857                                 $relations_cols = Array();
00858                                 $totalMaxW = $maxW*$colCount;
00859                                 for($a=0;$a<$imgCount;$a++)     {
00860                                         $imgKey = $a+$imgStart;
00861                                         $imgInfo = $gifCreator->getImageDimensions($imgPath.$imgs[$imgKey]);
00862                                         $relations[$a] = $imgInfo[1] / $equalHeight;    // relationship between the original height and the wished height
00863                                         if ($relations[$a])     {       // if relations is zero, then the addition of this value is omitted as the image is not expected to display because of some error.
00864                                                 $relations_cols[floor($a/$colCount)] += $imgInfo[0]/$relations[$a];     // counts the total width of the row with the new height taken into consideration.
00865                                         }
00866                                 }
00867                         }
00868 
00869                         $imageRowsFinalWidths = Array();        // contains the width of every image row
00870                         $imageRowsMaxHeights = Array();
00871                         $imgsTag=array();
00872                         $origImages=array();
00873                         for($a=0;$a<$imgCount;$a++)     {
00874                                 $GLOBALS['TSFE']->register['IMAGE_NUM'] = $a;
00875 
00876                                 $imgKey = $a+$imgStart;
00877                                 $totalImagePath = $imgPath.$imgs[$imgKey];
00878                                 $this->data[$this->currentValKey] = $totalImagePath;
00879                                 $imgObjNum = intval($splitArr[$a]['imgObjNum']);
00880                                 $imgConf = $conf[$imgObjNum.'.'];
00881 
00882                                 if ($equalHeight)       {
00883                                         $scale = 1;
00884                                         if ($totalMaxW) {
00885                                                 $rowTotalMaxW = $relations_cols[floor($a/$colCount)];
00886                                                 if ($rowTotalMaxW > $totalMaxW) {
00887                                                         $scale = $rowTotalMaxW / $totalMaxW;
00888                                                 }
00889                                         }
00890                                                 // transfer info to the imageObject. Please note, that
00891                                         $imgConf['file.']['height'] = round($equalHeight/$scale);
00892 
00893                                         unset($imgConf['file.']['width']);
00894                                         unset($imgConf['file.']['maxW']);
00895                                         unset($imgConf['file.']['maxH']);
00896                                         unset($imgConf['file.']['minW']);
00897                                         unset($imgConf['file.']['minH']);
00898                                         unset($imgConf['file.']['width.']);
00899                                         unset($imgConf['file.']['maxW.']);
00900                                         unset($imgConf['file.']['maxH.']);
00901                                         unset($imgConf['file.']['minW.']);
00902                                         unset($imgConf['file.']['minH.']);
00903                                         $maxW = 0;      // setting this to zero, so that it doesn't disturb
00904                                 }
00905 
00906                                 if ($maxW) {
00907                                         if (count($colMaxW))    {
00908                                                 $imgConf['file.']['maxW'] = $colMaxW[($a%$colCount)];
00909                                         } else {
00910                                                 $imgConf['file.']['maxW'] = $maxW;
00911                                         }
00912                                 }
00913 
00914                                         // Image Object supplied:
00915                                 if (is_array($imgConf)) {
00916                                         if ($this->image_effects[$image_effects])       {
00917                                                 $imgConf['file.']['params'].= ' '.$this->image_effects[$image_effects];
00918                                         }
00919                                         if ($image_frames)      {
00920                                                 if (is_array($conf['image_frames.'][$image_frames.'.']))        {
00921                                                         $imgConf['file.']['m.'] = $conf['image_frames.'][$image_frames.'.'];
00922                                                 }
00923                                         }
00924                                         if ($image_compression && $imgConf['file']!='GIFBUILDER')       {
00925                                                 if ($image_compression==1)      {
00926                                                         $tempImport = $imgConf['file.']['import'];
00927                                                         $tempImport_dot = $imgConf['file.']['import.'];
00928                                                         unset($imgConf['file.']);
00929                                                         $imgConf['file.']['import'] = $tempImport;
00930                                                         $imgConf['file.']['import.'] = $tempImport_dot;
00931                                                 } elseif (isset($this->image_compression[$image_compression])) {
00932                                                         $imgConf['file.']['params'].= ' '.$this->image_compression[$image_compression]['params'];
00933                                                         $imgConf['file.']['ext'] = $this->image_compression[$image_compression]['ext'];
00934                                                         unset($imgConf['file.']['ext.']);
00935                                                 }
00936                                         }
00937 
00938                                                 // "alt", "title" and "longdesc" attributes:
00939                                         if (!strlen($imgConf['altText']) && !is_array($imgConf['altText.'])) {
00940                                                 $imgConf['altText'] = $conf['altText'];
00941                                                 $imgConf['altText.'] = $conf['altText.'];
00942                                         }
00943                                         if (!strlen($imgConf['titleText']) && !is_array($imgConf['titleText.'])) {
00944                                                 $imgConf['titleText'] = $conf['titleText'];
00945                                                 $imgConf['titleText.'] = $conf['titleText.'];
00946                                         }
00947                                         if (!strlen($imgConf['longdescURL']) && !is_array($imgConf['longdescURL.'])) {
00948                                                 $imgConf['longdescURL'] = $conf['longdescURL'];
00949                                                 $imgConf['longdescURL.'] = $conf['longdescURL.'];
00950                                         }
00951                                 } else {
00952                                         $imgConf = array(
00953                                                 'altText' => $conf['altText'],
00954                                                 'titleText' => $conf['titleText'],
00955                                                 'longdescURL' => $conf['longdescURL'],
00956                                                 'file' => $totalImagePath
00957                                         );
00958                                 }
00959 
00960                                 $imgsTag[$imgKey] = $this->IMAGE($imgConf);
00961 
00962                                         // Store the original filepath
00963                                 $origImages[$imgKey]=$GLOBALS['TSFE']->lastImageInfo;
00964 
00965                                 $imageRowsFinalWidths[floor($a/$colCount)] += $GLOBALS['TSFE']->lastImageInfo[0];
00966                                 if ($GLOBALS['TSFE']->lastImageInfo[1]>$imageRowsMaxHeights[floor($a/$colCount)])       {
00967                                         $imageRowsMaxHeights[floor($a/$colCount)] = $GLOBALS['TSFE']->lastImageInfo[1];
00968                                 }
00969                         }
00970                                 // calculating the tableWidth:
00971                                 // TableWidth problems: It creates problems if the pictures are NOT as wide as the tableWidth.
00972                         $tableWidth = max($imageRowsFinalWidths)+ $colspacing*($colCount-1) + $colCount*$border*$borderThickness*2;
00973 
00974                                 // make table for pictures
00975                         $index=$imgStart;
00976 
00977                         $noRows = $this->stdWrap($conf['noRows'],$conf['noRows.']);
00978                         $noCols = $this->stdWrap($conf['noCols'],$conf['noCols.']);
00979                         if ($noRows) {$noCols=0;}       // noRows overrides noCols. They cannot exist at the same time.
00980                         if ($equalHeight) {
00981                                 $noCols=1;
00982                                 $noRows=0;
00983                         }
00984 
00985                         $rowCount_temp=1;
00986                         $colCount_temp=$colCount;
00987                         if ($noRows)    {
00988                                 $rowCount_temp = $rowCount;
00989                                 $rowCount=1;
00990                         }
00991                         if ($noCols)    {
00992                                 $colCount=1;
00993                         }
00994                                 // col- and rowspans calculated
00995                         $colspan = (($colspacing) ? $colCount*2-1 : $colCount);
00996                         $rowspan = (($rowspacing) ? $rowCount*2-1 : $rowCount) + $cap;
00997 
00998 
00999                                 // Edit icons:
01000                         $editIconsHTML = $conf['editIcons']&&$GLOBALS['TSFE']->beUserLogin ? $this->editIcons('',$conf['editIcons'],$conf['editIcons.']) : '';
01001 
01002                                 // strech out table:
01003                         $tablecode='';
01004                         $flag=0;
01005                         if ($conf['noStretchAndMarginCells']!=1)        {
01006                                 $tablecode.='<tr>';
01007                                 if ($txtMarg && $align=='right')        {       // If right aligned, the textborder is added on the right side
01008                                         $tablecode.='<td rowspan="'.($rowspan+1).'" valign="top"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$txtMarg.'" height="1" alt="" title="" />'.($editIconsHTML?'<br />'.$editIconsHTML:'').'</td>';
01009                                         $editIconsHTML='';
01010                                         $flag=1;
01011                                 }
01012                                 $tablecode.='<td colspan="'.$colspan.'"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$tableWidth.'" height="1" alt="" /></td>';
01013                                 if ($txtMarg && $align=='left') {       // If left aligned, the textborder is added on the left side
01014                                         $tablecode.='<td rowspan="'.($rowspan+1).'" valign="top"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$txtMarg.'" height="1" alt="" title="" />'.($editIconsHTML?'<br />'.$editIconsHTML:'').'</td>';
01015                                         $editIconsHTML='';
01016                                         $flag=1;
01017                                 }
01018                                 if ($flag) $tableWidth+=$txtMarg+1;
01019         //                      $tableWidth=0;
01020                                 $tablecode.='</tr>';
01021                         }
01022 
01023                                 // draw table
01024                         for ($c=0;$c<$rowCount;$c++) {  // Looping through rows. If 'noRows' is set, this is '1 time', but $rowCount_temp will hold the actual number of rows!
01025                                 if ($c && $rowspacing)  {               // If this is NOT the first time in the loop AND if space is required, a row-spacer is added. In case of "noRows" rowspacing is done further down.
01026                                         $tablecode.='<tr><td colspan="'.$colspan.'"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="1" height="'.$rowspacing.'"'.$this->getBorderAttr(' border="0"').' alt="" title="" /></td></tr>';
01027                                 }
01028                                 $tablecode.='<tr>';     // starting row
01029                                 for ($b=0; $b<$colCount_temp; $b++)     {       // Looping through the columns
01030                                         if ($b && $colspacing)  {               // If this is NOT the first iteration AND if column space is required. In case of "noCols", the space is done without a separate cell.
01031                                                 if (!$noCols)   {
01032                                                         $tablecode.='<td><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$colspacing.'" height="1"'.$this->getBorderAttr(' border="0"').' alt="" title="" /></td>';
01033                                                 } else {
01034                                                         $colSpacer='<img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.($border?$colspacing-6:$colspacing).'" height="'.($imageRowsMaxHeights[$c]+($border?$borderThickness*2:0)).'"'.$this->getBorderAttr(' border="0"').' align="'.($border?'left':'top').'" alt="" title="" />';
01035                                                         $colSpacer='<td valign="top">'.$colSpacer.'</td>';      // added 160301, needed for the new "noCols"-table...
01036                                                         $tablecode.=$colSpacer;
01037                                                 }
01038                                         }
01039                                         if (!$noCols || ($noCols && !$b))       {
01040                                                 $tablecode.='<td valign="top">';        // starting the cell. If "noCols" this cell will hold all images in the row, otherwise only a single image.
01041                                                 if ($noCols)    {$tablecode.='<table width="'.$imageRowsFinalWidths[$c].'" border="0" cellpadding="0" cellspacing="0"><tr>';}           // In case of "noCols" we must set the table-tag that surrounds the images in the row.
01042                                         }
01043                                         for ($a=0;$a<$rowCount_temp;$a++)       {       // Looping through the rows IF "noRows" is set. "noRows"  means that the rows of images is not rendered by physical table rows but images are all in one column and spaced apart with clear-gifs. This loop is only one time if "noRows" is not set.
01044                                                 $imgIndex = $index+$a*$colCount_temp;
01045                                                 if ($imgsTag[$imgIndex])        {
01046                                                         if ($rowspacing && $noRows && $a) {             // Puts distance between the images IF "noRows" is set and this is the first iteration of the loop
01047                                                                 $tablecode.= '<img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="1" height="'.$rowspacing.'" alt="" title="" /><br />';
01048                                                         }
01049 
01050                                                         $imageHTML = $imgsTag[$imgIndex].'<br />';
01051                                                         $Talign = (!trim($captionArray[$imgIndex]) && !$noRows && !$conf['netprintApplicationLink']) ? ' align="left"' : '';  // this is necessary if the tablerows are supposed to space properly together! "noRows" is excluded because else the images "layer" together.
01052                                                         if ($border)    {$imageHTML='<table border="0" cellpadding="'.$borderThickness.'" cellspacing="0" bgcolor="'.$borderColor.'"'.$Talign.'><tr><td>'.$imageHTML.'</td></tr></table>';}             // break-tag added 160301  , ($noRows?'':' align="left"')  removed 160301, break tag removed 160301 (later...)
01053                                                         $imageHTML.=$editIconsHTML;             $editIconsHTML='';
01054                                                         if ($conf['netprintApplicationLink'])   {$imageHTML = $this->netprintApplication_offsiteLinkWrap($imageHTML,$origImages[$imgIndex],$conf['netprintApplicationLink.']);}
01055                                                         $imageHTML.=$captionArray[$imgIndex];   // Adds caption.
01056                                                         if ($noCols)    {$imageHTML='<td valign="top">'.$imageHTML.'</td>';}            // If noCols, put in table cell.
01057                                                         $tablecode.=$imageHTML;
01058                                                 }
01059                                         }
01060                                         $index++;
01061                                         if (!$noCols || ($noCols && $b+1==$colCount_temp))      {
01062                                                 if ($noCols)    {$tablecode.='</tr></table>';}  // In case of "noCols" we must finish the table that surrounds the images in the row.
01063                                                 $tablecode.='</td>';    // Ending the cell. In case of "noCols" the cell holds all pictures!
01064                                         }
01065                                 }
01066                                 $tablecode.='</tr>';    // ending row
01067                         }
01068                         if ($c) {
01069                                 // Table-tag is inserted
01070                                 $i=$contentPosition;
01071                                 $table_align = (($i==16) ? 'align="'.$align.'"' : '');
01072                                 $tablecode = '<table'.($tableWidth?' width="'.$tableWidth.'"':'').' border="0" cellspacing="0" cellpadding="0" '.$table_align.' class="imgtext-table">'.$tablecode;
01073                                 if ($editIconsHTML)     {       // IF this value is not long since reset.
01074                                         $tablecode.='<tr><td colspan="'.$colspan.'">'.$editIconsHTML.'</td></tr>';
01075                                         $editIconsHTML='';
01076                                 }
01077                                 if ($cap)       {
01078                                         $tablecode.='<tr><td colspan="'.$colspan.'" align="'.$caption_align.'">'.$caption.'</td></tr>';
01079                                 }
01080                                 $tablecode.='</table>';
01081                                 if ($conf['tableStdWrap.'])     {$tablecode=$this->stdWrap($tablecode,$conf['tableStdWrap.']);}
01082                         }
01083 
01084                         $spaceBelowAbove = intval($this->stdWrap($conf['spaceBelowAbove'],$conf['spaceBelowAbove.']));
01085                         switch ($contentPosition)       {
01086                                 case '0':       // above
01087                                         $output= '<div style="text-align:'.$align.';">'.$tablecode.'</div>'.$this->wrapSpace($content, $spaceBelowAbove.'|0');
01088                                 break;
01089                                 case '8':       // below
01090                                         $output= $this->wrapSpace($content, '0|'.$spaceBelowAbove).'<div style="text-align:'.$align.';">'.$tablecode.'</div>';
01091                                 break;
01092                                 case '16':      // in text
01093                                         $output= $tablecode.$content;
01094                                 break;
01095                                 case '24':      // in text, no wrap
01096                                         $theResult = '';
01097                                         $theResult.= '<table border="0" cellspacing="0" cellpadding="0" class="imgtext-nowrap"><tr>';
01098                                         if ($align=='right')    {
01099                                                 $theResult.= '<td valign="top">'.$content.'</td><td valign="top">'.$tablecode.'</td>';
01100                                         } else {
01101                                                 $theResult.= '<td valign="top">'.$tablecode.'</td><td valign="top">'.$content.'</td>';
01102                                         }
01103                                         $theResult.= '</tr></table>';
01104                                         $output= $theResult;
01105                                 break;
01106                         }
01107                 } else {
01108                         $output= $content;
01109                 }
01110 
01111                 if ($conf['stdWrap.']) {
01112                         $output = $this->stdWrap($output, $conf['stdWrap.']);
01113                 }
01114 
01115                 return $output;
01116         }
01117 
01125         function CONTENT($conf) {
01126                 $theValue='';
01127 
01128                 $originalRec = $GLOBALS['TSFE']->currentRecord;
01129                 if ($originalRec)       {               // If the currentRecord is set, we register, that this record has invoked this function. It's should not be allowed to do this again then!!
01130                         $GLOBALS['TSFE']->recordRegister[$originalRec]++;
01131                 }
01132 
01133                 if ($conf['table']=='pages' || substr($conf['table'],0,3)=='tt_' || substr($conf['table'],0,3)=='fe_' || substr($conf['table'],0,3)=='tx_' || substr($conf['table'],0,4)=='ttx_' || substr($conf['table'],0,5)=='user_')        {
01134 
01135                         $renderObjName = $conf['renderObj'] ? $conf['renderObj'] : '<'.$conf['table'];
01136                         $renderObjKey = $conf['renderObj'] ? 'renderObj' : '';
01137                         $renderObjConf = $conf['renderObj.'];
01138 
01139                         $res = $this->exec_getQuery($conf['table'],$conf['select.']);
01140                         if ($error = $GLOBALS['TYPO3_DB']->sql_error()) {
01141                                 $GLOBALS['TT']->setTSlogMessage($error,3);
01142                         } else {
01143                                 $this->currentRecordTotal = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
01144                                 $GLOBALS['TT']->setTSlogMessage('NUMROWS: '.$GLOBALS['TYPO3_DB']->sql_num_rows($res));
01145                                 $cObj =t3lib_div::makeInstance('tslib_cObj');
01146                                 $cObj->setParent($this->data,$this->currentRecord);
01147                                 $this->currentRecordNumber=0;
01148                                 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))      {
01149 
01150                                                 // Versioning preview:
01151                                         $GLOBALS['TSFE']->sys_page->versionOL($conf['table'],$row);
01152 
01153                                                 // Language Overlay:
01154                                         if ($GLOBALS['TSFE']->sys_language_contentOL)   {
01155                                                 $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($conf['table'],$row,$GLOBALS['TSFE']->sys_language_content,$GLOBALS['TSFE']->sys_language_contentOL);
01156                                         }
01157 
01158                                         if (is_array($row))     {       // Might be unset in the sys_language_contentOL
01159                                                 if (!$GLOBALS['TSFE']->recordRegister[$conf['table'].':'.$row['uid']])  {
01160                                                         $this->currentRecordNumber++;
01161                                                         $cObj->parentRecordNumber = $this->currentRecordNumber;
01162                                                         $GLOBALS['TSFE']->currentRecord = $conf['table'].':'.$row['uid'];
01163                                                         $this->lastChanged($row['tstamp']);
01164                                                         $cObj->start($row,$conf['table']);
01165                                                         if ($GLOBALS['TSFE']->config['config']['insertDmailerBoundaries'])      { $theValue.='<!--DMAILER_SECTION_BOUNDARY_'.intval($row['module_sys_dmail_category']).'-->'; }
01166                                                         $theValue.= $cObj->cObjGetSingle($renderObjName, $renderObjConf, $renderObjKey);
01167                                                 }# else debug($GLOBALS['TSFE']->recordRegister,'CONTENT');
01168                                         }
01169                                 }
01170                                 if ($GLOBALS['TSFE']->config['config']['insertDmailerBoundaries'])      { $theValue.='<!--DMAILER_SECTION_BOUNDARY_END-->'; }
01171                         }
01172                 }
01173 
01174                 $theValue = $this->wrap($theValue,$conf['wrap']);
01175                 if ($conf['stdWrap.']) $theValue = $this->stdWrap($theValue,$conf['stdWrap.']);
01176 
01177                 $GLOBALS['TSFE']->currentRecord = $originalRec; // Restore
01178                 return $theValue;
01179         }
01180 
01188         function RECORDS($conf) {
01189                 $theValue='';
01190 
01191                 $originalRec = $GLOBALS['TSFE']->currentRecord;
01192                 if ($originalRec)       {               // If the currentRecord is set, we register, that this record has invoked this function. It's should not be allowed to do this again then!!
01193                         $GLOBALS['TSFE']->recordRegister[$originalRec]++;
01194                 }
01195 
01196                 $conf['source'] = $this->stdWrap($conf['source'],$conf['source.']);
01197                 if ($conf['tables'] && $conf['source']) {
01198                         $allowedTables = $conf['tables'];
01199                         if (is_array($conf['conf.']))   {
01200                                 reset($conf['conf.']);
01201                                 while(list($k)=each($conf['conf.']))    {
01202                                         if (substr($k,-1)!='.')         $allowedTables.=','.$k;
01203                                 }
01204                         }
01205 
01206                         $loadDB = t3lib_div::makeInstance('FE_loadDBGroup');
01207                         $loadDB->start($conf['source'], $allowedTables);
01208                         reset($loadDB->tableArray);
01209                         while(list($table,)=each($loadDB->tableArray))  {
01210                                 if (is_array($GLOBALS['TCA'][$table]))  {
01211                                         $loadDB->additionalWhere[$table]=$this->enableFields($table);
01212                                 }
01213                         }
01214                         $loadDB->getFromDB();
01215 
01216                         reset($loadDB->itemArray);
01217                         $data = $loadDB->results;
01218 
01219                         $cObj =t3lib_div::makeInstance('tslib_cObj');
01220                         $cObj->setParent($this->data,$this->currentRecord);
01221                         $this->currentRecordNumber=0;
01222                         $this->currentRecordTotal = count($loadDB->itemArray);
01223                         reset($loadDB->itemArray);
01224                         while(list(,$val)=each($loadDB->itemArray))     {
01225                                 $row = $data[$val['table']][$val['id']];
01226 
01227                                         // Versioning preview:
01228                                 $GLOBALS['TSFE']->sys_page->versionOL($val['table'],$row);
01229 
01230                                         // Language Overlay:
01231                                 if ($GLOBALS['TSFE']->sys_language_contentOL)   {
01232                                         $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($val['table'],$row,$GLOBALS['TSFE']->sys_language_content,$GLOBALS['TSFE']->sys_language_contentOL);
01233                                 }
01234 
01235                                 if (is_array($row))     {       // Might be unset in the content overlay things...
01236                                         if (!$conf['dontCheckPid'])     {
01237                                                 $row = $this->checkPid($row['pid']) ? $row : '';
01238                                         }
01239                                         if ($row && !$GLOBALS['TSFE']->recordRegister[$val['table'].':'.$val['id']])    {
01240                                                 $renderObjName = $conf['conf.'][$val['table']] ? $conf['conf.'][$val['table']] : '<'.$val['table'];
01241                                                 $renderObjKey = $conf['conf.'][$val['table']] ? 'conf.'.$val['table'] : '';
01242                                                 $renderObjConf = $conf['conf.'][$val['table'].'.'];
01243                                                 $this->currentRecordNumber++;
01244                                                 $cObj->parentRecordNumber=$this->currentRecordNumber;
01245                                                 $GLOBALS['TSFE']->currentRecord = $val['table'].':'.$val['id'];
01246                                                 $this->lastChanged($row['tstamp']);
01247                                                 $cObj->start($row,$val['table']);
01248                                                 if ($GLOBALS['TSFE']->config['config']['insertDmailerBoundaries'])      {$theValue.='<!--DMAILER_SECTION_BOUNDARY_'.intval($row['module_sys_dmail_category']).'-->';}
01249                                                 $theValue.=$cObj->cObjGetSingle($renderObjName, $renderObjConf, $renderObjKey);
01250                                                 if ($GLOBALS['TSFE']->config['config']['insertDmailerBoundaries'])      {$theValue.='<!--DMAILER_SECTION_BOUNDARY_END-->';}
01251                                         }# else debug($GLOBALS['TSFE']->recordRegister,'RECORDS');
01252                                 }
01253                         }
01254                 }
01255                 $GLOBALS['TSFE']->currentRecord = $originalRec; // Restore
01256                 return $this->wrap($theValue,$conf['wrap']);
01257         }
01258