[FEATURE] Add stdWrap to HMENU-properties min/maxItems and begin
authorFerdinand Kuhl <fcool@coolys.de>
Sat, 10 Sep 2011 15:53:36 +0000 (17:53 +0200)
committerSteffen Ritter <info@rs-websystems.de>
Sun, 18 Dec 2011 12:00:23 +0000 (13:00 +0100)
THe HMENU-propertes minItems, maxItems and begin are extended to have
stdWrap possibilities.

This allows to create Menus more dynamically.

Change-Id: I70ceacf054352463c651ce177a0e1f1152bba39c
Resolves: #18618
Releases: 4.7
Reviewed-on: http://review.typo3.org/4735
Reviewed-by: Dominik Mathern
Tested-by: Dominik Mathern
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/cms/tslib/class.tslib_menu.php

index ada109b..e733862 100644 (file)
@@ -757,10 +757,32 @@ class tslib_menu {
 
                        $c=0;
                        $c_b=0;
+
                        $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']);
 
+                       $minItemsConf = isset($this->mconf['minItems.'])
+                                       ? $this->mconf['minItems.']
+                                       : (isset($this->conf['minItems.']) ? $this->conf['minItems.'] : NULL);
+                       $minItems = is_array($minItemsConf)
+                                       ? $this->parent_cObj->stdWrap($minItems, $minItemsConf)
+                                       : $minItems;
+
+                       $maxItemsConf = isset($this->mconf['maxItems.'])
+                                       ? $this->mconf['maxItems.']
+                                       : (isset($this->conf['maxItems.']) ? $this->conf['maxItems.'] : NULL);
+                       $maxItems = is_array($maxItemsConf)
+                                       ? $this->parent_cObj->stdWrap($maxItems, $maxItemsConf)
+                                       : $maxItems;
+
+                       $beginConf = isset($this->mconf['begin.'])
+                                       ? $this->mconf['begin.']
+                                       : (isset($this->conf['begin.']) ? $this->conf['begin.'] : NULL);
+                       $begin = is_array($beginConf)
+                                       ? $this->parent_cObj->stdWrap($begin, $beginConf)
+                                       : $begin;
+
                        $banUidArray = $this->getBannedUids();
 
                                // Fill in the menuArr with elements that should go into the menu: