* Prints breadcrumb trail of links, called in theme/-/header.html
*
* @uses $CFG
- * @param string $navigation The breadcrumb navigation string to be printed
+ * @param mixed $navigation The breadcrumb navigation string to be printed
* @param string $separator The breadcrumb trail separator. The default 0 leads to the use
* of $THEME->rarrow, themes could use '→', '/', or '' for a style-sheet solution.
* @param boolean $return False to echo the breadcrumb string (default), true to return it.
foreach ($ar as $a) {
if (strpos($a, '</a>') === false) {
- $navigation[] = array('title' => trim(format_string($a)), 'url' => '');
+ $navigation[] = array('title' => $a, 'url' => '');
} else {
if (preg_match('/<a.*href="([^"]*)">(.*)<\/a>/', $a, $matches)) {
- $navigation[] = array('title' => trim(format_string($matches[2])), 'url' => $matches[1]);
+ $navigation[] = array('title' => $matches[2], 'url' => $matches[1]);
}
}
}
$output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
$output .= '<li class="first"><a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
- .$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))
+ .$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))
&& !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest())
? '/my' : '') .'/">'. format_string($site->shortname) ."</a></li>\n";
foreach ($navigation as $navitem) {
- extract($navitem);
- $title = strip_tags(format_string($title));
+ $title = trim(strip_tags(format_string($navitem['title'], false)));
+ $url = $navitem['url'];
+
if (empty($url)) {
$output .= '<li class="first">'."$separator $title</li>\n";
} else {
- $output .= '<li class="first">' . $separator . ' <a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
+ $output .= '<li class="first">'.$separator.' <a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
.$url.'">'."$title</a></li>\n";
}
}