Project

General

Profile

Bug #17537 » 6161-bis.patch

Administrator Admin, 2010-11-10 19:41

View differences:

class.tslib_fe.php (working copy)
// Is the ID a link to another page??
if ($this->page['doktype']==4) {
$this->MP = ''; // We need to clear MP if the page is a shortcut. Reason is if the short cut goes to another page, then we LEAVE the rootline which the MP expects.
$this->page = $this->getPageShortcut($this->page['shortcut'],$this->page['shortcut_mode'],$this->page['uid']);
$this->id = $this->page['uid'];
}
......
case 1:
case 2:
$pageArray = $this->sys_page->getMenu($idArray[0]?$idArray[0]:$thisUid,'*','sorting','AND pages.doktype<199 AND pages.doktype!=6');
$pO = 0;
if ($mode==2 && count($pageArray)) { // random
$this->make_seed();
$randval = intval(rand(0,count($pageArray)-1));
$pO = $randval;
$pageArray = array_values($pageArray);
$page = $pageArray[$randval];
} else {
$page = reset($pageArray);
}
$c = 0;
reset($pageArray);
while(list(,$pV)=each($pageArray)) {
if ($c==$pO) {
$page = $pV;
break;
// get back MP vars (stored here by getMenu function)
if (isset($page['_MP_PARAM']) && $page['_MP_PARAM']) {
if ($this->MP) {
$this->MP .= ',';
}
$c++;
$this->MP .= $page['_MP_PARAM'];
}
break;
default:
$this->MP = ''; // We need to clear MP if the page is a shortcut. Reason is AS the short cut goes to another page, then we LEAVE the rootline which the MP expects.
$page = $this->sys_page->getPage($idArray[0]);
break;
}
(2-2/3)