Project

General

Profile

Bug #21217 ยป 12169.diff

Administrator Admin, 2009-10-12 12:37

View differences:

typo3/sysext/cms/tslib/class.tslib_menu.php (working copy)
if ($value=='') {
$value=$GLOBALS['TSFE']->page['uid'];
}
$items=t3lib_div::intExplode(',',$value);
if (t3lib_div::testInt($this->conf['special.']['depth'])) {
$depth = t3lib_div::intInRange($this->conf['special.']['depth'],1,20); // Tree depth
$items = t3lib_div::intExplode(',', $value);
if (t3lib_div::testInt($this->conf['special.']['depth'])) {
$depth = t3lib_div::intInRange($this->conf['special.']['depth'], 1, 20); // Tree depth
} else {
$depth=20;
}
$limit = t3lib_div::intInRange($this->conf['special.']['limit'],0,100); // max number of items
$limit = t3lib_div::intInRange($this->conf['special.']['limit'], 0, 100); // max number of items
$maxAge = intval(tslib_cObj::calc($this->conf['special.']['maxAge']));
if (!$limit) $limit=10;
if (!$limit) {
$limit=10;
}
$mode = $this->conf['special.']['mode']; // *'auto', 'manual', 'tstamp'
// Get id's
$id_list_arr = Array();
$idListArray = array();
foreach($items as $id) {
$bA = t3lib_div::intInRange($this->conf['special.']['beginAtLevel'],0,100);
$id_list_arr[] = tslib_cObj::getTreeList(-1*$id,$depth-1+$bA,$bA-1);
$beginAtLevel = t3lib_div::intInRange($this->conf['special.']['beginAtLevel'], 0, 100);
$idListArray[] = tslib_cObj::getTreeList(-1 * $id, $depth - 1 + $beginAtLevel, $beginAtLevel - 1);
}
$id_list = implode(',',$id_list_arr);
$idList = implode(',', $idListArray);
$pidInList = $idList ? '0,' . $idList : '0';
// Get sortField (mode)
switch($mode) {
case 'starttime':
......
break;
}
// Get
$extraWhere = ($this->conf['includeNotInMenu'] ? '' : ' AND pages.nav_hide=0').$this->getDoktypeExcludeWhere();
$extraWhere = ($this->conf['includeNotInMenu'] ? '' : ' AND pages.nav_hide=0') . $this->getDoktypeExcludeWhere();
if ($this->conf['special.']['excludeNoSearchPages']) {
$extraWhere.= ' AND pages.no_search=0';
}
if ($maxAge>0) {
$extraWhere.=' AND '.$sortField.'>'.($GLOBALS['SIM_ACCESS_TIME']-$maxAge);
if ($maxAge > 0) {
$extraWhere.=' AND ' . $sortField . '>' . ($GLOBALS['SIM_ACCESS_TIME'] - $maxAge);
}
$res = $GLOBALS['TSFE']->cObj->exec_getQuery('pages',Array('pidInList'=>'0', 'uidInList'=>$id_list, 'where'=>$sortField.'>=0'.$extraWhere, 'orderBy'=>($altSortFieldValue ? $altSortFieldValue : $sortField.' desc'),'max'=>$limit));
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$GLOBALS['TSFE']->sys_page->versionOL('pages',$row);
if (is_array($row)) {
$temp[$row['uid']]=$this->sys_page->getPageOverlay($row);
$res = $GLOBALS['TSFE']->cObj->exec_getQuery('pages', array(
'pidInList' => $pidInList,
'uidInList' => $idList,
'where' => $sortField . '>=0' . $extraWhere,
'orderBy' => ($altSortFieldValue ? $altSortFieldValue : $sortField . ' desc'),
'max' => $limit
));
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$GLOBALS['TSFE']->sys_page->versionOL('pages', $row);
if (is_array($row)) {
$temp[$row['uid']] = $this->sys_page->getPageOverlay($row);
}
}
break;
    (1-1/1)