Project

General

Profile

Feature #14463 » bug_633_2006-01-06.diff

Administrator Admin, 2006-01-18 19:53

View differences:

TYPO3core.special_test/t3lib/class.t3lib_tstemplate.php 2006-01-06 01:28:53.993229784 +0100
}
/**
* Returns the level of the given page in the rootline - Multiple pages can be given by separating the UIDs by comma.
*
* @param string A list of UIDs for which the rootline-level should get returned
* @return integer The level in the rootline. If more than one page was given the lowest level will get returned.
*/
function getRootlineLevel($list) {
$idx = 0;
foreach($this->rootLine as $page) {
if (t3lib_div::inList($list, $page['uid'])) {
return $idx;
}
$idx++;
}
return false;
}
TYPO3core.special_test/typo3/sysext/cms/tslib/class.tslib_menu.php 2006-01-06 02:26:52.199761208 +0100
}
}
// Set $directoryLevel so the following evalution of the nextActive will not return
// an invalid value if .special=directory was set
$directoryLevel = 0;
if ($this->conf['special'] == 'directory') {
$value = $GLOBALS['TSFE']->cObj->stdWrap($this->conf['special.']['value'], $this->conf['special.']['value.']);
if ($value=='') {
$value=$GLOBALS['TSFE']->page['uid'];
}
$directoryLevel = intval($GLOBALS['TSFE']->tmpl->getRootlineLevel($value));
}
// Setting "nextActive": This is the page uid + MPvar of the NEXT page in rootline. Used to expand the menu if we are in the right branch of the tree
// Notice: The automatic expansion of a menu is designed to work only when no "special" modes are used.
if (is_array($this->tmpl->rootLine[$this->entryLevel+$this->menuNumber])) {
// Notice: The automatic expansion of a menu is designed to work only when no "special" modes (except "directory") are used.
$startLevel = $directoryLevel?$directoryLevel:$this->entryLevel;
if (is_array($this->tmpl->rootLine[$startLevel+$this->menuNumber])) {
$nextMParray = $this->MP_array;
if ($this->tmpl->rootLine[$this->entryLevel+$this->menuNumber]['_MOUNT_OL']) { // In overlay mode, add next level MPvars as well:
$nextMParray[] = $this->tmpl->rootLine[$this->entryLevel+$this->menuNumber]['_MP_PARAM'];
if ($this->tmpl->rootLine[$startLevel+$this->menuNumber]['_MOUNT_OL']) { // In overlay mode, add next level MPvars as well:
$nextMParray[] = $this->tmpl->rootLine[$startLevel+$this->menuNumber]['_MP_PARAM'];
}
$this->nextActive = $this->tmpl->rootLine[$this->entryLevel+$this->menuNumber]['uid'].
(count($nextMParray)?':'.implode(',',$nextMParray):'');
$this->nextActive = $this->tmpl->rootLine[$startLevel+$this->menuNumber]['uid'].(count($nextMParray)?':'.implode(',',$nextMParray):'');
} else {
$this->nextActive = '';
}
......
$altSortFieldValue = trim($this->mconf['alternativeSortingField']);
$altSortField = $altSortFieldValue ? $altSortFieldValue : 'sorting';
if ($this->menuNumber==1 && $this->conf['special']) { // ... only for the FIRST level of a HMENU
$value = $this->conf['special.']['value'];
$value = $this->parent_cObj->stdWrap($this->conf['special.']['value'], $this->conf['special.']['value.']);
switch($this->conf['special']) {
case 'userdefined':
(2-2/2)