Project

General

Profile

Feature #22163 » fixedItemStateShortcuts.diff

Administrator Admin, 2010-02-23 12:57

View differences:

typo3/sysext/cms/tslib/class.tslib_menu.php (working copy)
*/
function isItemState($kind,$key) {
$natVal=0;
if($this->mconf['resolveActiveShortcut']) {
$uid = $this->resolveLinkUid($this->menuArr[$key]);
} else {
$uid = $this->menuArr[$key]['uid'];
}
if ($this->menuArr[$key]['ITEM_STATE']) { // If any value is set for ITEM_STATE the normal evaluation is discarded
if (!strcmp($this->menuArr[$key]['ITEM_STATE'],$kind)) {$natVal=1;}
} else {
......
$natVal = $this->menuArr[$key]['isSpacer'];
break;
case 'IFSUB':
$natVal = $this->isSubMenu($this->menuArr[$key]['uid']);
$natVal = $this->isSubMenu($uid);
break;
case 'ACT':
$natVal = $this->isActive($this->menuArr[$key]['uid'], $this->getMPvar($key));
$natVal = $this->isActive($uid, $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($uid, $this->getMPvar($key)) && $this->isSubMenu($uid);
break;
case 'CUR':
$natVal = $this->isCurrent($this->menuArr[$key]['uid'], $this->getMPvar($key));
$natVal = $this->isCurrent($uid, $this->getMPvar($key));
break;
case 'CURIFSUB':
$natVal = $this->isCurrent($this->menuArr[$key]['uid'], $this->getMPvar($key)) && $this->isSubMenu($this->menuArr[$key]['uid']);
$natVal = $this->isCurrent($uid, $this->getMPvar($key)) && $this->isSubMenu($uid);
break;
case 'USR':
$natVal = $this->menuArr[$key]['fe_group'];
......
return $natVal;
}
/**
* Resolves the final link uid of the given page, if page is of type shortcut
*
* @param array page object.
* @return integer Returns the uid of the linked page
*/
protected function resolveLinkUid($page) {
if ($page['doktype'] == 4) {
$shortcutPage = $GLOBALS['TSFE']->getPageShortcut($page['shortcut'],$page['shortcut_mode'],$page['uid']);
if (is_array($shortcutPage) && $shortcutPage['uid']) {
return $shortcutPage['uid'];
}
}
return $page['uid'];
}
/**
* Creates an access-key for a TMENU/GMENU menu item based on the menu item titles first letter
*
(1-1/3)