Project

General

Profile

Feature #22163 » 13626_v2.diff

Administrator Admin, 2010-05-09 17:39

View differences:

typo3/sysext/cms/tslib/class.tslib_fe.php (Arbeitskopie)
* Get page shortcut; Finds the records pointed to by input value $SC (the shortcut value)
*
* @param integer The value of the "shortcut" field from the pages record
* @param integer The shortcut mode: 1 and 2 will select either first subpage or random subpage; the default is the page pointed to by $SC
* @param integer The shortcut mode: 1 and 2 will select either first subpage or random subpage, 3 will select the parent page; the default is the page pointed to by $SC
* @param integer The current page UID of the page which is a shortcut
* @param integer Safety feature which makes sure that the function is calling itself recursively max 20 times (since this function can find shortcuts to other shortcuts to other shortcuts...)
* @param array An array filled with previous page uids tested by the function - new page uids are evaluated against this to avoid going in circles.
......
$c++;
}
break;
case 3:
$parent = $this->sys_page->getPage($thisUid);
$page = $this->sys_page->getPage($parent['pid']);
break;
default:
$page = $this->sys_page->getPage($idArray[0]);
break;
......
$microtime_end = (isset($GLOBALS['TYPO3_MISC']['microtime_end'])) ? $GLOBALS['TYPO3_MISC']['microtime_end'] : NULL;
$microtime_BE_USER_start = (isset($GLOBALS['TYPO3_MISC']['microtime_BE_USER_start'])) ? $GLOBALS['TYPO3_MISC']['microtime_BE_USER_start'] : NULL;
$microtime_BE_USER_end = (isset($GLOBALS['TYPO3_MISC']['microtime_BE_USER_end'])) ? $GLOBALS['TYPO3_MISC']['microtime_BE_USER_end'] : NULL;
$this->scriptParseTime = $GLOBALS['TT']->getMilliseconds($microtime_end) - $GLOBALS['TT']->getMilliseconds($microtime_start)
- ($GLOBALS['TT']->getMilliseconds($microtime_BE_USER_end) - $GLOBALS['TT']->getMilliseconds($microtime_BE_USER_start));
}
typo3/sysext/cms/tslib/class.tslib_menu.php (Arbeitskopie)
*/
function isItemState($kind,$key) {
$natVal=0;
$uid = $this->resolveLinkUid($this->menuArr[$key]);
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
*
(3-3/3)