Actions
Feature #17650
closedoption end for HMENU / and negative values for begin and end
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2007-10-04
Due date:
% Done:
0%
Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:
Description
For special requirements we needed something like:
1=HMENU
1 {
end=-1
begin=-2
..
}
- the parameter end to configure a endpoint
- allow negative values for begin and end, so you can define a offset from the end of the menuitems
I provide a patch later. Here is the new code for function makeMenu
$begin = tslib_cObj::calc($this->mconf['begin'] ? $this->mconf['begin'] : $this->conf['begin']);
$endat = tslib_cObj::calc($this->mconf['end'] ? $this->mconf['end'] : $this->conf['end']);
$banUidArray = $this->getBannedUids();
// Fill in the menuArr with elements that should go into the menu:
$this->menuArr = Array();
foreach($temp as $data) {
$spacer = (t3lib_div::inList($this->spacerIDList,$data['doktype']) || !strcmp($data['ITEM_STATE'],'SPC')) ? 1 : 0; // if item is a spacer, $spacer is set
if ($this->filterMenuPages($data, $banUidArray, $spacer)) {
$c_b++;
if ($begin<=$c_b) { // If the beginning item has been reached.
$this->menuArr[$c] = $data;
$this->menuArr[$c]['isSpacer'] = $spacer;
$c++;
if ($maxItems && $c>=$maxItems) {
break;
}
}
if ($endat>0 && $endat<=$c_b) {
break;
}
}
}
//delete last items if endat is negative
if ($endat<0) {
$_end=$c+$endat;
if ($_end<0)
$_end=0;
for ($i=$c;$i>=$_end; $i--) {
unset($this->menuArr[$i]);
}
}
//delete the first items if begin was negative
if ($begin<0) {
$_begin=$c+$begin;
if ($_begin<0)
$_begin=0;
for ($i=0; $i<$_begin; $i++) {
array_shift($this->menuArr);
}
}
(issue imported from #M6452)
Files
Updated by Daniel Poetzinger almost 17 years ago
the negative values for end and begin allow a offest from the end. -> the tsref needs to be updated if that will find the way to the core
Updated by Daniel Poetzinger almost 17 years ago
patch6452_class.tslib_menu.txt is for latest 4.2 trunk
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0) - TYPO3 Version set to 4.2
As this report is very old, is the handling in newer TYPO3 CMS Versions (like 6.0/6.1) more like you expect it?
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed
No feedback for over 90 days.
Actions