Project

General

Profile

Bug #34884 ยป t3lib_search_livesearch.patch

Peter Russ, 2012-03-15 15:41

View differences:

t3lib/search/class.t3lib_search_livesearch.php (revision )
$recordArray = array();
$pageList = array();
$mounts = $GLOBALS['BE_USER']->returnWebmounts();
/**
* COREPATCH Telekom
* by Peter Russ <peter.russ@telekom.de>
* 14.03.12: fixed weird programming
*
*/
$pageIdList = array();
foreach ($mounts as $pageId) {
$pageList[] = $this->getAvailablePageIds($pageId, self::RECURSIVE_PAGE_LEVEL);
if (!in_array($pageId, $pageIdList)) {
$pageList = $this->getAvailablePageIds($pageId, self::RECURSIVE_PAGE_LEVEL);
$pageIdList = array_merge($pageIdList, $pageList);
}
}
$pageIdList = implode(',', array_unique(explode(',', implode(',', $pageList))));
unset($pageList);
}
$pageIdList = implode(',', $pageIdList);
/**
* end COREPATCH
*/ unset($pageList);
$limit = $this->startCount . ',' . $this->limitCount;
if ($this->queryParser->isValidCommand($searchQuery)) {
......
'LIMIT' => $limit
);
$result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
$collect[] = array(
......
* @param integer Page id.
* @param integer Depth to go down.
*
* @return string coma separated list of uids
* @return array coma separated list of uids
*/
protected function getAvailablePageIds($id, $depth) {
$idList = '';
/**
* COREPATCH Telekom
* by Peter Russ <peter.russ@telekom.de>
* 14.03.12: added hook and imrpoved handling due to problems with be_acl
*
*/
if (!$GLOBALS['BE_USER']->isAdmin() && isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/search/class.t3lib_search_livesearch.php']['getAvailablePageIds']) &&
is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/search/class.t3lib_search_livesearch.php']['getAvailablePageIds'])) {
$ids = array();
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/search/class.t3lib_search_livesearch.php']['getAvailablePageIds'] as $_funcRef) {
$_params = array('currentIds' => $ids, 'perms' => 1);
$ids = t3lib_div::callUserFunction($_funcRef, $_params, $this);
}
return $ids;
} else {
/** @var t3lib_pageTree $tree*/
$tree = t3lib_div::makeInstance('t3lib_pageTree');
$tree->init('AND ' . $this->userPermissions);
$tree->makeHTML = 0;
$tree->fieldArray = array('uid', 'php_tree_stop');
if ($depth) {
$tree->getTree($id, $depth, '');
}
$tree->ids[] = $id;
$tree = t3lib_div::makeInstance('t3lib_pageTree');
$tree->init('AND ' . $this->userPermissions);
$tree->makeHTML = 0;
$tree->fieldArray = array('uid', 'php_tree_stop');
if ($depth) {
$tree->getTree($id, $depth, '');
}
$tree->ids[] = $id;
$idList = implode(',', $tree->ids);
return $idList;
return $tree->ids;
}
}
/**
* end COREPATCH
*/ }
}
?>
    (1-1/1)