Project

General

Profile

Actions

Feature #33138

closed

provide getPidList function in ExtBase environment (includes propsed solution)

Added by Jonas Felix almost 13 years ago. Updated over 4 years ago.

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);
}

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #70903: Refactor "getTreeList" functions / add utility functionClosed2015-10-21

Actions
Actions

Also available in: Atom PDF