From a053d96bf29519d602b36fd33b20c75f81e7c8e1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 23 Aug 2011 00:32:46 -0400 Subject: [PATCH] Better list-unwrapping in MoreMenu --- lib/moremenu.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/moremenu.php b/lib/moremenu.php index 8aed58a921..3562ac4148 100644 --- a/lib/moremenu.php +++ b/lib/moremenu.php @@ -101,7 +101,12 @@ class MoreMenu extends Menu $extended = array_slice($items, self::SOFT_MAX, self::HARD_MAX - self::SOFT_MAX); foreach ($extended as $item) { - list($actionName, $args, $label, $description, $id) = $item; + if (count($item) == 5) { + list($actionName, $args, $label, $description, $id) = $item; + } else { + list($actionName, $args, $label, $description) = $item; + $id = null; + } $this->item($actionName, $args, $label, $description, $id, 'extended_menu'); } @@ -109,7 +114,12 @@ class MoreMenu extends Menu $seeAll = $this->seeAllItem(); if (!empty($seeAll)) { - list($actionName, $args, $label, $description, $id) = $seeAll; + if (count($seeAll) == 5) { + list($actionName, $args, $label, $description, $id) = $seeAll; + } else { + list($actionName, $args, $label, $description) = $seeAll; + $id = null; + } $this->item($actionName, $args, $label, $description, $id, 'extended_menu see_all'); } } -- 2.39.5