00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00212
00213 require_once(PATH_t3lib."class.t3lib_parsehtml.php");
00214
00215
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();
00316 var $alternativeData ='';
00317 var $parameters = Array();
00318 var $currentValKey = 'currentValue_kidjls9dksoje';
00319 var $currentRecord = '';
00320 var $currentRecordTotal = 0;
00321 var $currentRecordNumber = 0;
00322 var $parentRecordNumber = 0;
00323 var $parentRecord = array();
00324 var $regObj;
00325
00326
00327 var $INT_include=0;
00328 var $checkPid_cache = Array();
00329 var $checkPid_badDoktypeList = '255';
00330 var $lastTypoLinkUrl='';
00331 var $lastTypoLinkTarget='';
00332 var $substMarkerCache=array();
00333 var $recordRegister=array();
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
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);
00417 }
00418 }
00419 return $content;
00420 }
00421 }
00422
00432 function cObjGetSingle($name,$conf,$TSkey='__') {
00433 $content='';
00434
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
00441 if (substr($name,0,1)=='<') {
00442 $key = trim(substr($name,1));
00443 $cF = t3lib_div::makeInstance('t3lib_TSparser');
00444
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
00450 }
00451
00452 $GLOBALS['TT']->incStackPointer();
00453 $content.=$this->cObjGetSingle($name,$conf,$key);
00454 $GLOBALS['TT']->decStackPointer();
00455 } else {
00456
00457
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
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
00555 $GLOBALS['TSFE']->cObjectDepthCounter++;
00556 return $content;
00557 }
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
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.']);
00733 }
00734 $imgList=trim($this->stdWrap($conf['imgList'],$conf['imgList.']));
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']);
00744 }
00745
00746 $imgPath = $this->stdWrap($conf['imgPath'],$conf['imgPath.']);
00747
00748
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
00793 $colCount = ($cols > 1) ? $cols : 1;
00794 if ($colCount > $imgCount) {$colCount = $imgCount;}
00795 $rowCount = ($colCount > 1) ? ceil($imgCount / $colCount) : $imgCount;
00796
00797 if ($rows>1) {
00798 $rowCount = $rows;
00799 if ($rowCount > $imgCount) {$rowCount = $imgCount;}
00800 $colCount = ($rowCount>1) ? ceil($imgCount / $rowCount) : $imgCount;
00801 }
00802
00803
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) {
00809 $maxWInText = round($maxW/100*50);
00810 }
00811
00812 if ($maxWInText && $contentPosition>=16) {
00813 $maxW = $maxWInText;
00814 }
00815
00816 if ($maxW && $colCount > 0) {
00817
00818
00819
00820
00821
00822 $maxW = ceil(($maxW-$colspacing*($colCount-1)-$colCount*$border*$borderThickness*2)/$colCount);
00823 }
00824
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) {
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
00847 $splitArr=array();
00848 $splitArr['imgObjNum']=$conf['imgObjNum'];
00849 $splitArr = $GLOBALS['TSFE']->tmpl->splitConfArray($splitArr,$imgCount);
00850
00851
00852 $equalHeight = intval($this->stdWrap($conf['equalH'],$conf['equalH.']));
00853 if ($equalHeight) {
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;
00863 if ($relations[$a]) {
00864 $relations_cols[floor($a/$colCount)] += $imgInfo[0]/$relations[$a];
00865 }
00866 }
00867 }
00868
00869 $imageRowsFinalWidths = Array();
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
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;
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
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
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
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
00971
00972 $tableWidth = max($imageRowsFinalWidths)+ $colspacing*($colCount-1) + $colCount*$border*$borderThickness*2;
00973
00974
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;}
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
00995 $colspan = (($colspacing) ? $colCount*2-1 : $colCount);
00996 $rowspan = (($rowspacing) ? $rowCount*2-1 : $rowCount) + $cap;
00997
00998
00999
01000 $editIconsHTML = $conf['editIcons']&&$GLOBALS['TSFE']->beUserLogin ? $this->editIcons('',$conf['editIcons'],$conf['editIcons.']) : '';
01001
01002
01003 $tablecode='';
01004 $flag=0;
01005 if ($conf['noStretchAndMarginCells']!=1) {
01006 $tablecode.='<tr>';
01007 if ($txtMarg && $align=='right') {
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') {
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
01020 $tablecode.='</tr>';
01021 }
01022
01023
01024 for ($c=0;$c<$rowCount;$c++) {
01025 if ($c && $rowspacing) {
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>';
01029 for ($b=0; $b<$colCount_temp; $b++) {
01030 if ($b && $colspacing) {
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>';
01036 $tablecode.=$colSpacer;
01037 }
01038 }
01039 if (!$noCols || ($noCols && !$b)) {
01040 $tablecode.='<td valign="top">';
01041 if ($noCols) {$tablecode.='<table width="'.$imageRowsFinalWidths[$c].'" border="0" cellpadding="0" cellspacing="0"><tr>';}
01042 }
01043 for ($a=0;$a<$rowCount_temp;$a++) {
01044 $imgIndex = $index+$a*$colCount_temp;
01045 if ($imgsTag[$imgIndex]) {
01046 if ($rowspacing && $noRows && $a) {
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"' : '';
01052 if ($border) {$imageHTML='<table border="0" cellpadding="'.$borderThickness.'" cellspacing="0" bgcolor="'.$borderColor.'"'.$Talign.'><tr><td>'.$imageHTML.'</td></tr></table>';}
01053 $imageHTML.=$editIconsHTML; $editIconsHTML='';
01054 if ($conf['netprintApplicationLink']) {$imageHTML = $this->netprintApplication_offsiteLinkWrap($imageHTML,$origImages[$imgIndex],$conf['netprintApplicationLink.']);}
01055 $imageHTML.=$captionArray[$imgIndex];
01056 if ($noCols) {$imageHTML='<td valign="top">'.$imageHTML.'</td>';}
01057 $tablecode.=$imageHTML;
01058 }
01059 }
01060 $index++;
01061 if (!$noCols || ($noCols && $b+1==$colCount_temp)) {
01062 if ($noCols) {$tablecode.='</tr></table>';}
01063 $tablecode.='</td>';
01064 }
01065 }
01066 $tablecode.='</tr>';
01067 }
01068 if ($c) {
01069
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) {
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':
01087 $output= '<div style="text-align:'.$align.';">'.$tablecode.'</div>'.$this->wrapSpace($content, $spaceBelowAbove.'|0');
01088 break;
01089 case '8':
01090 $output= $this->wrapSpace($content, '0|'.$spaceBelowAbove).'<div style="text-align:'.$align.';">'.$tablecode.'</div>';
01091 break;
01092 case '16':
01093 $output= $tablecode.$content;
01094 break;
01095 case '24':
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) {
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
01151 $GLOBALS['TSFE']->sys_page->versionOL($conf['table'],$row);
01152
01153
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)) {
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;
01178 return $theValue;
01179 }
01180
01188 function RECORDS($conf) {
01189 $theValue='';
01190
01191 $originalRec = $GLOBALS['TSFE']->currentRecord;
01192 if ($originalRec) {
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
01228 $GLOBALS['TSFE']->sys_page->versionOL($val['table'],$row);
01229
01230
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)) {
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;
01256 return $this->wrap($theValue,$conf['wrap']);
01257 }
01258