MDL-14497 Fixed several minor bugs in navmenu()
This commit is contained in:
+8
-6
@@ -5306,23 +5306,25 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
|
|||||||
$nextmod = $mod;
|
$nextmod = $mod;
|
||||||
$flag = false;
|
$flag = false;
|
||||||
}
|
}
|
||||||
|
$localname = $mod->name;
|
||||||
if ($cm == $mod->id) {
|
if ($cm == $mod->id) {
|
||||||
$selected = $url;
|
$selected = $url;
|
||||||
$selectmod = $mod;
|
$selectmod = $mod;
|
||||||
$backmod = $previousmod;
|
$backmod = $previousmod;
|
||||||
$flag = true; // set flag so we know to use next mod for "next"
|
$flag = true; // set flag so we know to use next mod for "next"
|
||||||
$mod->name = $strjumpto;
|
$localname = $strjumpto;
|
||||||
$strjumpto = '';
|
$strjumpto = '';
|
||||||
} else {
|
} else {
|
||||||
$mod->name = strip_tags(format_string(urldecode($mod->name),true));
|
$localname = strip_tags(format_string($localname,true));
|
||||||
if (strlen($mod->name) > ($width+5)) {
|
$tl=textlib_get_instance();
|
||||||
$mod->name = substr($mod->name, 0, $width).'...';
|
if ($tl->strlen($localname) > ($width+5)) {
|
||||||
|
$localname = $tl->substr($localname, 0, $width).'...';
|
||||||
}
|
}
|
||||||
if (!$mod->visible) {
|
if (!$mod->visible) {
|
||||||
$mod->name = '('.$mod->name.')';
|
$localname = '('.$localname.')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$menu[$url] = $mod->name;
|
$menu[$url] = $localname;
|
||||||
if (empty($THEME->navmenuiconshide)) {
|
if (empty($THEME->navmenuiconshide)) {
|
||||||
$menustyle[$url] = 'style="background-image: url('.$CFG->modpixpath.'/'.$mod->modname.'/icon.gif);"'; // Unfortunately necessary to do this here
|
$menustyle[$url] = 'style="background-image: url('.$CFG->modpixpath.'/'.$mod->modname.'/icon.gif);"'; // Unfortunately necessary to do this here
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user