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
00218
00219 require_once(PATH_t3lib."class.t3lib_parsehtml.php");
00220
00221
00222 if(t3lib_extMgm::isLoaded('obts')) {
00223 require_once(t3lib_extMgm::extPath('obts').'_tsobject/_tso.php');
00224 }
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00256 class tslib_cObj {
00257 var $align = Array ('center', 'right', 'left');
00258
00269 var $image_compression = Array(
00270 10 => Array('params'=>'', 'ext'=>'gif'),
00271 11 => Array('params'=>'-colors 128', 'ext'=>'gif'),
00272 12 => Array('params'=>'-colors 64', 'ext'=>'gif'),
00273 13 => Array('params'=>'-colors 32', 'ext'=>'gif'),
00274 14 => Array('params'=>'-colors 16', 'ext'=>'gif'),
00275 15 => Array('params'=>'-colors 8', 'ext'=>'gif'),
00276
00277 30 => Array('params'=>'-colors 256', 'ext'=>'png'),
00278 31 => Array('params'=>'-colors 128', 'ext'=>'png'),
00279 32 => Array('params'=>'-colors 64', 'ext'=>'png'),
00280 33 => Array('params'=>'-colors 32', 'ext'=>'png'),
00281 34 => Array('params'=>'-colors 16', 'ext'=>'png'),
00282 35 => Array('params'=>'-colors 8', 'ext'=>'png'),
00283 39 => Array('params'=>'', 'ext'=>'png'),
00284
00285 20 => Array('params'=>'-quality 100', 'ext'=>'jpg'),
00286 21 => Array('params'=>'-quality 90', 'ext'=>'jpg'),
00287 22 => Array('params'=>'-quality 80', 'ext'=>'jpg'),
00288 23 => Array('params'=>'-quality 70', 'ext'=>'jpg'),
00289 24 => Array('params'=>'-quality 60', 'ext'=>'jpg'),
00290 25 => Array('params'=>'-quality 50', 'ext'=>'jpg'),
00291 26 => Array('params'=>'-quality 40', 'ext'=>'jpg'),
00292 27 => Array('params'=>'-quality 30', 'ext'=>'jpg'),
00293 28 => Array('params'=>'-quality 20', 'ext'=>'jpg')
00294 );
00295
00301 var $image_effects = Array(
00302 1 => '-rotate 90',
00303 2 => '-rotate 270',
00304 3 => '-rotate 180',
00305 10 => '-colorspace GRAY',
00306 11 => '-sharpen 70',
00307 20 => '-normalize',
00308 23 => '-contrast',
00309 25 => '-gamma 1.3',
00310 26 => '-gamma 0.8'
00311 );
00312
00320 var $data = Array();
00321 var $oldData = Array();
00322 var $alternativeData ='';
00323 var $parameters = Array();
00324 var $currentValKey = 'currentValue_kidjls9dksoje';
00325 var $currentRecord = '';
00326 var $currentRecordTotal = 0;
00327 var $currentRecordNumber = 0;
00328 var $parentRecordNumber = 0;
00329 var $parentRecord = array();
00330 var $regObj;
00331
00332
00333 var $INT_include=0;
00334 var $checkPid_cache = Array();
00335 var $checkPid_badDoktypeList = '255';
00336 var $lastTypoLinkUrl='';
00337 var $lastTypoLinkTarget='';
00338 var $lastTypoLinkLD = array();
00339 var $substMarkerCache=array();
00340 var $recordRegister=array();
00341 var $cObjHookObjectsArr = array();
00342 protected $stdWrapHookObjects = array();
00343
00353 function start($data,$table='') {
00354 global $TYPO3_CONF_VARS;
00355 $this->data = $data;
00356 $this->currentRecord = $table ? $table.':'.$this->data['uid'] : '';
00357 $this->parameters = Array();
00358 if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClass'])) {
00359 foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClass'] as $classArr) {
00360 $this->cObjHookObjectsArr[$classArr[0]] = &t3lib_div::getUserObj($classArr[1]);
00361 }
00362 }
00363
00364 if(is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap'])) {
00365 foreach($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap'] as $classData) {
00366 $hookObject = &t3lib_div::getUserObj($classData);
00367
00368 if(!($hookObject instanceof tslib_content_stdWrapHook)) {
00369 throw new UnexpectedValueException('$hookObject must implement interface tslib_content_stdWrapHook', 1195043965);
00370 }
00371
00372 $this->stdWrapHookObjects[] = $hookObject;
00373 }
00374 }
00375
00376 }
00377
00387 function setParent($data,$currentRecord) {
00388 $this->parentRecord=array('data'=>$data, 'currentRecord'=>$currentRecord);
00389 }
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00412 function getCurrentVal() {
00413 return $this->data[$this->currentValKey];
00414 }
00415
00423 function setCurrentVal($value) {
00424 $this->data[$this->currentValKey] = $value;
00425 }
00426
00436 function cObjGet($setup,$addKey='') {
00437 if (is_array($setup)) {
00438 $sKeyArray=t3lib_TStemplate::sortedKeyList($setup);
00439 $content ='';
00440 foreach($sKeyArray as $theKey) {
00441 $theValue=$setup[$theKey];
00442 if (intval($theKey) && !strstr($theKey,'.')) {
00443 $conf=$setup[$theKey.'.'];
00444 $content.=$this->cObjGetSingle($theValue,$conf,$addKey.$theKey);
00445 }
00446 }
00447 return $content;
00448 }
00449 }
00450
00460 function cObjGetSingle($name,$conf,$TSkey='__') {
00461 global $TYPO3_CONF_VARS;
00462
00463 $content='';
00464
00465 $GLOBALS['TSFE']->cObjectDepthCounter--;
00466 if ($GLOBALS['TSFE']->cObjectDepthCounter>0) {
00467 $name = trim($name);
00468 if ($GLOBALS['TT']->LR) $GLOBALS['TT']->push($TSkey, $name);
00469
00470
00471 if (substr($name,0,1)=='<') {
00472 $key = trim(substr($name,1));
00473 $cF = t3lib_div::makeInstance('t3lib_TSparser');
00474
00475 $old_conf=$conf;
00476 list($name, $conf) = $cF->getVal($key,$GLOBALS['TSFE']->tmpl->setup);
00477 if (is_array($old_conf) && count($old_conf)) {
00478 $conf = $this->joinTSarrays($conf,$old_conf);
00479
00480 }
00481
00482 $GLOBALS['TT']->incStackPointer();
00483 $content.=$this->cObjGetSingle($name,$conf,$key);
00484 $GLOBALS['TT']->decStackPointer();
00485 } else {
00486
00487 $hooked = false;
00488
00489 foreach ($this->cObjHookObjectsArr as $cObjName => $hookObj) {
00490 if (($name===$cObjName) && method_exists($hookObj, 'cObjGetSingleExt')) {
00491 $content.= $hookObj->cObjGetSingleExt($name, $conf, $TSkey, $this);
00492 $hooked = true;
00493 }
00494 }
00495 if (!$hooked && t3lib_extMgm::isLoaded('obts') && isset($GLOBALS['OBTS']['tso_list'][$name])) {
00496 $content.= obts_dtutil::renderDatatypeContent($name, $GLOBALS['OBTS']['tso_list'][$name], $conf, $this);
00497 } elseif (!$hooked) {
00498
00499 switch($name) {
00500 case 'COBJ_ARRAY':
00501 case 'COA':
00502 $content.=$this->COBJ_ARRAY($conf);
00503 break;
00504 case 'COA_INT':
00505 $content.=$this->COBJ_ARRAY($conf,'INT');
00506 break;
00507 case 'HTML':
00508 $content.=$this->HTML($conf);
00509 break;
00510 case 'TEXT':
00511 $content.=$this->TEXT($conf);
00512 break;
00513 case 'CLEARGIF':
00514 $content.=$this->CLEARGIF($conf);
00515 break;
00516 case 'FILE':
00517 $content.=$this->FILE($conf);
00518 break;
00519 case 'IMAGE':
00520 $content.=$this->IMAGE($conf);
00521 break;
00522 case 'IMG_RESOURCE':
00523 $content.=$this->IMG_RESOURCE($conf);
00524 break;
00525 case 'IMGTEXT':
00526 $content.=$this->IMGTEXT($conf);
00527 break;
00528 case 'CONTENT':
00529 $content.=$this->CONTENT($conf);
00530 break;
00531 case 'RECORDS':
00532 $content.=$this->RECORDS($conf);
00533 break;
00534 case 'HMENU':
00535 $content.=$this->HMENU($conf);
00536 break;
00537 case 'CTABLE':
00538 $content.=$this->CTABLE($conf);
00539 break;
00540 case 'OTABLE':
00541 $content.=$this->OTABLE($conf);
00542 break;
00543 case 'COLUMNS':
00544 $content.=$this->COLUMNS($conf);
00545 break;
00546 case 'HRULER':
00547 $content.=$this->HRULER($conf);
00548 break;
00549 case 'CASE':
00550 $content.=$this->CASEFUNC($conf);
00551 break;
00552 case 'LOAD_REGISTER':
00553 case 'RESTORE_REGISTER':
00554 $this->LOAD_REGISTER($conf,$name);
00555 break;
00556 case 'FORM':
00557 $content.=$this->FORM($conf);
00558 break;
00559 case 'SEARCHRESULT':
00560 $content.=$this->SEARCHRESULT($conf);
00561 break;
00562 case 'PHP_SCRIPT':
00563 $content.=$this->PHP_SCRIPT($conf);
00564 break;
00565 case 'PHP_SCRIPT_EXT':
00566 $content.=$this->PHP_SCRIPT($conf,'EXT');
00567 break;
00568 case 'PHP_SCRIPT_INT':
00569 $content.=$this->PHP_SCRIPT($conf,'INT');
00570 break;
00571 case 'USER':
00572 $content.=$this->USER($conf);
00573 break;
00574 case 'USER_INT':
00575 $content.=$this->USER($conf,'INT');
00576 break;
00577 case 'TEMPLATE':
00578 $content.=$this->TEMPLATE($conf);
00579 break;
00580 case 'EDITPANEL':
00581 if ($GLOBALS['TSFE']->beUserLogin) {$content.=$this->editPanel($content, $conf);}
00582 break;
00583 case 'MULTIMEDIA':
00584 $content.=$this->MULTIMEDIA($conf);
00585 break;
00586 default:
00587
00588 if($name && is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'])) {
00589 foreach($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'] as $classData) {
00590 $hookObject = &t3lib_div::getUserObj($classData);
00591
00592 if(!($hookObject instanceof tslib_content_cObjGetSingleHook)) {
00593 throw new UnexpectedValueException('$hookObject must implement interface tslib_content_cObjGetSingleHook', 1195043731);
00594 }
00595
00596 $content .= $hookObject->getSingleContentObject($name, (array) $conf, $TSkey, $this);
00597 }
00598 }
00599 break;
00600 }
00601 }
00602 }
00603 if ($GLOBALS['TT']->LR) $GLOBALS['TT']->pull($content);
00604 }
00605
00606 $GLOBALS['TSFE']->cObjectDepthCounter++;
00607 return $content;
00608 }
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00629 function HTML($conf) {
00630 return $this->stdWrap($conf['value'],$conf['value.']);
00631 }
00632
00640 function TEXT($conf) {
00641 return $this->stdWrap($conf['value'],$conf);
00642 }
00643
00651 function CLEARGIF($conf) {
00652 $w = $this->stdWrap($conf['width'],$conf['width.']);
00653 $h = $this->stdWrap($conf['height'],$conf['height.']);
00654 $w = $w ? $w : 1;
00655 $h = $h ? $h : 1;
00656 $wrap = $conf['wrap'] ? $conf['wrap'] : '|<br />';
00657 $theValue = $this->wrap('<img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$w.'" height="'.$h.'"'.$this->getBorderAttr(' border="0"').' alt="" title="" />', $wrap);
00658
00659 return $this->stdWrap($theValue,$conf['stdWrap.']);
00660 }
00661
00670 function COBJ_ARRAY($conf,$ext='') {
00671 $content='';
00672 switch($ext) {
00673 case 'INT':
00674 $substKey = $ext.'_SCRIPT.'.$GLOBALS['TSFE']->uniqueHash();
00675 $content.='<!--'.$substKey.'-->';
00676 $GLOBALS['TSFE']->config[$ext.'incScript'][$substKey] = array(
00677 'file' => $conf['includeLibs'],
00678 'conf'=>$conf,
00679 'cObj'=>serialize($this),
00680 'type'=>'COA'
00681 );
00682 break;
00683 default:
00684 if ($this->checkIf($conf['if.'])) {
00685 $content=$this->cObjGet($conf);
00686 if ($conf['wrap']) {
00687 $content=$this->wrap($content, $conf['wrap']);
00688 }
00689 if ($conf['stdWrap.']) {
00690 $content=$this->stdWrap($content, $conf['stdWrap.']);
00691 }
00692 }
00693 break;
00694 }
00695 return $content;
00696 }
00697
00706 function USER($conf,$ext='') {
00707 $content='';
00708 switch($ext) {
00709 case 'INT':
00710 $substKey = $ext.'_SCRIPT.'.$GLOBALS['TSFE']->uniqueHash();
00711 $content.='<!--'.$substKey.'-->';
00712 $GLOBALS['TSFE']->config[$ext.'incScript'][$substKey] = array(
00713 'file' => $conf['includeLibs'],
00714 'conf' => $conf,
00715 'cObj' => serialize($this),
00716 'type' => 'FUNC'
00717 );
00718 break;
00719 default:
00720 $content.=$this->callUserFunction($conf['userFunc'],$conf,'');
00721 break;
00722 }
00723 return $content;
00724 }
00725
00733 function FILE($conf) {
00734 $theValue = $this->fileResource($this->stdWrap($conf['file'],$conf['file.']), trim($this->getAltParam($conf, false)));
00735 if ($conf['linkWrap']) {
00736 $theValue = $this->linkWrap($theValue,$conf['linkWrap']);
00737 }
00738 return $this->wrap($theValue,$conf['wrap']);
00739 }
00740
00749 function IMAGE($conf) {
00750 $content='';
00751 if ($this->checkIf($conf['if.'])) {
00752 $theValue = $this->cImage($conf['file'],$conf);
00753 if ($conf['stdWrap.']) {
00754 $theValue = $this->stdWrap($theValue,$conf['stdWrap.']);
00755 }
00756 return $theValue;
00757 }
00758 }
00759
00768 function IMG_RESOURCE($conf) {
00769 $GLOBALS['TSFE']->lastImgResourceInfo = $this->getImgResource($conf['file'],$conf['file.']);
00770 return $this->stdWrap($GLOBALS['TSFE']->lastImgResourceInfo[3],$conf['stdWrap.']);
00771 }
00772
00780 function IMGTEXT($conf) {
00781 $content='';
00782 if (is_array($conf['text.'])) {
00783 $content.= $this->stdWrap($this->cObjGet($conf['text.'],'text.'),$conf['text.']);
00784 }
00785 $imgList=trim($this->stdWrap($conf['imgList'],$conf['imgList.']));
00786 if ($imgList) {
00787 $imgs = t3lib_div::trimExplode(',',$imgList);
00788 $imgStart = intval($this->stdWrap($conf['imgStart'],$conf['imgStart.']));
00789
00790 $imgCount= count($imgs)-$imgStart;
00791
00792 $imgMax = intval($this->stdWrap($conf['imgMax'],$conf['imgMax.']));
00793 if ($imgMax) {
00794 $imgCount = t3lib_div::intInRange($imgCount,0,$imgMax);
00795 }
00796
00797 $imgPath = $this->stdWrap($conf['imgPath'],$conf['imgPath.']);
00798
00799
00800 $caption='';
00801 $captionArray = array();
00802 if (!$conf['captionSplit'] && !$conf['imageTextSplit'] && is_array($conf['caption.'])) {
00803 $caption = $this->stdWrap($this->cObjGet($conf['caption.'], 'caption.'),$conf['caption.']);
00804 }
00805 if ($conf['captionSplit'] && $conf['captionSplit.']['cObject']) {
00806 $legacyCaptionSplit = 1;
00807 $capSplit = $this->stdWrap($conf['captionSplit.']['token'], $conf['captionSplit.']['token.']);
00808 if (!$capSplit) {$capSplit=chr(10);}
00809 $captionArray = explode($capSplit, $this->cObjGetSingle($conf['captionSplit.']['cObject'], $conf['captionSplit.']['cObject.'], 'captionSplit.cObject'));
00810 while (list($ca_key, $ca_val) = each($captionArray)) {
00811 $captionArray[$ca_key] = $this->stdWrap(trim($captionArray[$ca_key]), $conf['captionSplit.']['stdWrap.']);
00812 }
00813 }
00814
00815 $tablecode='';
00816 $position=$this->stdWrap($conf['textPos'],$conf['textPos.']);
00817
00818 $tmppos = $position&7;
00819 $contentPosition = $position&24;
00820 $align = $this->align[$tmppos];
00821 $cap = ($caption)?1:0;
00822 $txtMarg = intval($this->stdWrap($conf['textMargin'],$conf['textMargin.']));
00823 if (!$conf['textMargin_outOfText'] && $contentPosition<16) {
00824 $txtMarg=0;
00825 }
00826
00827 $cols = intval($this->stdWrap($conf['cols'],$conf['cols.']));
00828 $rows = intval($this->stdWrap($conf['rows'],$conf['rows.']));
00829 $colspacing = intval($this->stdWrap($conf['colSpace'],$conf['colSpace.']));
00830 $rowspacing = intval($this->stdWrap($conf['rowSpace'],$conf['rowSpace.']));
00831
00832 $border = intval($this->stdWrap($conf['border'],$conf['border.'])) ? 1:0;
00833 $borderColor = $this->stdWrap($conf['borderCol'],$conf['borderCol.']);
00834 $borderThickness = intval($this->stdWrap($conf['borderThick'],$conf['borderThick.']));
00835
00836 $borderColor=$borderColor?$borderColor:'black';
00837 $borderThickness=$borderThickness?$borderThickness:1;
00838
00839 $caption_align = $this->stdWrap($conf['captionAlign'],$conf['captionAlign.']);
00840 if (!$caption_align) {
00841 $caption_align = $align;
00842 }
00843
00844 $colCount = ($cols > 1) ? $cols : 1;
00845 if ($colCount > $imgCount) {$colCount = $imgCount;}
00846 $rowCount = ($colCount > 1) ? ceil($imgCount / $colCount) : $imgCount;
00847
00848 if ($rows>1) {
00849 $rowCount = $rows;
00850 if ($rowCount > $imgCount) {$rowCount = $imgCount;}
00851 $colCount = ($rowCount>1) ? ceil($imgCount / $rowCount) : $imgCount;
00852 }
00853
00854
00855 $colRelations = trim($this->stdWrap($conf['colRelations'],$conf['colRelations.']));
00856 $maxW = intval($this->stdWrap($conf['maxW'],$conf['maxW.']));
00857
00858 $maxWInText = intval($this->stdWrap($conf['maxWInText'],$conf['maxWInText.']));
00859 if (!$maxWInText) {
00860 $maxWInText = round($maxW/2);
00861 }
00862
00863 if ($maxWInText && $contentPosition>=16) {
00864 $maxW = $maxWInText;
00865 }
00866
00867 if ($maxW && $colCount > 0) {
00868
00869
00870
00871
00872
00873 $maxW = ceil(($maxW-$colspacing*($colCount-1)-$colCount*$border*$borderThickness*2)/$colCount);
00874 }
00875
00876 $colMaxW = Array();
00877 if ($colRelations) {
00878 $rel_parts = explode(':',$colRelations);
00879 $rel_total = 0;
00880 for ($a=0;$a<$colCount;$a++) {
00881 $rel_parts[$a] = intval($rel_parts[$a]);
00882 $rel_total+= $rel_parts[$a];
00883 }
00884 if ($rel_total) {
00885 for ($a=0;$a<$colCount;$a++) {
00886 $colMaxW[$a] = round(($maxW*$colCount)/$rel_total*$rel_parts[$a]);
00887 }
00888 if (min($colMaxW)<=0 || max($rel_parts)/min($rel_parts)>10) {
00889 $colMaxW = Array();
00890 }
00891 }
00892 }
00893 $image_compression = intval($this->stdWrap($conf['image_compression'],$conf['image_compression.']));
00894 $image_effects = intval($this->stdWrap($conf['image_effects'],$conf['image_effects.']));
00895 $image_frames = intval($this->stdWrap($conf['image_frames.']['key'],$conf['image_frames.']['key.']));
00896
00897
00898 $splitArr=array();
00899 $splitArr['imgObjNum']=$conf['imgObjNum'];
00900 $splitArr = $GLOBALS['TSFE']->tmpl->splitConfArray($splitArr,$imgCount);
00901
00902
00903 $equalHeight = intval($this->stdWrap($conf['equalH'],$conf['equalH.']));
00904 if ($equalHeight) {
00905 $gifCreator = t3lib_div::makeInstance('tslib_gifbuilder');
00906 $gifCreator->init();
00907 $relations = Array();
00908 $relations_cols = Array();
00909 $totalMaxW = $maxW*$colCount;
00910 for($a=0;$a<$imgCount;$a++) {
00911 $imgKey = $a+$imgStart;
00912 $imgInfo = $gifCreator->getImageDimensions($imgPath.$imgs[$imgKey]);
00913 $relations[$a] = $imgInfo[1] / $equalHeight;
00914 if ($relations[$a]) {
00915 $relations_cols[floor($a/$colCount)] += $imgInfo[0]/$relations[$a];
00916 }
00917 }
00918 }
00919
00920 $imageRowsFinalWidths = Array();
00921 $imageRowsMaxHeights = Array();
00922 $imgsTag=array();
00923 $origImages=array();
00924 for($a=0;$a<$imgCount;$a++) {
00925 $GLOBALS['TSFE']->register['IMAGE_NUM'] = $a;
00926 $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $a;
00927
00928 $imgKey = $a+$imgStart;
00929 $totalImagePath = $imgPath.$imgs[$imgKey];
00930 $this->data[$this->currentValKey] = $totalImagePath;
00931 $imgObjNum = intval($splitArr[$a]['imgObjNum']);
00932 $imgConf = $conf[$imgObjNum.'.'];
00933
00934 if ($equalHeight) {
00935 $scale = 1;
00936 if ($totalMaxW) {
00937 $rowTotalMaxW = $relations_cols[floor($a/$colCount)];
00938 if ($rowTotalMaxW > $totalMaxW) {
00939 $scale = $rowTotalMaxW / $totalMaxW;
00940 }
00941 }
00942
00943 $imgConf['file.']['height'] = round($equalHeight/$scale);
00944
00945 unset($imgConf['file.']['width']);
00946 unset($imgConf['file.']['maxW']);
00947 unset($imgConf['file.']['maxH']);
00948 unset($imgConf['file.']['minW']);
00949 unset($imgConf['file.']['minH']);
00950 unset($imgConf['file.']['width.']);
00951 unset($imgConf['file.']['maxW.']);
00952 unset($imgConf['file.']['maxH.']);
00953 unset($imgConf['file.']['minW.']);
00954 unset($imgConf['file.']['minH.']);
00955 $maxW = 0;
00956 }
00957
00958 if ($maxW) {
00959 if (count($colMaxW)) {
00960 $imgConf['file.']['maxW'] = $colMaxW[($a%$colCount)];
00961 } else {
00962 $imgConf['file.']['maxW'] = $maxW;
00963 }
00964 }
00965
00966
00967 if (is_array($imgConf)) {
00968 if ($this->image_effects[$image_effects]) {
00969 $imgConf['file.']['params'].= ' '.$this->image_effects[$image_effects];
00970 }
00971 if ($image_frames) {
00972 if (is_array($conf['image_frames.'][$image_frames.'.'])) {
00973 $imgConf['file.']['m.'] = $conf['image_frames.'][$image_frames.'.'];
00974 }
00975 }
00976 if ($image_compression && $imgConf['file']!='GIFBUILDER') {
00977 if ($image_compression==1) {
00978 $tempImport = $imgConf['file.']['import'];
00979 $tempImport_dot = $imgConf['file.']['import.'];
00980 unset($imgConf['file.']);
00981 $imgConf['file.']['import'] = $tempImport;
00982 $imgConf['file.']['import.'] = $tempImport_dot;
00983 } elseif (isset($this->image_compression[$image_compression])) {
00984 $imgConf['file.']['params'].= ' '.$this->image_compression[$image_compression]['params'];
00985 $imgConf['file.']['ext'] = $this->image_compression[$image_compression]['ext'];
00986 unset($imgConf['file.']['ext.']);
00987 }
00988 }
00989
00990
00991 if (!strlen($imgConf['altText']) && !is_array($imgConf['altText.'])) {
00992 $imgConf['altText'] = $conf['altText'];
00993 $imgConf['altText.'] = $conf['altText.'];
00994 }
00995 if (!strlen($imgConf['titleText']) && !is_array($imgConf['titleText.'])) {
00996 $imgConf['titleText'] = $conf['titleText'];
00997 $imgConf['titleText.'] = $conf['titleText.'];
00998 }
00999 if (!strlen($imgConf['longdescURL']) && !is_array($imgConf['longdescURL.'])) {
01000 $imgConf['longdescURL'] = $conf['longdescURL'];
01001 $imgConf['longdescURL.'] = $conf['longdescURL.'];
01002 }
01003 } else {
01004 $imgConf = array(
01005 'altText' => $conf['altText'],
01006 'titleText' => $conf['titleText'],
01007 'longdescURL' => $conf['longdescURL'],
01008 'file' => $totalImagePath
01009 );
01010 }
01011
01012 $imgsTag[$imgKey] = $this->IMAGE($imgConf);
01013
01014
01015 $origImages[$imgKey]=$GLOBALS['TSFE']->lastImageInfo;
01016
01017 $imageRowsFinalWidths[floor($a/$colCount)] += $GLOBALS['TSFE']->lastImageInfo[0];
01018 if ($GLOBALS['TSFE']->lastImageInfo[1]>$imageRowsMaxHeights[floor($a/$colCount)]) {
01019 $imageRowsMaxHeights[floor($a/$colCount)] = $GLOBALS['TSFE']->lastImageInfo[1];
01020 }
01021 }
01022
01023
01024 $tableWidth = max($imageRowsFinalWidths)+ $colspacing*($colCount-1) + $colCount*$border*$borderThickness*2;
01025
01026
01027 $index=$imgStart;
01028
01029 $noRows = $this->stdWrap($conf['noRows'],$conf['noRows.']);
01030 $noCols = $this->stdWrap($conf['noCols'],$conf['noCols.']);
01031 if ($noRows) {$noCols=0;}
01032 if ($equalHeight) {
01033 $noCols=1;
01034 $noRows=0;
01035 }
01036
01037 $rowCount_temp=1;
01038 $colCount_temp=$colCount;
01039 if ($noRows) {
01040 $rowCount_temp = $rowCount;
01041 $rowCount=1;
01042 }
01043 if ($noCols) {
01044 $colCount=1;
01045 }
01046
01047 $colspan = (($colspacing) ? $colCount*2-1 : $colCount);
01048 $rowspan = (($rowspacing) ? $rowCount*2-1 : $rowCount) + $cap;
01049
01050
01051
01052 $editIconsHTML = $conf['editIcons']&&$GLOBALS['TSFE']->beUserLogin ? $this->editIcons('',$conf['editIcons'],$conf['editIcons.']) : '';
01053
01054
01055 $tablecode='';
01056 $flag=0;
01057 if ($conf['noStretchAndMarginCells']!=1) {
01058 $tablecode.='<tr>';
01059 if ($txtMarg && $align=='right') {
01060 $tablecode.='<td rowspan="'.($rowspan+1).'" valign="top"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$txtMarg.'" height="1" alt="" title="" />'.($editIconsHTML?'<br />'.$editIconsHTML:'').'</td>';
01061 $editIconsHTML='';
01062 $flag=1;
01063 }
01064 $tablecode.='<td colspan="'.$colspan.'"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$tableWidth.'" height="1" alt="" /></td>';
01065 if ($txtMarg && $align=='left') {
01066 $tablecode.='<td rowspan="'.($rowspan+1).'" valign="top"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$txtMarg.'" height="1" alt="" title="" />'.($editIconsHTML?'<br />'.$editIconsHTML:'').'</td>';
01067 $editIconsHTML='';
01068 $flag=1;
01069 }
01070 if ($flag) $tableWidth+=$txtMarg+1;
01071
01072 $tablecode.='</tr>';
01073 }
01074
01075
01076 for ($c=0;$c<$rowCount;$c++) {
01077 if ($c && $rowspacing) {
01078 $tablecode.='<tr><td colspan="'.$colspan.'"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="1" height="'.$rowspacing.'"'.$this->getBorderAttr(' border="0"').' alt="" title="" /></td></tr>';
01079 }
01080 $tablecode.='<tr>';
01081 for ($b=0; $b<$colCount_temp; $b++) {
01082 if ($b && $colspacing) {
01083 if (!$noCols) {
01084 $tablecode.='<td><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$colspacing.'" height="1"'.$this->getBorderAttr(' border="0"').' alt="" title="" /></td>';
01085 } else {
01086 $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="" />';
01087 $colSpacer='<td valign="top">'.$colSpacer.'</td>';
01088 $tablecode.=$colSpacer;
01089 }
01090 }
01091 if (!$noCols || ($noCols && !$b)) {
01092 $tablecode.='<td valign="top">';
01093 if ($noCols) {$tablecode.='<table width="'.$imageRowsFinalWidths[$c].'" border="0" cellpadding="0" cellspacing="0"><tr>';}
01094 }
01095 for ($a=0;$a<$rowCount_temp;$a++) {
01096 $GLOBALS['TSFE']->register['IMAGE_NUM'] = $imgIndex;
01097 $imgIndex = $index+$a*$colCount_temp;
01098 $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $imgIndex;
01099 if ($imgsTag[$imgIndex]) {
01100 if ($rowspacing && $noRows && $a) {
01101 $tablecode.= '<img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="1" height="'.$rowspacing.'" alt="" title="" /><br />';
01102 }
01103 if ($legacyCaptionSplit) {
01104 $thisCaption = $captionArray[$imgIndex];
01105 } else if ($conf['captionSplit'] || $conf['imageTextSplit']) {
01106 $thisCaption = $this->stdWrap($this->cObjGet($conf['caption.'], 'caption.'), $conf['caption.']);
01107 }
01108 $imageHTML = $imgsTag[$imgIndex].'<br />';
01109 $Talign = (!trim($thisCaption) && !$noRows) ? ' align="left"' : '';
01110 if ($border) {$imageHTML='<table border="0" cellpadding="'.$borderThickness.'" cellspacing="0" bgcolor="'.$borderColor.'"'.$Talign.'><tr><td>'.$imageHTML.'</td></tr></table>';}
01111 $imageHTML.=$editIconsHTML;
01112 $editIconsHTML='';
01113 $imageHTML.=$thisCaption;
01114 if ($noCols) {$imageHTML='<td valign="top">'.$imageHTML.'</td>';}
01115 $tablecode.=$imageHTML;
01116 }
01117 }
01118 $index++;
01119 if (!$noCols || ($noCols && $b+1==$colCount_temp)) {
01120 if ($noCols) {$tablecode.='</tr></table>';}
01121 $tablecode.='</td>';
01122 }
01123 }
01124 $tablecode.='</tr>';
01125 }
01126