Project

General

Profile

Feature #17650 » patch6452_class.tslib_menu.txt

Administrator Admin, 2008-01-07 23:36

 
Index: typo3/sysext/cms/tslib/class.tslib_menu.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_menu.php (revision 2868)
+++ typo3/sysext/cms/tslib/class.tslib_menu.php (working copy)
@@ -826,6 +826,7 @@
$minItems = intval($this->mconf['minItems'] ? $this->mconf['minItems'] : $this->conf['minItems']);
$maxItems = intval($this->mconf['maxItems'] ? $this->mconf['maxItems'] : $this->conf['maxItems']);
$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();
@@ -843,9 +844,32 @@
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);
+ }
+
+ }
// Fill in fake items, if min-items is set.
if ($minItems) {
while($c<$minItems) {
(2-2/2)