From 3f544a24819213e2564b70a4111e6f753390ccdc Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 12 Oct 2007 15:11:57 +0000 Subject: [PATCH] MDL-11699 - Making one more common case a bit nicer for callers. Merged from MOODLE_19_STABLE. --- lib/weblib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 25ccbf103a..8d41b194bb 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3410,7 +3410,8 @@ function print_navigation ($navigation, $separator=0, $return=false) { * @uses $THEME * * @param mixed $extranavlinks - Normally an array of arrays, keys: name, link, type. If you - * only want one extra item with no link, you can pass a string instead. + * only want one extra item with no link, you can pass a string instead. If you don't want + * any extra links, pass an empty string. * @param mixed $cm - optionally the $cm object, if you want this function to generate the * activity and activityinstance levels of navigation too. * @@ -3421,7 +3422,11 @@ function build_navigation($extranavlinks, $cm = null) { global $CFG, $COURSE; if (is_string($extranavlinks)) { - $extranavlinks = array(array('name' => $extranavlinks, 'link' => '', 'type' => 'title')); + if ($extranavlinks == '') { + $extranavlinks = array(); + } else { + $extranavlinks = array(array('name' => $extranavlinks, 'link' => '', 'type' => 'title')); + } } $navlinks = array(); -- 2.39.5