]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #3119 if only one item left, move it off more menu (but only when nothing selected)
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 25 Mar 2011 02:02:50 +0000 (02:02 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 25 Mar 2011 02:02:50 +0000 (02:02 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8834 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/navigation.php

index 891527d38a8278e2714e80de6731bd26877676ff..16cdf9d4c60c5af7f8f3a14d67e74fb8230a223d 100644 (file)
@@ -197,8 +197,9 @@ function elgg_site_menu_setup($hook, $type, $return, $params) {
                $max_display_items = 5;
 
                // the first n are shown, rest added to more list
+               // if only one item on more menu, stick it with the rest
                $num_menu_items = count($return['default']);
-               if ($num_menu_items > $max_display_items) {
+               if ($num_menu_items > ($max_display_items + 1)) {
                        $return['more'] =  array_splice($return['default'], $max_display_items);
                }
        }