Feature #23288 ยป firstDomainRecord_hook_class.t3lib_befunc.diff
t3lib/class.t3lib_befunc.php Wed Jul 28 12:00:04 2010 | ||
---|---|---|
* @return string Domain name, if found.
|
||
*/
|
||
public static function firstDomainRecord($rootLine) {
|
||
$dRecord = null;
|
||
$strDomain = null;
|
||
|
||
if (t3lib_extMgm::isLoaded('cms')) {
|
||
reset($rootLine);
|
||
while(list(,$row) = each($rootLine)) {
|
||
$dRec = t3lib_BEfunc::getRecordsByField('sys_domain', 'pid', $row['uid'], ' AND redirectTo=\'\' AND hidden=0', '', 'sorting');
|
||
if (is_array($dRec)) {
|
||
reset($dRec);
|
||
$dRecord = current($dRec);
|
||
return rtrim($dRecord['domainName'], '/');
|
||
$dRecord = reset($dRec);
|
||
$strDomain = rtrim($dRecord['domainName'], '/');
|
||
}
|
||
}
|
||
}
|
||
|
||
// Hook for additional domain processing
|
||
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['domainRecord'])) {
|
||
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['domainRecord'] as $classRef) {
|
||
$hookObj = t3lib_div::getUserObj($classRef);
|
||
if (method_exists($hookObj, 'firstDomainRecord_postProcess')) {
|
||
$strDomain = $hookObj->firstDomainRecord_postProcess(
|
||
array(
|
||
'rootline' => $rootLine,
|
||
'domain_record' => $dRecord,
|
||
'domain' => $strDomain,
|
||
)
|
||
);
|
||
}
|
||
}
|
||
}
|
||
|
||
return $strDomain;
|
||
}
|
||
|
||
/**
|