File tree Expand file tree Collapse file tree 1 file changed +9
-16
lines changed
app/code/Magento/Backend/Block Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change 18
18
*/
19
19
class Menu extends \Magento \Backend \Block \Template
20
20
{
21
- const CACHE_TAGS = 'BACKEND_MAINMENU ' ;
21
+ public const CACHE_TAGS = 'BACKEND_MAINMENU ' ;
22
22
23
23
/**
24
24
* @var string
@@ -331,34 +331,27 @@ protected function _columnBrake($items, $limit)
331
331
if ($ total <= $ limit ) {
332
332
return ;
333
333
}
334
- $ result = [];
335
334
$ result [] = ['total ' => $ total , 'max ' => ceil ($ total / ceil ($ total / $ limit ))];
336
335
$ count = 0 ;
337
- $ itemCount = 0 ;
338
- $ nextColBrake = false ;
339
336
foreach ($ items as $ item ) {
340
337
$ place = $ this ->_countItems ($ item ->getChildren ()) + 1 ;
341
- $ colbrake = false ;
342
- $ itemCount ++;
343
338
$ count += $ place ;
344
- if ($ nextColBrake ) {
345
- $ colbrake = true ;
346
- $ count = $ place ;
347
- } elseif ($ place - $ result [0 ]['max ' ] > $ limit - $ result [0 ]['max ' ]) {
339
+ if ($ place - $ result [0 ]['max ' ] > $ limit - $ result [0 ]['max ' ]) {
348
340
$ colbrake = true ;
349
341
$ count = 0 ;
350
342
} elseif ($ count - $ result [0 ]['max ' ] > $ limit - $ result [0 ]['max ' ]) {
351
343
$ colbrake = true ;
352
344
$ count = $ place ;
345
+ } else {
346
+ $ colbrake = false ;
353
347
}
354
-
355
- $ nextColBrake = false ;
356
- if ($ itemCount == 1 && $ colbrake ) {
357
- $ nextColBrake = true ;
358
- }
359
-
360
348
$ result [] = ['place ' => $ place , 'colbrake ' => $ colbrake ];
361
349
}
350
+
351
+ if (isset ($ result [1 ]) && $ result [1 ]['colbrake ' ] === true && isset ($ result [2 ])) {
352
+ $ result [2 ]['colbrake ' ] = true ;
353
+ }
354
+
362
355
return $ result ;
363
356
}
364
357
You can’t perform that action at this time.
0 commit comments