MDL-48542 user_menu: Increment index for all menu items

The invalid type was not causing the idx to incremented, thus missing off
the final divider.
This commit is contained in:
Andrew Nicols
2015-01-28 12:10:45 +08:00
parent ba43cfbd21
commit f6ab2b1ccf
+5 -7
View File
@@ -3053,7 +3053,6 @@ EOD;
case 'divider':
// If the nav item is a divider, add one and skip link processing.
$am->add($divider);
$idx++;
break;
case 'invalid':
@@ -3079,16 +3078,15 @@ EOD;
array('class' => 'icon')
);
$am->add($al);
// Add dividers after the first item and before the
// last item.
if ($idx == 0 || $idx == $navitemcount - 2) {
$am->add($divider);
}
break;
}
$idx++;
// Add dividers after the first item and before the last item.
if ($idx == 1 || $idx == $navitemcount - 1) {
$am->add($divider);
}
}
}