Project

General

Profile

Bug #23162 ยป 15094.diff

Administrator Admin, 2010-07-16 00:26

View differences:

typo3/sysext/cms/ext_autoload.php (working copy)
'tslib_gmenu_foldout' => PATH_tslib . 'media/scripts/gmenu_foldout.php',
'tslib_gmenu_layers' => PATH_tslib . 'media/scripts/gmenu_layers.php',
'tslib_tmenu_layers' => PATH_tslib . 'media/scripts/tmenu_layers.php',
//content objects
'tslib_content_abstract' => PATH_tslib . 'content/class.tslib_content_abstract.php',
'tslib_content_case' => PATH_tslib . 'content/class.tslib_content_case.php',
'tslib_content_cleargif' => PATH_tslib . 'content/class.tslib_content_cleargif.php',
'tslib_content_coa_int' => PATH_tslib . 'content/class.tslib_content_coa_int.php',
'tslib_content_coa' => PATH_tslib . 'content/class.tslib_content_coa.php',
'tslib_content_columns' => PATH_tslib . 'content/class.tslib_content_columns.php',
'tslib_content_content' => PATH_tslib . 'content/class.tslib_content_content.php',
'tslib_content_ctable' => PATH_tslib . 'content/class.tslib_content_ctable.php',
'tslib_content_file' => PATH_tslib . 'content/class.tslib_content_file.php',
'tslib_content_form' => PATH_tslib . 'content/class.tslib_content_form.php',
'tslib_content_hmenu' => PATH_tslib . 'content/class.tslib_content_hmenu.php',
'tslib_content_hruler' => PATH_tslib . 'content/class.tslib_content_hruler.php',
'tslib_content_html' => PATH_tslib . 'content/class.tslib_content_html.php',
'tslib_content_image' => PATH_tslib . 'content/class.tslib_content_image.php',
'tslib_content_img_resource' => PATH_tslib . 'content/class.tslib_content_img_resource.php',
'tslib_content_imgtext' => PATH_tslib . 'content/class.tslib_content_imgtext.php',
'tslib_content_load_register' => PATH_tslib . 'content/class.tslib_content_load_register.php',
'tslib_content_media' => PATH_tslib . 'content/class.tslib_content_media.php',
'tslib_content_multimedia' => PATH_tslib . 'content/class.tslib_content_multimedia.php',
'tslib_content_otable' => PATH_tslib . 'content/class.tslib_content_otable.php',
'tslib_content_php_script_int' => PATH_tslib . 'content/class.tslib_content_php_script_int.php',
'tslib_content_php_script' => PATH_tslib . 'content/class.tslib_content_php_script.php',
'tslib_content_qtobject' => PATH_tslib . 'content/class.tslib_content_qtobject.php',
'tslib_content_records' => PATH_tslib . 'content/class.tslib_content_records.php',
'tslib_content_restore_register' => PATH_tslib . 'content/class.tslib_content_restore_register.php',
'tslib_content_searchresult' => PATH_tslib . 'content/class.tslib_content_searchresult.php',
'tslib_content_swfobject' => PATH_tslib . 'content/class.tslib_content_swfobject.php',
'tslib_content_template' => PATH_tslib . 'content/class.tslib_content_template.php',
'tslib_content_text' => PATH_tslib . 'content/class.tslib_content_text.php',
'tslib_content_user_int' => PATH_tslib . 'content/class.tslib_content_user_int.php',
'tslib_content_user' => PATH_tslib . 'content/class.tslib_content_user.php',
);
?>
typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
/**
* This class contains all main TypoScript features.
* This includes the rendering of TypoScript content objects (cObjects).
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&cHash=4ad9d7acb4
*/
class tslib_cObj {
var $align = Array ('center', 'right', 'left');
/**
* @var tslib_content_abstract
*/
protected $contentObject;
var $align = Array (
'center', 'right', 'left'
);
/**
* Holds ImageMagick parameters and extensions used for compression
*
* @see IMGTEXT()
......
* 2x = JPGs
*/
var $image_compression = Array(
10 => Array('params'=>'', 'ext'=>'gif'),
11 => Array('params'=>'-colors 128', 'ext'=>'gif'),
12 => Array('params'=>'-colors 64', 'ext'=>'gif'),
13 => Array('params'=>'-colors 32', 'ext'=>'gif'),
14 => Array('params'=>'-colors 16', 'ext'=>'gif'),
15 => Array('params'=>'-colors 8', 'ext'=>'gif'),
10 => Array (
'params' => '', 'ext' => 'gif'
), 11 => Array (
'params' => '-colors 128', 'ext' => 'gif'
), 12 => Array (
'params' => '-colors 64', 'ext' => 'gif'
), 13 => Array (
'params' => '-colors 32', 'ext' => 'gif'
), 14 => Array (
'params' => '-colors 16', 'ext' => 'gif'
), 15 => Array (
'params' => '-colors 8', 'ext' => 'gif'
),
30 => Array('params'=>'-colors 256', 'ext'=>'png'),
31 => Array('params'=>'-colors 128', 'ext'=>'png'),
32 => Array('params'=>'-colors 64', 'ext'=>'png'),
33 => Array('params'=>'-colors 32', 'ext'=>'png'),
34 => Array('params'=>'-colors 16', 'ext'=>'png'),
35 => Array('params'=>'-colors 8', 'ext'=>'png'),
39 => Array('params'=>'', 'ext'=>'png'),
30 => Array (
'params' => '-colors 256', 'ext' => 'png'
), 31 => Array (
'params' => '-colors 128', 'ext' => 'png'
), 32 => Array (
'params' => '-colors 64', 'ext' => 'png'
), 33 => Array (
'params' => '-colors 32', 'ext' => 'png'
), 34 => Array (
'params' => '-colors 16', 'ext' => 'png'
), 35 => Array (
'params' => '-colors 8', 'ext' => 'png'
), 39 => Array (
'params' => '', 'ext' => 'png'
),
20 => Array('params'=>'-quality 100', 'ext'=>'jpg'),
21 => Array('params'=>'-quality 90', 'ext'=>'jpg'),
22 => Array('params'=>'-quality 80', 'ext'=>'jpg'),
23 => Array('params'=>'-quality 70', 'ext'=>'jpg'),
24 => Array('params'=>'-quality 60', 'ext'=>'jpg'),
25 => Array('params'=>'-quality 50', 'ext'=>'jpg'),
26 => Array('params'=>'-quality 40', 'ext'=>'jpg'),
27 => Array('params'=>'-quality 30', 'ext'=>'jpg'),
28 => Array('params'=>'-quality 20', 'ext'=>'jpg')
20 => Array (
'params' => '-quality 100', 'ext' => 'jpg'
), 21 => Array (
'params' => '-quality 90', 'ext' => 'jpg'
), 22 => Array (
'params' => '-quality 80', 'ext' => 'jpg'
), 23 => Array (
'params' => '-quality 70', 'ext' => 'jpg'
), 24 => Array (
'params' => '-quality 60', 'ext' => 'jpg'
), 25 => Array (
'params' => '-quality 50', 'ext' => 'jpg'
), 26 => Array (
'params' => '-quality 40', 'ext' => 'jpg'
), 27 => Array (
'params' => '-quality 30', 'ext' => 'jpg'
), 28 => Array (
'params' => '-quality 20', 'ext' => 'jpg'
)
);
/**
......
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.
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.
// internal
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)
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.
......
protected $stdWrapHookObjects = array(); // Containing hook objects for stdWrap
protected $getImgResourceHookObjects; // Containing hook objects for getImgResource
protected $contentObjects = array ();
/**
* Set to true by doConvertToUserIntObject() if USER object wants to become USER_INT
*/
protected $doConvertToUserIntObject = false;
public $doConvertToUserIntObject = false;
/**
* Indicates current object type. Can hold one of OBJECTTYPE_ constants or false.
......
* @access private
*/
function setParent($data,$currentRecord) {
$this->parentRecord=array('data'=>$data, 'currentRecord'=>$currentRecord);
$this->parentRecord = array (
'data' => $data, 'currentRecord' => $currentRecord
);
}
/***********************************************
*
* CONTENT_OBJ:
......
$GLOBALS['TSFE']->cObjectDepthCounter--;
if ($GLOBALS['TSFE']->cObjectDepthCounter>0) {
$name = trim($name);
if ($GLOBALS['TT']->LR) $GLOBALS['TT']->push($TSkey, $name);
if ($GLOBALS['TT']->LR)
$GLOBALS['TT']->push($TSkey, $name);
// Checking if the COBJ is a reference to another object. (eg. name of 'blabla.blabla = < styles.something')
if (substr($name,0,1)=='<') {
......
if (!$hooked && isset($GLOBALS['OBTS']['tso_list'][$name]) && t3lib_extMgm::isLoaded('obts')) {
$content.= obts_dtutil::renderDatatypeContent($name, $GLOBALS['OBTS']['tso_list'][$name], $conf, $this);
} elseif (!$hooked) {
// Traditional Content Object branching:
switch($name) {
case 'COBJ_ARRAY':
case 'COA':
$content.=$this->COBJ_ARRAY($conf);
break;
case 'COA_INT':
$content.=$this->COBJ_ARRAY($conf,'INT');
break;
case 'HTML':
$content.=$this->HTML($conf);
break;
case 'TEXT':
$content.=$this->TEXT($conf);
break;
case 'CLEARGIF':
$content.=$this->CLEARGIF($conf);
break;
case 'FILE':
$content.=$this->FILE($conf);
break;
case 'IMAGE':
$content.=$this->IMAGE($conf);
break;
case 'IMG_RESOURCE':
$content.=$this->IMG_RESOURCE($conf);
break;
case 'IMGTEXT':
$content.=$this->IMGTEXT($conf);
break;
case 'CONTENT':
$content.=$this->CONTENT($conf);
break;
case 'RECORDS':
$content.=$this->RECORDS($conf);
break;
case 'HMENU':
$content.=$this->HMENU($conf);
break;
case 'CTABLE':
$content.=$this->CTABLE($conf);
break;
case 'OTABLE':
$content.=$this->OTABLE($conf);
break;
case 'COLUMNS':
$content.=$this->COLUMNS($conf);
break;
case 'HRULER':
$content.=$this->HRULER($conf);
break;
case 'CASE':
$content.=$this->CASEFUNC($conf);
break;
case 'LOAD_REGISTER':
case 'RESTORE_REGISTER':
$this->LOAD_REGISTER($conf,$name);
break;
case 'FORM':
$content.=$this->FORM($conf);
break;
case 'SEARCHRESULT':
$content.=$this->SEARCHRESULT($conf);
break;
case 'PHP_SCRIPT':
$content.=$this->PHP_SCRIPT($conf);
break;
case 'PHP_SCRIPT_EXT':
$content.=$this->PHP_SCRIPT($conf,'EXT');
break;
case 'PHP_SCRIPT_INT':
$content.=$this->PHP_SCRIPT($conf,'INT');
break;
case 'USER':
$content.=$this->USER($conf);
break;
case 'USER_INT':
$content.=$this->USER($conf,'INT');
break;
case 'TEMPLATE':
$content.=$this->TEMPLATE($conf);
break;
case 'EDITPANEL':
if ($GLOBALS['TSFE']->beUserLogin) {$content.=$this->editPanel($content, $conf);}
break;
case 'MULTIMEDIA':
$content.=$this->MULTIMEDIA($conf);
break;
case 'MEDIA':
$content.=$this->MEDIA($conf);
break;
case 'SWFOBJECT':
$content.=$this->SWFOBJECT($conf);
break;
case 'QTOBJECT':
$content.=$this->QTOBJECT($conf);
break;
default:
// call hook functions for extra processing
$contentObject = $this->getContentObject($name);
if ($contentObject) {
$content .= $contentObject->render($conf);
} else {
if($name && is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'])) {
foreach($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'] as $classData) {
$hookObject = t3lib_div::getUserObj($classData);
......
/* @var $hookObject tslib_content_cObjGetSingleHook */
$content .= $hookObject->getSingleContentObject($name, (array) $conf, $TSkey, $this);
}
} else {
// log error in AdminPanel
$warning = sprintf('Content Object "%s" does not exist', $name);
$GLOBALS['TT']->setTSlogMessage($warning, 2);
}
break;
}
}
}
if ($GLOBALS['TT']->LR) $GLOBALS['TT']->pull($content);
if ($GLOBALS['TT']->LR)
$GLOBALS['TT']->pull($content);
}
// Increasing on exit...
$GLOBALS['TSFE']->cObjectDepthCounter++;
return $content;
}
/**
* Returns a new content object of type $name.
*
* @param string $name
* @return tslib_content_abstract
*/
public function getContentObject($name) {
if ($name === 'COBJ_ARRAY') {
$name = 'COA';
}
$name = strtolower($name);
if (!array_key_exists($name, $this->contentObjects)) {
try {
$this->contentObjects[$name] = t3lib_div::makeInstance('tslib_content_' . $name, $this);
} catch (ReflectionException $e) {
$this->contentObjects[$name] = NULL;
}
}
return $this->contentObjects[$name];
}
/********************************************
*
* Functions rendering content objects (cObjects)
......
* @return string Output
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=349&cHash=d3fd0c70b4
*/
function HTML($conf) {
return $this->stdWrap($conf['value'],$conf['value.']);
public function HTML($conf) {
return $this->getContentObject('HTML')->render($conf);
}
/**
......
* @return string Output
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=350&cHash=b49de28f83
*/
function TEXT($conf) {
return $this->stdWrap($conf['value'],$conf);
public function TEXT($conf) {
return $this->getContentObject('TEXT')->render($conf);
}
/**
......
* @return string Output
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=355&cHash=70c0f19915
*/
function CLEARGIF($conf) {
$w = $this->stdWrap($conf['width'],$conf['width.']);
$h = $this->stdWrap($conf['height'],$conf['height.']);
$w = $w ? $w : 1;
$h = $h ? $h : 1;
$wrap = $conf['wrap'] ? $conf['wrap'] : '|<br />';
$theValue = $this->wrap('<img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$w.'" height="'.$h.'"'.$this->getBorderAttr(' border="0"').' alt="" title="" />', $wrap);
return $this->stdWrap($theValue,$conf['stdWrap.']);
public function CLEARGIF($conf) {
return $this->getContentObject('CLEARGIF')->render($conf);
}
/**
......
* @return string Output
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=351&cHash=a09db0329c
*/
function COBJ_ARRAY($conf,$ext='') {
if (is_array($conf)) {
$content = '';
switch($ext) {
case 'INT':
$substKey = $ext . '_SCRIPT.' . $GLOBALS['TSFE']->uniqueHash();
$content .= '<!--'.$substKey.'-->';
$GLOBALS['TSFE']->config[$ext . 'incScript'][$substKey] = array (
'file' => $conf['includeLibs'],
'conf' => $conf,
'cObj' => serialize($this),
'type' => 'COA'
);
break;
default:
if ($this->checkIf($conf['if.'])) {
$this->includeLibs($conf);
$content = $this->cObjGet($conf);
if ($conf['wrap']) {
$content = $this->wrap($content, $conf['wrap']);
}
if ($conf['stdWrap.']) {
$content = $this->stdWrap($content, $conf['stdWrap.']);
}
}
break;
}
return $content;
public function COBJ_ARRAY($conf, $ext = '') {
if ($ext === 'INT') {
return $this->getContentObject('COA_INT')->render($conf);
} else {
$GLOBALS['TT']->setTSlogMessage('No elements in this content object array (COBJ_ARRAY, COA, COA_INT).', 2);
return $this->getContentObject('COA')->render($conf);
}
}
......
* @return string Output
* @link http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/8/22/
*/
function USER($conf, $ext = '') {
$content = '';
switch ($ext) {
case 'INT':
$this->userObjectType = self::OBJECTTYPE_USER_INT;
$substKey = $ext . '_SCRIPT.' . $GLOBALS['TSFE']->uniqueHash();
$content.='<!--' . $substKey . '-->';
$GLOBALS['TSFE']->config[$ext . 'incScript'][$substKey] = array(
'file' => $conf['includeLibs'],
'conf' => $conf,
'cObj' => serialize($this),
'type' => 'FUNC'
);
break;
default:
if ($this->userObjectType === false) {
// Come here only if we are not called from $TSFE->INTincScript_process()!
$this->userObjectType = self::OBJECTTYPE_USER;
}
$this->includeLibs($conf);
$tempContent = $this->callUserFunction($conf['userFunc'], $conf, '');
if ($this->doConvertToUserIntObject) {
$this->doConvertToUserIntObject = false;
$content = $this->USER($conf, 'INT');
} else {
$content .= $tempContent;
}
break;
public function USER($conf, $ext = '') {
if ($ext === 'INT') {
return $this->getContentObject('USER_INT')->render($conf);
} else {
return $this->getContentObject('USER')->render($conf);
}
$this->userObjectType = false;
return $content;
}
/**
......
}
/**
* sets the user object type
*
* @param mixed $userObjectType
* @return void
*/
public function setUserObjectType($userObjectType) {
$this->userObjectType = $userObjectType;
}
/**
* Requests the current USER object to be converted to USER_INT.
*
* @return void
*/
public function convertToUserIntObject() {
if ($this->userObjectType !== self::OBJECTTYPE_USER) {
$GLOBALS['TT']->setTSlogMessage('tslib_cObj::convertToUserIntObject() ' .
'is called in the wrong context or for the wrong object type', 2);
}
else {
$GLOBALS['TT']->setTSlogMessage('tslib_cObj::convertToUserIntObject() ' . 'is called in the wrong context or for the wrong object type', 2);
} else {
$this->doConvertToUserIntObject = true;
}
}
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=352&cHash=379c60f8bc
*/
function FILE($conf) {
$theValue = $this->fileResource($this->stdWrap($conf['file'],$conf['file.']), trim($this->getAltParam($conf, false)));
if ($conf['linkWrap']) {
$theValue = $this->linkWrap($theValue,$conf['linkWrap']);
return $this->getContentObject('FILE')->render($conf);
}
return $this->wrap($theValue,$conf['wrap']);
}
/**
* Rendering the cObject, IMAGE
......
* @see cImage()
*/
function IMAGE($conf) {
$content='';
if ($this->checkIf($conf['if.'])) {
$theValue = $this->cImage($conf['file'],$conf);
if ($conf['stdWrap.']) {
$theValue = $this->stdWrap($theValue,$conf['stdWrap.']);
return $this->getContentObject('IMAGE')->render($conf);
}
return $theValue;
}
}
/**
* Rendering the cObject, IMG_RESOURCE
......
* @see getImgResource()
*/
function IMG_RESOURCE($conf) {
$GLOBALS['TSFE']->lastImgResourceInfo = $this->getImgResource($conf['file'],$conf['file.']);
return $this->stdWrap($GLOBALS['TSFE']->lastImgResourceInfo[3],$conf['stdWrap.']);
return $this->getContentObject('IMG_RESOURCE')->render($conf);
}
/**
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=363&cHash=cf2969bce1
*/
function IMGTEXT($conf) {
$content='';
if (is_array($conf['text.'])) {
$content.= $this->stdWrap($this->cObjGet($conf['text.'],'text.'),$conf['text.']); // this gets the surrounding content
return $this->getContentObject('IMGTEXT')->render($conf);
}
$imgList=trim($this->stdWrap($conf['imgList'],$conf['imgList.'])); // gets images
if ($imgList) {
$imgs = t3lib_div::trimExplode(',',$imgList);
$imgStart = intval($this->stdWrap($conf['imgStart'],$conf['imgStart.']));
$imgCount= count($imgs)-$imgStart;
$imgMax = intval($this->stdWrap($conf['imgMax'],$conf['imgMax.']));
if ($imgMax) {
$imgCount = t3lib_div::intInRange($imgCount,0,$imgMax); // reduces the number of images.
}
$imgPath = $this->stdWrap($conf['imgPath'],$conf['imgPath.']);
// initialisation
$caption='';
$captionArray = array();
if (!$conf['captionSplit'] && !$conf['imageTextSplit'] && is_array($conf['caption.'])) {
$caption = $this->stdWrap($this->cObjGet($conf['caption.'], 'caption.'),$conf['caption.']); // global caption, no splitting
}
if ($conf['captionSplit'] && $conf['captionSplit.']['cObject']) {
$legacyCaptionSplit = 1;
$capSplit = $this->stdWrap($conf['captionSplit.']['token'], $conf['captionSplit.']['token.']);
if (!$capSplit) {$capSplit=LF;}
$captionArray = explode($capSplit, $this->cObjGetSingle($conf['captionSplit.']['cObject'], $conf['captionSplit.']['cObject.'], 'captionSplit.cObject'));
foreach ($captionArray as $ca_key => $ca_val) {
$captionArray[$ca_key] = $this->stdWrap(trim($captionArray[$ca_key]), $conf['captionSplit.']['stdWrap.']);
}
}
$tablecode='';
$position=$this->stdWrap($conf['textPos'],$conf['textPos.']);
$tmppos = $position&7;
$contentPosition = $position&24;
$align = $this->align[$tmppos];
$cap = ($caption)?1:0;
$txtMarg = intval($this->stdWrap($conf['textMargin'],$conf['textMargin.']));
if (!$conf['textMargin_outOfText'] && $contentPosition<16) {
$txtMarg=0;
}
$cols = intval($this->stdWrap($conf['cols'],$conf['cols.']));
$rows = intval($this->stdWrap($conf['rows'],$conf['rows.']));
$colspacing = intval($this->stdWrap($conf['colSpace'],$conf['colSpace.']));
$rowspacing = intval($this->stdWrap($conf['rowSpace'],$conf['rowSpace.']));
$border = intval($this->stdWrap($conf['border'],$conf['border.'])) ? 1:0;
$borderColor = $this->stdWrap($conf['borderCol'],$conf['borderCol.']);
$borderThickness = intval($this->stdWrap($conf['borderThick'],$conf['borderThick.']));
$borderColor=$borderColor?$borderColor:'black';
$borderThickness=$borderThickness?$borderThickness:1;
$caption_align = $this->stdWrap($conf['captionAlign'],$conf['captionAlign.']);
if (!$caption_align) {
$caption_align = $align;
}
// generate cols
$colCount = ($cols > 1) ? $cols : 1;
if ($colCount > $imgCount) {$colCount = $imgCount;}
$rowCount = ($colCount > 1) ? ceil($imgCount / $colCount) : $imgCount;
// generate rows
if ($rows>1) {
$rowCount = $rows;
if ($rowCount > $imgCount) {$rowCount = $imgCount;}
$colCount = ($rowCount>1) ? ceil($imgCount / $rowCount) : $imgCount;
}
// max Width
$colRelations = trim($this->stdWrap($conf['colRelations'],$conf['colRelations.']));
$maxW = intval($this->stdWrap($conf['maxW'],$conf['maxW.']));
$maxWInText = intval($this->stdWrap($conf['maxWInText'],$conf['maxWInText.']));
if (!$maxWInText) { // If maxWInText is not set, it's calculated to the 50 % of the max...
$maxWInText = round($maxW/2);
}
if ($maxWInText && $contentPosition>=16) { // inText
$maxW = $maxWInText;
}
if ($maxW && $colCount > 0) { // If there is a max width and if colCount is greater than column
/* debug($border*$borderThickness*2);
debug($maxW);
debug($colspacing);
debug(($maxW-$colspacing*($colCount-1)-$colCount*$border*$borderThickness*2));
*/
$maxW = ceil(($maxW-$colspacing*($colCount-1)-$colCount*$border*$borderThickness*2)/$colCount);
}
// create the relation between rows
$colMaxW = Array();
if ($colRelations) {
$rel_parts = explode(':',$colRelations);
$rel_total = 0;
for ($a=0;$a<$colCount;$a++) {
$rel_parts[$a] = intval($rel_parts[$a]);
$rel_total+= $rel_parts[$a];
}
if ($rel_total) {
for ($a=0;$a<$colCount;$a++) {
$colMaxW[$a] = round(($maxW*$colCount)/$rel_total*$rel_parts[$a]);
}
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.
$colMaxW = Array();
}
}
}
$image_compression = intval($this->stdWrap($conf['image_compression'],$conf['image_compression.']));
$image_effects = intval($this->stdWrap($conf['image_effects'],$conf['image_effects.']));
$image_frames = intval($this->stdWrap($conf['image_frames.']['key'],$conf['image_frames.']['key.']));
// fetches pictures
$splitArr=array();
$splitArr['imgObjNum']=$conf['imgObjNum'];
$splitArr = $GLOBALS['TSFE']->tmpl->splitConfArray($splitArr,$imgCount);
// EqualHeight
$equalHeight = intval($this->stdWrap($conf['equalH'],$conf['equalH.']));
if ($equalHeight) { // Initiate gifbuilder object in order to get dimensions AND calculate the imageWidth's
$gifCreator = t3lib_div::makeInstance('tslib_gifbuilder');
$gifCreator->init();
$relations = Array();
$relations_cols = Array();
$totalMaxW = $maxW*$colCount;
for($a=0;$a<$imgCount;$a++) {
$imgKey = $a+$imgStart;
$imgInfo = $gifCreator->getImageDimensions($imgPath.$imgs[$imgKey]);
$relations[$a] = $imgInfo[1] / $equalHeight; // relationship between the original height and the wished height
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.
$relations_cols[floor($a/$colCount)] += $imgInfo[0]/$relations[$a]; // counts the total width of the row with the new height taken into consideration.
}
}
}
$imageRowsFinalWidths = Array(); // contains the width of every image row
$imageRowsMaxHeights = Array();
$imgsTag=array();
$origImages=array();
for($a=0;$a<$imgCount;$a++) {
$GLOBALS['TSFE']->register['IMAGE_NUM'] = $a;
$GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $a;
$imgKey = $a+$imgStart;
$totalImagePath = $imgPath.$imgs[$imgKey];
$this->data[$this->currentValKey] = $totalImagePath;
$imgObjNum = intval($splitArr[$a]['imgObjNum']);
$imgConf = $conf[$imgObjNum.'.'];
if ($equalHeight) {
$scale = 1;
if ($totalMaxW) {
$rowTotalMaxW = $relations_cols[floor($a/$colCount)];
if ($rowTotalMaxW > $totalMaxW) {
$scale = $rowTotalMaxW / $totalMaxW;
}
}
// transfer info to the imageObject. Please note, that
$imgConf['file.']['height'] = round($equalHeight/$scale);
unset($imgConf['file.']['width']);
unset($imgConf['file.']['maxW']);
unset($imgConf['file.']['maxH']);
unset($imgConf['file.']['minW']);
unset($imgConf['file.']['minH']);
unset($imgConf['file.']['width.']);
unset($imgConf['file.']['maxW.']);
unset($imgConf['file.']['maxH.']);
unset($imgConf['file.']['minW.']);
unset($imgConf['file.']['minH.']);
$maxW = 0; // setting this to zero, so that it doesn't disturb
}
if ($maxW) {
if (count($colMaxW)) {
$imgConf['file.']['maxW'] = $colMaxW[($a%$colCount)];
} else {
$imgConf['file.']['maxW'] = $maxW;
}
}
// Image Object supplied:
if (is_array($imgConf)) {
if ($this->image_effects[$image_effects]) {
$imgConf['file.']['params'].= ' '.$this->image_effects[$image_effects];
}
if ($image_frames) {
if (is_array($conf['image_frames.'][$image_frames.'.'])) {
$imgConf['file.']['m.'] = $conf['image_frames.'][$image_frames.'.'];
}
}
if ($image_compression && $imgConf['file']!='GIFBUILDER') {
if ($image_compression==1) {
$tempImport = $imgConf['file.']['import'];
$tempImport_dot = $imgConf['file.']['import.'];
unset($imgConf['file.']);
$imgConf['file.']['import'] = $tempImport;
$imgConf['file.']['import.'] = $tempImport_dot;
} elseif (isset($this->image_compression[$image_compression])) {
$imgConf['file.']['params'].= ' '.$this->image_compression[$image_compression]['params'];
$imgConf['file.']['ext'] = $this->image_compression[$image_compression]['ext'];
unset($imgConf['file.']['ext.']);
}
}
// "alt", "title" and "longdesc" attributes:
if (!strlen($imgConf['altText']) && !is_array($imgConf['altText.'])) {
$imgConf['altText'] = $conf['altText'];
$imgConf['altText.'] = $conf['altText.'];
}
if (!strlen($imgConf['titleText']) && !is_array($imgConf['titleText.'])) {
$imgConf['titleText'] = $conf['titleText'];
$imgConf['titleText.'] = $conf['titleText.'];
}
if (!strlen($imgConf['longdescURL']) && !is_array($imgConf['longdescURL.'])) {
$imgConf['longdescURL'] = $conf['longdescURL'];
$imgConf['longdescURL.'] = $conf['longdescURL.'];
}
} else {
$imgConf = array(
'altText' => $conf['altText'],
'titleText' => $conf['titleText'],
'longdescURL' => $conf['longdescURL'],
'file' => $totalImagePath
);
}
$imgsTag[$imgKey] = $this->IMAGE($imgConf);
// Store the original filepath
$origImages[$imgKey]=$GLOBALS['TSFE']->lastImageInfo;
$imageRowsFinalWidths[floor($a/$colCount)] += $GLOBALS['TSFE']->lastImageInfo[0];
if ($GLOBALS['TSFE']->lastImageInfo[1]>$imageRowsMaxHeights[floor($a/$colCount)]) {
$imageRowsMaxHeights[floor($a/$colCount)] = $GLOBALS['TSFE']->lastImageInfo[1];
}
}
// calculating the tableWidth:
// TableWidth problems: It creates problems if the pictures are NOT as wide as the tableWidth.
$tableWidth = max($imageRowsFinalWidths)+ $colspacing*($colCount-1) + $colCount*$border*$borderThickness*2;
// make table for pictures
$index=$imgStart;
$noRows = $this->stdWrap($conf['noRows'],$conf['noRows.']);
$noCols = $this->stdWrap($conf['noCols'],$conf['noCols.']);
if ($noRows) {$noCols=0;} // noRows overrides noCols. They cannot exist at the same time.
if ($equalHeight) {
$noCols=1;
$noRows=0;
}
$rowCount_temp=1;
$colCount_temp=$colCount;
if ($noRows) {
$rowCount_temp = $rowCount;
$rowCount=1;
}
if ($noCols) {
$colCount=1;
}
// col- and rowspans calculated
$colspan = (($colspacing) ? $colCount*2-1 : $colCount);
$rowspan = (($rowspacing) ? $rowCount*2-1 : $rowCount) + $cap;
// Edit icons:
$editIconsHTML = $conf['editIcons']&&$GLOBALS['TSFE']->beUserLogin ? $this->editIcons('',$conf['editIcons'],$conf['editIcons.']) : '';
// strech out table:
$tablecode='';
$flag=0;
if ($conf['noStretchAndMarginCells']!=1) {
$tablecode.='<tr>';
if ($txtMarg && $align=='right') { // If right aligned, the textborder is added on the right side
$tablecode.='<td rowspan="'.($rowspan+1).'" valign="top"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$txtMarg.'" height="1" alt="" title="" />'.($editIconsHTML?'<br />'.$editIconsHTML:'').'</td>';
$editIconsHTML='';
$flag=1;
}
$tablecode.='<td colspan="'.$colspan.'"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$tableWidth.'" height="1" alt="" /></td>';
if ($txtMarg && $align=='left') { // If left aligned, the textborder is added on the left side
$tablecode.='<td rowspan="'.($rowspan+1).'" valign="top"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$txtMarg.'" height="1" alt="" title="" />'.($editIconsHTML?'<br />'.$editIconsHTML:'').'</td>';
$editIconsHTML='';
$flag=1;
}
if ($flag) $tableWidth+=$txtMarg+1;
// $tableWidth=0;
$tablecode.='</tr>';
}
// draw table
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!
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.
$tablecode.='<tr><td colspan="'.$colspan.'"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="1" height="'.$rowspacing.'"'.$this->getBorderAttr(' border="0"').' alt="" title="" /></td></tr>';
}
$tablecode.='<tr>'; // starting row
for ($b=0; $b<$colCount_temp; $b++) { // Looping through the columns
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.
if (!$noCols) {
$tablecode.='<td><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$colspacing.'" height="1"'.$this->getBorderAttr(' border="0"').' alt="" title="" /></td>';
} else {
$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="" />';
$colSpacer='<td valign="top">'.$colSpacer.'</td>'; // added 160301, needed for the new "noCols"-table...
$tablecode.=$colSpacer;
}
}
if (!$noCols || ($noCols && !$b)) {
$tablecode.='<td valign="top">'; // starting the cell. If "noCols" this cell will hold all images in the row, otherwise only a single image.
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.
}
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.
$GLOBALS['TSFE']->register['IMAGE_NUM'] = $imgIndex; // register previous imgIndex
$imgIndex = $index+$a*$colCount_temp;
$GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $imgIndex;
if ($imgsTag[$imgIndex]) {
if ($rowspacing && $noRows && $a) { // Puts distance between the images IF "noRows" is set and this is the first iteration of the loop
$tablecode.= '<img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="1" height="'.$rowspacing.'" alt="" title="" /><br />';
}
if ($legacyCaptionSplit) {
$thisCaption = $captionArray[$imgIndex];
} else if ($conf['captionSplit'] || $conf['imageTextSplit']) {
$thisCaption = $this->stdWrap($this->cObjGet($conf['caption.'], 'caption.'), $conf['caption.']);
}
$imageHTML = $imgsTag[$imgIndex].'<br />';
$Talign = (!trim($thisCaption) && !$noRows) ? ' align="left"' : ''; // this is necessary if the tablerows are supposed to space properly together! "noRows" is excluded because else the images "layer" together.
if ($border) {$imageHTML='<table border="0" cellpadding="'.$borderThickness.'" cellspacing="0" bgcolor="'.$borderColor.'"'.$Talign.'><tr><td>'.$imageHTML.'</td></tr></table>';}
$imageHTML.=$editIconsHTML;
$editIconsHTML='';
$imageHTML.=$thisCaption; // Adds caption.
if ($noCols) {$imageHTML='<td valign="top">'.$imageHTML.'</td>';} // If noCols, put in table cell.
$tablecode.=$imageHTML;
}
}
$index++;
if (!$noCols || ($noCols && $b+1==$colCount_temp)) {
if ($noCols) {$tablecode.='</tr></table>';} // In case of "noCols" we must finish the table that surrounds the images in the row.
$tablecode.='</td>'; // Ending the cell. In case of "noCols" the cell holds all pictures!
}
}
$tablecode.='</tr>'; // ending row
}
if ($c) {
switch ($contentPosition) {
case '0': // above
case '8': // below
switch ($align) { // These settings are needed for Firefox
case 'center':
$table_align = 'margin-left: auto; margin-right: auto';
break;
case 'right':
$table_align = 'margin-left: auto; margin-right: 0px';
break;
default: // Most of all: left
$table_align = 'margin-left: 0px; margin-right: auto';
}
$table_align = 'style="'.$table_align.'"';
break;
case '16': // in text
$table_align = 'align="'.$align.'"';
break;
default:
$table_align = '';
}
// Table-tag is inserted
$tablecode = '<table'.($tableWidth?' width="'.$tableWidth.'"':'').' border="0" cellspacing="0" cellpadding="0" '.$table_align.' class="imgtext-table">'.$tablecode;
if ($editIconsHTML) { // IF this value is not long since reset.
$tablecode.='<tr><td colspan="'.$colspan.'">'.$editIconsHTML.'</td></tr>';
$editIconsHTML='';
}
if ($cap) {
$tablecode.='<tr><td colspan="'.$colspan.'" align="'.$caption_align.'">'.$caption.'</td></tr>';
}
$tablecode.='</table>';
if ($conf['tableStdWrap.']) {$tablecode=$this->stdWrap($tablecode,$conf['tableStdWrap.']);}
}
$spaceBelowAbove = intval($this->stdWrap($conf['spaceBelowAbove'],$conf['spaceBelowAbove.']));
switch ($contentPosition) {
case '0': // above
$output= '<div style="text-align:'.$align.';">'.$tablecode.'</div>'.$this->wrapSpace($content, $spaceBelowAbove.'|0');
break;
case '8': // below
$output= $this->wrapSpace($content, '0|'.$spaceBelowAbove).'<div style="text-align:'.$align.';">'.$tablecode.'</div>';
break;
case '16': // in text
$output= $tablecode.$content;
break;
case '24': // in text, no wrap
$theResult = '';
$theResult.= '<table border="0" cellspacing="0" cellpadding="0" class="imgtext-nowrap"><tr>';
if ($align=='right') {
$theResult.= '<td valign="top">'.$content.'</td><td valign="top">'.$tablecode.'</td>';
} else {
$theResult.= '<td valign="top">'.$tablecode.'</td><td valign="top">'.$content.'</td>';
}
$theResult.= '</tr></table>';
$output= $theResult;
break;
}
} else {
$output= $content;
}
if ($conf['stdWrap.']) {
$output = $this->stdWrap($output, $conf['stdWrap.']);
}
return $output;
}
/**
* Rendering the cObject, CONTENT
*
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=356&cHash=9f3b5c6ba2
*/
function CONTENT($conf) {
$theValue='';
$originalRec = $GLOBALS['TSFE']->currentRecord;
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!!
$GLOBALS['TSFE']->recordRegister[$originalRec]++;
return $this->getContentObject('CONTENT')->render($conf);
}
$conf['table'] = trim($this->stdWrap($conf['table'], $conf['table.']));
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_' || substr($conf['table'],0,7)=='static_') {
$renderObjName = $conf['renderObj'] ? $conf['renderObj'] : '<'.$conf['table'];
$renderObjKey = $conf['renderObj'] ? 'renderObj' : '';
$renderObjConf = $conf['renderObj.'];
$slide = intval($conf['slide'])?intval($conf['slide']):0;
$slideCollect = intval($conf['slide.']['collect'])?intval($conf['slide.']['collect']):0;
$slideCollectReverse = intval($conf['slide.']['collectReverse'])?true:false;
$slideCollectFuzzy = $slideCollect?(intval($conf['slide.']['collectFuzzy'])?true:false):true;
$again = false;
do {
$res = $this->exec_getQuery($conf['table'],$conf['select.']);
if ($error = $GLOBALS['TYPO3_DB']->sql_error()) {
$GLOBALS['TT']->setTSlogMessage($error,3);
} else {
$this->currentRecordTotal = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
$GLOBALS['TT']->setTSlogMessage('NUMROWS: '.$GLOBALS['TYPO3_DB']->sql_num_rows($res));
$cObj =t3lib_div::makeInstance('tslib_cObj');
$cObj->setParent($this->data,$this->currentRecord);
$this->currentRecordNumber=0;
$cobjValue = '';
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
// Versioning preview:
$GLOBALS['TSFE']->sys_page->versionOL($conf['table'],$row,TRUE);
// Language overlay:
if (is_array($row) && $GLOBALS['TSFE']->sys_language_contentOL) {
$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($conf['table'],$row,$GLOBALS['TSFE']->sys_language_content,$GLOBALS['TSFE']->sys_language_contentOL);
}
if (is_array($row)) { // Might be unset in the sys_language_contentOL
if (!$GLOBALS['TSFE']->recordRegister[$conf['table'].':'.$row['uid']]) {
$this->currentRecordNumber++;
$cObj->parentRecordNumber = $this->currentRecordNumber;
$GLOBALS['TSFE']->currentRecord = $conf['table'].':'.$row['uid'];
$this->lastChanged($row['tstamp']);
$cObj->start($row,$conf['table']);
$tmpValue = $cObj->cObjGetSingle($renderObjName, $renderObjConf, $renderObjKey);
$cobjValue .= $tmpValue;
}
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
}
if ($slideCollectReverse) {
$theValue = $cobjValue.$theValue;
} else {
$theValue .= $cobjValue;
}
if ($slideCollect>0) {
$slideCollect--;
}
if ($slide) {
if ($slide>0) {
$slide--;
}
$conf['select.']['pidInList'] = $this->getSlidePids($conf['select.']['pidInList'], $conf['select.']['pidInList.']);
$again = strlen($conf['select.']['pidInList'])?true:false;
}
} while ($again&&(($slide&&!strlen($tmpValue)&&$slideCollectFuzzy)||($slide&&$slideCollect)));
}
$theValue = $this->wrap($theValue,$conf['wrap']);
if ($conf['stdWrap.']) $theValue = $this->stdWrap($theValue,$conf['stdWrap.']);
$GLOBALS['TSFE']->currentRecord = $originalRec; // Restore
return $theValue;
}
/**
* Rendering the cObject, RECORDS
*
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=357&cHash=303e959472
*/
function RECORDS($conf) {
$theValue='';
$originalRec = $GLOBALS['TSFE']->currentRecord;
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!!
$GLOBALS['TSFE']->recordRegister[$originalRec]++;
return $this->getContentObject('RECORDS')->render($conf);
}
$conf['source'] = $this->stdWrap($conf['source'],$conf['source.']);
if ($conf['tables'] && $conf['source']) {
$allowedTables = $conf['tables'];
if (is_array($conf['conf.'])) {
foreach ($conf['conf.'] as $k => $v) {
if (substr($k,-1)!='.') $allowedTables.=','.$k;
}
}
$loadDB = t3lib_div::makeInstance('FE_loadDBGroup');
$loadDB->start($conf['source'], $allowedTables);
foreach ($loadDB->tableArray as $table => $v) {
if (is_array($GLOBALS['TCA'][$table])) {
$loadDB->additionalWhere[$table]=$this->enableFields($table);
}
}
$loadDB->getFromDB();
reset($loadDB->itemArray);
$data = $loadDB->results;
$cObj =t3lib_div::makeInstance('tslib_cObj');
$cObj->setParent($this->data,$this->currentRecord);
$this->currentRecordNumber=0;
$this->currentRecordTotal = count($loadDB->itemArray);
foreach ($loadDB->itemArray as $val) {
$row = $data[$val['table']][$val['id']];
// Versioning preview:
$GLOBALS['TSFE']->sys_page->versionOL($val['table'],$row);
// Language overlay:
if (is_array($row) && $GLOBALS['TSFE']->sys_language_contentOL) {
$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($val['table'],$row,$GLOBALS['TSFE']->sys_language_content,$GLOBALS['TSFE']->sys_language_contentOL);
}
if (is_array($row)) { // Might be unset in the content overlay things...
if (!$conf['dontCheckPid']) {
$row = $this->checkPid($row['pid']) ? $row : '';
}
if ($row && !$GLOBALS['TSFE']->recordRegister[$val['table'].':'.$val['id']]) {
$renderObjName = $conf['conf.'][$val['table']] ? $conf['conf.'][$val['table']] : '<'.$val['table'];
$renderObjKey = $conf['conf.'][$val['table']] ? 'conf.'.$val['table'] : '';
$renderObjConf = $conf['conf.'][$val['table'].'.'];
$this->currentRecordNumber++;
$cObj->parentRecordNumber=$this->currentRecordNumber;
$GLOBALS['TSFE']->currentRecord = $val['table'].':'.$val['id'];
$this->lastChanged($row['tstamp']);
$cObj->start($row,$val['table']);
$tmpValue = $cObj->cObjGetSingle($renderObjName, $renderObjConf, $renderObjKey);
$theValue .= $tmpValue;
}# else debug($GLOBALS['TSFE']->recordRegister,'RECORDS');
}
}
}
if ($conf['wrap']) $theValue = $this->wrap($theValue,$conf['wrap']);
if ($conf['stdWrap.']) $theValue = $this->stdWrap($theValue,$conf['stdWrap.']);
$GLOBALS['TSFE']->currentRecord = $originalRec; // Restore
return $theValue;
}
/**
* Rendering the cObject, HMENU
*
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=358&cHash=5400c1c06a
*/
function HMENU($conf) {
$content='';
if ($this->checkIf($conf['if.'])) {
$cls = strtolower($conf[1]);
if (t3lib_div::inList($GLOBALS['TSFE']->tmpl->menuclasses,$cls)) {
if ($conf['special.']['value.']) {
$conf['special.']['value'] = $this->stdWrap($conf['special.']['value'], $conf['special.']['value.']);
return $this->getContentObject('HMENU')->render($conf);
}
$GLOBALS['TSFE']->register['count_HMENU']++;
$GLOBALS['TSFE']->register['count_HMENU_MENUOBJ']=0;
$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array();
$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']=array();
$menu = t3lib_div::makeInstance('tslib_'.$cls);
$menu->parent_cObj = $this;
$menu->start($GLOBALS['TSFE']->tmpl, $GLOBALS['TSFE']->sys_page, '', $conf, 1);
$menu->makeMenu();
$content.=$menu->writeMenu();
}
if ($conf['wrap']) $content=$this->wrap($content, $conf['wrap']);
if ($conf['stdWrap.']) $content = $this->stdWrap($content, $conf['stdWrap.']);
}
return $content;
}
/**
* Rendering the cObject, CTABLE
*
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=359&cHash=2e0065b4e7
*/
function CTABLE ($conf) {
$controlTable = t3lib_div::makeInstance('tslib_controlTable');
if ($conf['tableParams']) {
$controlTable->tableParams = $conf['tableParams'];
return $this->getContentObject('CTABLE')->render($conf);
}
// loads the pagecontent
$controlTable->contentW = $conf['cWidth'];
// loads the menues if any
if (is_array($conf['c.'])) {
$controlTable->content = $this->cObjGet($conf['c.'],'c.');
$controlTable->contentTDparams = isset($conf['c.']['TDParams']) ? $conf['c.']['TDParams'] : 'valign="top"';
}
if (is_array($conf['lm.'])) {
$controlTable->lm = $this->cObjGet($conf['lm.'],'lm.');
$controlTable->lmTDparams = isset($conf['lm.']['TDParams']) ? $conf['lm.']['TDParams'] : 'valign="top"';
}
if (is_array($conf['tm.'])) {
$controlTable->tm = $this->cObjGet($conf['tm.'],'tm.');
$controlTable->tmTDparams = isset($conf['tm.']['TDParams']) ? $conf['tm.']['TDParams'] : 'valign="top"';
}
if (is_array($conf['rm.'])) {
$controlTable->rm = $this->cObjGet($conf['rm.'],'rm.');
$controlTable->rmTDparams = isset($conf['rm.']['TDParams']) ? $conf['rm.']['TDParams'] : 'valign="top"';
}
if (is_array($conf['bm.'])) {
$controlTable->bm = $this->cObjGet($conf['bm.'],'bm.');
$controlTable->bmTDparams = isset($conf['bm.']['TDParams']) ? $conf['bm.']['TDParams'] : 'valign="top"';
}
return $controlTable->start($conf['offset'],$conf['cMargins']);
}
/**
* Rendering the cObject, OTABLE
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=360&cHash=02c9552d38
*/
function OTABLE ($conf) {
$controlTable = t3lib_div::makeInstance('tslib_tableOffset');
if ($conf['tableParams']) {
$controlTable->tableParams = $conf['tableParams'];
return $this->getContentObject('OTABLE')->render($conf);
}
return $controlTable->start($this->cObjGet($conf),$conf['offset']);
}
/**
* Rendering the cObject, COLUMNS
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=361&cHash=7e4e228cad
*/
function COLUMNS ($conf) {
$content='';
if (is_array($conf) && $this->checkIf($conf['if.'])) {
$tdRowCount=0;
$tableParams = $conf['tableParams'] ? ' '.$conf['tableParams'] : ' border="0" cellspacing="0" cellpadding="0"';
$TDparams = $conf['TDparams'] ? ' '.$conf['TDparams']:' valign="top"';
$rows = t3lib_div::intInRange($conf['rows'],2,20);
$totalWidth = intval($conf['totalWidth']);
$columnWidth=0;
$totalGapWidth=0;
$gapData = Array(
'gapWidth' => $this->stdWrap($conf['gapWidth'],$conf['gapWidth.']),
'gapBgCol' => $this->stdWrap($conf['gapBgCol'],$conf['gapBgCol.']),
'gapLineThickness' => $this->stdWrap($conf['gapLineThickness'],$conf['gapLineThickness.']),
'gapLineCol' => $this->stdWrap($conf['gapLineCol'],$conf['gapLineCol.'])
);
$gapData = $GLOBALS['TSFE']->tmpl->splitConfArray($gapData,$rows-1);
foreach ($gapData as $val) {
$totalGapWidth+=intval($val['gapWidth']);
return $this->getContentObject('COLUMNS')->render($conf);
}
if ($totalWidth) {
$columnWidth = ceil(($totalWidth-$totalGapWidth)/$rows);
$TDparams.=' width="'.$columnWidth.'"';
$tableParams.=' width="'.$totalWidth.'"';
} else {
$TDparams.=' width="'.floor(100/$rows).'%"';
$tableParams.=' width="100%"';
}
for ($a=1;$a<=$rows;$a++) {
$tdRowCount++;
$content.='<td'.$TDparams.'>';
$content.=$this->cObjGetSingle($conf[$a],$conf[$a.'.'], $a);
$content.='</td>';
if ($a < $rows) {
$gapConf = $gapData[($a-1)];
$gapWidth = intval($gapConf['gapWidth']);
if ($gapWidth) {
$tdPar = $gapConf['gapBgCol'] ? ' bgcolor="'.$gapConf['gapBgCol'].'"' : '';
$gapLine = intval($gapConf['gapLineThickness']);
if ($gapLine) {
$gapSurround = t3lib_div::intInRange(($gapWidth-$gapLine)/2, 1, 1000);
// right gap
$content.='<td'.$tdPar.'><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$gapSurround.'" height="1" alt="" title="" /></td>';
$tdRowCount++;
// line:
$GtdPar = $gapConf['gapLineCol'] ? ' bgcolor="'.$gapConf['gapLineCol'].'"' : ' bgcolor="black"';
$content.='<td'.$GtdPar.'><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$gapLine.'" height="1" alt="" title="" /></td>';
$tdRowCount++;
// left gap
$content.='<td'.$tdPar.'><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$gapSurround.'" height="1" alt="" title="" /></td>';
$tdRowCount++;
} else {
$content.='<td'.$tdPar.'><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$gapWidth.'" height="1" alt="" title="" /></td>';
$tdRowCount++;
}
}
}
}
$content = '<tr>'.$content.'</tr>';
$content = '<table'.$tableParams.'>'.$content.'</table>';
$content.= $this->cObjGetSingle($conf['after'],$conf['after.'], 'after');
if ($conf['stdWrap.']) {
$content = $this->stdWrap($content,$conf['stdWrap.']);
}
}
return $content;
}
/**
* Rendering the cObject, HRULER
*
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=362&cHash=2a462aa084
*/
function HRULER ($conf) {
$lineThickness = t3lib_div::intInRange($this->stdWrap($conf['lineThickness'],$conf['lineThickness.']),1,50);
$lineColor = $conf['lineColor'] ? $conf['lineColor'] : 'black';
$spaceBefore = intval($conf['spaceLeft']);
$spaceAfter = intval($conf['spaceRight']);
$tableWidth = $conf['tableWidth'] ? $conf['tableWidth'] : '99%';
$content='';
$content.='<table border="0" cellspacing="0" cellpadding="0" width="'.htmlspecialchars($tableWidth).'" summary=""><tr>';
if ($spaceBefore) {$content.='<td width="1"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$spaceBefore.'" height="1" alt="" title="" /></td>'; }
$content.='<td bgcolor="'.$lineColor.'"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="1" height="'.$lineThickness.'" alt="" title="" /></td>';
if ($spaceAfter) {$content.='<td width="1"><img src="'.$GLOBALS['TSFE']->absRefPrefix.'clear.gif" width="'.$spaceAfter.'" height="1" alt="" title="" /></td>'; }
$content.='</tr></table>';
$content = $this->stdWrap($content, $conf['stdWrap.']);
return $content;
return $this->getContentObject('HRULER')->render($conf);
}
/**
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=364&cHash=cffedd09e3
*/
function CASEFUNC ($conf){
$content='';
if ($this->checkIf($conf['if.'])) {
if ($conf['setCurrent'] || $conf['setCurrent.']){$this->data[$this->currentValKey] = $this->stdWrap($conf['setCurrent'], $conf['setCurrent.']);}
$key = $this->stdWrap($conf['key'],$conf['key.']);
$key = strlen($conf[$key]) ? $key : 'default';
$name = $conf[$key];
$theValue = $this->cObjGetSingle($name,$conf[$key.'.'], $key);
if ($conf['stdWrap.']) {
$theValue = $this->stdWrap($theValue,$conf['stdWrap.']);
return $this->getContentObject('CASE')->render($conf);
}
return $theValue;
}
}
/**
* Rendering the cObject, LOAD_REGISTER and RESTORE_REGISTER
......
*/
function LOAD_REGISTER($conf,$name) {
if ($name=='RESTORE_REGISTER') {
$GLOBALS['TSFE']->register = array_pop($GLOBALS['TSFE']->registerStack);
return $this->getContentObject('RESTORE_REGISTER')->render($conf);
} else {
array_push($GLOBALS['TSFE']->registerStack,$GLOBALS['TSFE']->register);
if (is_array($conf)) {
foreach ($conf as $theKey => $theValue) {
if (!strstr($theKey,'.') || !isset($conf[substr($theKey,0,-1)])) { // Only if 1) the property is set but not the value itself, 2) the value and/or any property
if (strstr($theKey,'.')) {
$theKey = substr($theKey,0,-1);
return $this->getContentObject('LOAD_REGISTER')->render($conf);
}
$GLOBALS['TSFE']->register[$theKey] = $this->stdWrap($conf[$theKey],$conf[$theKey.'.']);
}
}
}
}
return '';
}
/**
* Rendering the cObject, FORM
......
* @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=367&cHash=bbc518d930
*/
function FORM($conf,$formData='') {
$content='';
if (is_array($formData)) {
$dataArr = $formData;
} else {
$data = $this->stdWrap($conf['data'],$conf['data.']);
// Clearing dataArr
$dataArr = array();
// Getting the original config
if (trim($data)) {
$data = str_replace(LF,'||',$data);
$dataArr = explode('||',$data);
return $this->getContentObject('FORM')->render($conf);
}
// Adding the new dataArray config form:
if (is_array($conf['dataArray.'])) { // dataArray is supplied
$sKeyArray = t3lib_TStemplate::sortedKeyList($conf['dataArray.'], TRUE);
foreach ($sKeyArray as $theKey) {
$dAA = $conf['dataArray.'][$theKey.'.'];
if (is_array($dAA)) {
$temp = array();
list($temp[0]) = explode('|',$dAA['label.'] ? $this->stdWrap($dAA['label'],$dAA['label.']) : $dAA['label']);
list($temp[1]) = explode('|',$dAA['type']);
if ($dAA['required']) {
$temp[1] = '*'.$temp[1];
}
list($temp[2]) = explode('|',$dAA['value.'] ? $this->stdWrap($dAA['value'],$dAA['value.']) : $dAA['value']);
// If value Array is set, then implode those values.
if (is_array($dAA['valueArray.'])) {
$temp_accum = array();
foreach ($dAA['valueArray.'] as $dAKey_vA => $dAA_vA) {
if (is_array($dAA_vA) && !strcmp(intval($dAKey_vA).'.',$dAKey_vA)) {
$temp_vA=array();
list($temp_vA[0])= explode('=',$dAA_vA['label.'] ? $this->stdWrap($dAA_vA['label'],$dAA_vA['label.']) : $dAA_vA['label']);
if ($dAA_vA['selected']) {$temp_vA[0]='*'.$temp_vA[0];}
list($temp_vA[1])= explode(',',$dAA_vA['value']);
}
$temp_accum[] = implode('=',$temp_vA);
}
$temp[2] = implode(',',$temp_accum);
}
list($temp[3]) = explode('|',$dAA['specialEval.'] ? $this->stdWrap($dAA['specialEval'],$dAA['specialEval.']) : $dAA['specialEval']);
// adding the form entry to the dataArray
$dataArr[] = implode('|',$temp);
}
}
}
}
$attachmentCounter = '';
$hiddenfields = '';
$fieldlist = Array();
$propertyOverride = Array();
$fieldname_hashArray = Array();
$cc = 0;
$xhtmlStrict = t3lib_div::inList('xhtml_strict,xhtml_11,xhtml_2',$GLOBALS['TSFE']->xhtmlDoctype);
// Formname
if ($conf['formName']) {
$formname = $this->cleanFormName($conf['formName']);
} else {
$formname = $GLOBALS['TSFE']->uniqueHash();
$formname = 'a'.$formname; // form name has to start with a letter to reach XHTML compliance
}
if (isset($conf['fieldPrefix'])) {
if ($conf['fieldPrefix']) {
$prefix = $this->cleanFormName($conf['fieldPrefix']);
} else {
$prefix = '';
}
} else {
$prefix = $formname;
}
foreach ($dataArr as $val) {
$cc++;
$confData=Array();
if (is_array($formData)) {
$parts = $val;
$val = 1; // true...
} else {
$val = trim($val);
$parts = explode('|',$val);
}
if ($val && strcspn($val,'#/')) {
// label:
$confData['label'] = trim($parts[0]);
// field:
$fParts = explode(',',$parts[1]);
$fParts[0]=trim($fParts[0]);
if (substr($fParts[0],0,1)=='*') {
$confData['required']=1;
$fParts[0] = substr($fParts[0],1);
}
$typeParts = explode('=',$fParts[0]);
$confData['type'] = trim(strtolower(end($typeParts)));
if (count($typeParts)==1) {
$confData['fieldname'] = $this->cleanFormName($parts[0]);
if (strtolower(preg_replace('/[^[:alnum:]]/','',$confData['fieldname']))=='email') {$confData['fieldname']='email';}
// Duplicate fieldnames resolved
if (isset($fieldname_hashArray[md5($confData['fieldname'])])) {
$confData['fieldname'].='_'.$cc;
... This diff was truncated because it exceeds the maximum size that can be displayed.
    (1-1/1)