Bug #22193 » sys_templates_3.diff
typo3_src-4.3.2/t3lib/class.t3lib_tstemplate.php 2010-02-25 23:30:21.000000000 +0100 | ||
---|---|---|
}
|
||
} else { // NORMAL OPERATION:
|
||
$basedOnArr = t3lib_div::intExplode(',', $row['basedOn']);
|
||
foreach ($basedOnArr as $id) { // traversing list
|
||
if (!t3lib_div::inList($idList,'sys_'.$id)) { // if $id is not allready included ...
|
||
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_template', 'uid='.intval($id).' '.$this->whereClause);
|
||
if ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // there was a template, then we fetch that
|
||
$this->versionOL($subrow);
|
||
if (is_array($subrow)) {
|
||
$this->processTemplate($subrow,$idList.',sys_'.$id,$pid, 'sys_'.$id,$templateID);
|
||
}
|
||
}
|
||
$GLOBALS['TYPO3_DB']->sql_free_result($res);
|
||
}
|
||
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_template', 'uid in ('.$row['basedOn'].') '.$this->whereClause);
|
||
while ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { //fetch all the results
|
||
$subrows[$subrow['uid']] = $subrow; //makes it easier to access the rows later
|
||
}
|
||
$GLOBALS['TYPO3_DB']->sql_free_result($res);
|
||
foreach ($basedOnArr as $id) { // traversing list to ensure sorting of the templates
|
||
if (t3lib_div::inList($idList,'sys_'.$id)) continue; //skip template if already included
|
||
|
||
$this->versionOL($subrow);
|
||
if (is_array($subrows[$id])) {
|
||
$this->processTemplate($subrows[$id],$idList.',sys_'.$id,$pid, 'sys_'.$id,$templateID);
|
||
}
|
||
}
|
||
}
|
||
}
|