📄 class.tslib_content.php
字号:
} } $loadDB = t3lib_div::makeInstance('FE_loadDBGroup'); $loadDB->start($conf['source'], $allowedTables); reset($loadDB->tableArray); while(list($table,)=each($loadDB->tableArray)) { 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); reset($loadDB->itemArray); while(list(,$val)=each($loadDB->itemArray)) { $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 * * @param array Array of TypoScript properties * @return string Output * @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.']); } $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 * * @param array Array of TypoScript properties * @return string Output * @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']; } // 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 * * @param array Array of TypoScript properties * @return string Output * @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 $controlTable->start($this->cObjGet($conf),$conf['offset']); } /** * Rendering the cObject, COLUMNS * * @param array Array of TypoScript properties * @return string Output * @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); reset($gapData); while(list(,$val)=each($gapData)) { $totalGapWidth+=intval($val['gapWidth']); } 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 * * @param array Array of TypoScript properties * @return string Output * @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).'"><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; } /** * Rendering the cObject, CASE * * @param array Array of TypoScript properties * @return string Output * @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 $theValue; } } /** * Rendering the cObject, LOAD_REGISTER and RESTORE_REGISTER * NOTICE: This cObject does NOT return any content since it just sets internal data based on the TypoScript properties. * * @param array Array of TypoScript properties * @param string If "RESTORE_REGISTER" then the cObject rendered is "RESTORE_REGISTER", otherwise "LOAD_REGISTER" * @return string Empty string (the cObject only sets internal data!) * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=365&cHash=4935524e2e * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=366&cHash=4f9485e8cc */ function LOAD_REGISTER($conf,$name) { if ($name=='RESTORE_REGISTER') { $GLOBALS['TSFE']->register = array_pop($GLOBALS['TSFE']->registerStack); } else { array_push($GLOBALS['TSFE']->registerStack,$GLOBALS['TSFE']->register); if (is_array($conf)) { reset($conf); while(list($theKey,$theValue)=each($conf)) { 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); } $GLOBALS['TSFE']->register[$theKey] = $this->stdWrap($conf[$theKey],$conf[$theKey.'.']); } } } } return ''; } /** * Rendering the cObject, FORM * * Note on $formData: * In the optional $formData array each entry represents a line in the ordinary setup. * In those entries each entry (0,1,2...) represents a space normally divided by the '|' line. * * $formData [] = array('Name:', 'name=input, 25 ', 'Default value....'); * $formData [] = array('Email:', 'email=input, 25 ', 'Default value for email....'); * * - corresponds to the $conf['data'] value being : * Name:|name=input, 25 |Default value....||Email:|email=input, 25 |Default value for email.... * * If $formData is an array the value of $conf['data'] is ignored. * * @param array Array of TypoScript properties * @param array Alternative formdata overriding whatever comes from TypoScript * @return string Output * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extre
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -