Actions
Feature #33138
closedprovide getPidList function in ExtBase environment (includes propsed solution)
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2012-01-12
Due date:
% Done:
0%
Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:
Description
The storagePid works great, but there are some other cases you need a list of pids and that function is not available for extbase, because it's within tslib_piBase. We have a version that you can use within your controller.
Where should such a function be places? Is there some core lib instead of tslib_piBase?
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(); $tree = t3lib_div::makeInstance('t3lib_queryGenerator'); foreach($pid_list_arr as $val) { $val = t3lib_div::intInRange($val, 0); if ($val) { $_list = $tree->getTreeList(-1 * $val, $recursive); if ($_list) { $pid_list[] = $_list; } } } return implode(',', $pid_list); }
Actions