[TYPO3-mvc] [FYI] Autopopulation of PID - or: Where should my records be placed?
Steffen Kamper
info at sk-typo3.de
Sat Aug 1 15:18:43 CEST 2009
Hi,
Sebastian Kurfürst schrieb:
> Hi everybody,
>
> thanks for the fix :-)
> @Bastian: Could you put the Patch into Extbase? I could first do it on
> Monday.
>
> Greets,
> Sebastian
something is missing also. if you also set recursive, you need something
like piBase did:
pi_getPidList($data['pages'], $data['recursive']);
so this is respected automatically. Same should work for TS, like
storagePid = 12
storagePid.recursive = 3
or something simular.
The used function isn't such complex:
function pi_getPidList($pid_list, $recursive = 0) {
if (!strcmp($pid_list, '')) {
$pid_list = $GLOBALS['TSFE']->id;
}
$recursive = t3lib_div::intInRange($recursive, 0);
$pid_list_arr = array_unique(t3lib_div::trimExplode(',', $pid_list, 1));
$pid_list = array();
foreach($pid_list_arr as $val) {
$val = t3lib_div::intInRange($val, 0);
if ($val) {
$_list = $this->cObj->getTreeList(-1 * $val, $recursive);
if ($_list) {
$pid_list[] = $_list;
}
}
}
return implode(',', $pid_list);
}
vg Steffen
More information about the TYPO3-project-typo3v4mvc
mailing list