Project

General

Profile

Bug #14635 ยป patch_realurl_act_shortcut.diff

Administrator Admin, 2005-04-05 15:48

View differences:

./class.tslib_menu.php Tue Apr 5 15:33:46 2005
$mainTarget = $altTarget ? $altTarget : $this->mconf['target'];
// Creating link:
if ($this->mconf['collapse'] && $this->isActive($this->menuArr[$key]['uid'], $this->getMPvar($key))) {
if ($this->mconf['collapse'] && $this->isActive($key, $this->getMPvar($key))) {
$thePage = $this->sys_page->getPage($this->menuArr[$key]['pid']);
$LD = $this->tmpl->linkData($thePage,$mainTarget,'','',$overrideArray, $this->mconf['addParams'].$MP_params.$this->menuArr[$key]['_ADD_GETVARS'], $typeOverride);
} else {
......
* @return boolean True if page with $uid is active
* @access private
*/
function isActive($uid, $MPvar='') {
function isActive($key, $MPvar='') {
$uid = $this->menuArr[$key];
// Check for always active PIDs:
if (count($this->alwaysActivePIDlist) && in_array($uid,$this->alwaysActivePIDlist)) {
......
if ($uid && in_array('ITEM:'.$testUid, $this->rL_uidRegister)) {
return TRUE;
}
if ($this->menuArr[$key]['doktype']==4) {
// We have a shortcut. Do further investigations
if (''.intval($this->menuArr[$key]['shortcut'])===$this->menuArr[$key]['shortcut']) { // We have simple shortcuts containing just the page uid
$uid = intval($this->menuArr[$key]['shortcut']);
} else {
$parts = explode('_', $this->menuArr[$key]['shortcut']);
$uid = array_pop($parts);
$table = implode('_', $parts);
if ($table!='pages') {
$record = $this->sys_page->getRawRecord($table, $uid, 'pid');
$uid = $record['pid'];
}
}
$testUid = $uid.($MPvar?':'.$MPvar:'');
if ($uid && in_array('ITEM:'.$testUid, $this->rL_uidRegister)) {
return TRUE;
}
}
}
/**
......
$natVal = $this->isSubMenu($this->menuArr[$key]['uid']);
break;
case 'ACT':
$natVal = $this->isActive($this->menuArr[$key]['uid'], $this->getMPvar($key));
$natVal = $this->isActive($key, $this->getMPvar($key));
break;
case 'ACTIFSUB':
$natVal = $this->isActive($this->menuArr[$key]['uid'], $this->getMPvar($key)) && $this->isSubMenu($this->menuArr[$key]['uid']);
$natVal = $this->isActive($key, $this->getMPvar($key)) && $this->isSubMenu($this->menuArr[$key]['uid']);
break;
case 'CUR':
$natVal = $this->isCurrent($this->menuArr[$key]['uid'], $this->getMPvar($key));
    (1-1/1)