Skip to content
Browse files

I expanded the list navmenulist for better handling with:

_ a header
_ spans for the section titles

It's still work in progress
  • Loading branch information...
1 parent a5c5a18 commit 143211e5dabcc75717231367d3838ea8417734f1 urs_hunkler committed Mar 29, 2005
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/weblib.php
View
14 lib/weblib.php
@@ -3132,7 +3132,7 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
$sections = get_records('course_sections','course',$course->id,'section','section,visible,summary');
if (!empty($THEME->makenavmenulist)) { /// A hack to produce an XHTML navmenu list for use in themes
- $THEME->navmenulist = navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $width=50, $cm);
+ $THEME->navmenulist = navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $width, $cm);
}
foreach ($modinfo as $mod) {
@@ -3241,7 +3241,7 @@ function navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $wid
$flag = false;
$menu = array();
- $menu[] = '<ul>';
+ $menu[] = '<ul class="floatnav"><li><span class="list-title section">Direkt zu...</span><ul>';
foreach ($modinfo as $mod) {
if ($mod->mod == 'label') {
continue;
@@ -3251,7 +3251,7 @@ function navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $wid
break;
}
- if ($mod->section > 0 and $section <> $mod->section) {
+ if ($mod->section >= 0 and $section <> $mod->section) {
$thissection = $sections[$mod->section];
if ($thissection->visible or !$course->hiddensections or $isteacher) {
@@ -3260,12 +3260,12 @@ function navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $wid
$menu[] = '</ul></li>';
}
if ($course->format == 'weeks' or empty($thissection->summary)) {
- $menu[] = '<li>'. $strsection ." ". $mod->section;
+ $menu[] = '<li><span class="section">'. $strsection ." ". $mod->section . '</span>';
} else {
if (strlen($thissection->summary) < ($width-3)) {
- $menu[] = '<li>'.$thissection->summary;
+ $menu[] = '<li><span class="section">'.$thissection->summary . '</span>';
} else {
- $menu[] = '<li>'.substr($thissection->summary, 0, $width).'...';
+ $menu[] = '<li><span class="section">'.substr($thissection->summary, 0, $width).'...' . '</span>';
}
}
$menu[] = '<ul>';
@@ -3297,7 +3297,7 @@ function navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $wid
if ($doneheading) {
$menu[] = '</ul></li>';
}
- $menu[] = '</ul>';
+ $menu[] = '</ul></li></ul>';
return implode("\n", $menu);
}

0 comments on commit 143211e

Please sign in to comment.
Something went wrong with that request. Please try again.