Index: class.tslib_content.php =================================================================== --- class.tslib_content.php (revision 2308) +++ class.tslib_content.php (working copy) @@ -338,6 +338,7 @@ var $substMarkerCache=array(); // Caching substituteMarkerArrayCached function var $recordRegister=array(); // Array that registers rendered content elements (or any table) to make sure they are not rendered recursively! var $cObjHookObjectsArr = array(); // Containig hooks for userdefined cObjects + var $stdWrapHookObjectsArr = array(); // Containig hooks for stdWrap /** * Class constructor. @@ -358,6 +359,11 @@ $this->cObjHookObjectsArr[$classArr[0]] = &t3lib_div::getUserObj($classArr[1]); } } + if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrapExtension'])) { + foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrapExtension'] as $classArr) { + $this->stdWrapHookObjectsArr[] = &t3lib_div::getUserObj($classArr); + } + } } /** @@ -443,6 +449,7 @@ * @example http://typo3.org/doc.0.html?&encryptionKey=&tx_extrepmgm_pi1[extUid]=267&tx_extrepmgm_pi1[tocEl]=153&cHash=7e74f4d331 */ function cObjGetSingle($name,$conf,$TSkey='__') { + global $TYPO3_CONF_VARS; $content=''; // Checking that the function is not called eternally. This is done by interrupting at a depth of 100 $GLOBALS['TSFE']->cObjectDepthCounter--; @@ -566,6 +573,18 @@ case 'MULTIMEDIA': $content.=$this->MULTIMEDIA($conf); break; + + default: + // Call hook functions for extra processing + if (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 $classRef) { + $hookObj = &t3lib_div::getUserObj($classRef); + if (method_exists($hookObj, 'cObjGetSingleDefault')) { + $content.= $hookObj->cObjGetSingleDefault($name, $conf, $TSkey, $this); + } + } + } + break; } } } @@ -3133,6 +3152,12 @@ function stdWrap($content,$conf) { if (is_array($conf)) { + foreach ($this->stdWrapHookObjectsArr as $hookObj) { + if ( method_exists($hookObj, 'stdWrapPreProcess')) { + $content = $hookObj->stdWrapPreProcess($content,$conf, $this); + } + } + // Setting current value, if so if ($conf['setContentToCurrent']){$this->data[$this->currentValKey]=$content;} if ($conf['setCurrent'] || $conf['setCurrent.']){$this->data[$this->currentValKey] = $this->stdWrap($conf['setCurrent'], $conf['setCurrent.']);} @@ -3150,6 +3175,12 @@ if ($conf['filelist'] || $conf['filelist.']) {$content=$this->filelist($this->stdWrap($conf['filelist'], $conf['filelist.']));} if ($conf['preUserFunc']) {$content = $this->callUserFunction($conf['preUserFunc'], $conf['preUserFunc.'], $content);} + foreach ($this->stdWrapHookObjectsArr as $hookObj) { + if ( method_exists($hookObj, 'stdWrapOverride')) { + $content = $hookObj->stdWrapOverride($content,$conf, $this); + } + } + // Overriding values, evaluating conditions if ($conf['override'] || $conf['override.']){ $override = $this->stdWrap($conf['override'], $conf['override.']); @@ -3177,6 +3208,13 @@ // Call stdWrap recursively if ($conf['stdWrap.']) { $content=$this->stdWrap($content,$conf['stdWrap.']); } + + foreach ($this->stdWrapHookObjectsArr as $hookObj) { + if ( method_exists($hookObj, 'stdWrapProcessing')) { + $content = $hookObj->stdWrapProcessing($content,$conf, $this); + } + } + if ( ($conf['required'] && (string)$content=='') || ($conf['if.'] && !$this->checkIf($conf['if.'])) || ($conf['fieldRequired'] && !trim($this->data[$conf['fieldRequired']])) ){ $content = ''; } else { @@ -3278,6 +3316,12 @@ if ($conf['editPanel'] && $GLOBALS['TSFE']->beUserLogin){$content=$this->editPanel($content, $conf['editPanel.']);} } + foreach ($this->stdWrapHookObjectsArr as $hookObj) { + if ( method_exists($hookObj, 'stdWrapPostProcessing')) { + $content = $hookObj->stdWrapPostProcessing($content,$conf, $this); + } + } + //Debug: if ($conf['debug']) {$content = '
'.htmlspecialchars($content).'
';} if ($conf['debugFunc']) {debug($conf['debugFunc']==2?array($content):$content);} @@ -4765,6 +4809,7 @@ * @see getFieldVal() */ function getData($string,$fieldArray) { + global $TYPO3_CONF_VARS; if (!is_array($fieldArray)) { $fieldArray=$GLOBALS['TSFE']->page; } @@ -4879,7 +4924,19 @@ break; } } + if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['getDataExtension'])) { + foreach($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['getDataExtension'] as $classRef) { + $hookObj = &t3lib_div::getUserObj($classRef); + if (method_exists($hookObj, 'getDataExtension')) { + $retVal = $hookObj->getDataExtension($string, $fieldArray, $secVal, $retVal, $this); + } + } + } } + + + + return $retVal; }