Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 143211e5dabcc75717231367d3838ea8417734f1 1 parent a5c5a18
urs_hunkler authored

Showing 1 changed file with 7 additions and 7 deletions. Show diff stats Hide diff stats

  1. +7 7 lib/weblib.php
14 lib/weblib.php
@@ -3132,7 +3132,7 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
3132 3132 $sections = get_records('course_sections','course',$course->id,'section','section,visible,summary');
3133 3133
3134 3134 if (!empty($THEME->makenavmenulist)) { /// A hack to produce an XHTML navmenu list for use in themes
3135   - $THEME->navmenulist = navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $width=50, $cm);
  3135 + $THEME->navmenulist = navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $width, $cm);
3136 3136 }
3137 3137
3138 3138 foreach ($modinfo as $mod) {
@@ -3241,7 +3241,7 @@ function navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $wid
3241 3241 $flag = false;
3242 3242 $menu = array();
3243 3243
3244   - $menu[] = '<ul>';
  3244 + $menu[] = '<ul class="floatnav"><li><span class="list-title section">Direkt zu...</span><ul>';
3245 3245 foreach ($modinfo as $mod) {
3246 3246 if ($mod->mod == 'label') {
3247 3247 continue;
@@ -3251,7 +3251,7 @@ function navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $wid
3251 3251 break;
3252 3252 }
3253 3253
3254   - if ($mod->section > 0 and $section <> $mod->section) {
  3254 + if ($mod->section >= 0 and $section <> $mod->section) {
3255 3255 $thissection = $sections[$mod->section];
3256 3256
3257 3257 if ($thissection->visible or !$course->hiddensections or $isteacher) {
@@ -3260,12 +3260,12 @@ function navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $wid
3260 3260 $menu[] = '</ul></li>';
3261 3261 }
3262 3262 if ($course->format == 'weeks' or empty($thissection->summary)) {
3263   - $menu[] = '<li>'. $strsection ." ". $mod->section;
  3263 + $menu[] = '<li><span class="section">'. $strsection ." ". $mod->section . '</span>';
3264 3264 } else {
3265 3265 if (strlen($thissection->summary) < ($width-3)) {
3266   - $menu[] = '<li>'.$thissection->summary;
  3266 + $menu[] = '<li><span class="section">'.$thissection->summary . '</span>';
3267 3267 } else {
3268   - $menu[] = '<li>'.substr($thissection->summary, 0, $width).'...';
  3268 + $menu[] = '<li><span class="section">'.substr($thissection->summary, 0, $width).'...' . '</span>';
3269 3269 }
3270 3270 }
3271 3271 $menu[] = '<ul>';
@@ -3297,7 +3297,7 @@ function navmenulist($course, $sections, $modinfo, $isteacher, $strsection, $wid
3297 3297 if ($doneheading) {
3298 3298 $menu[] = '</ul></li>';
3299 3299 }
3300   - $menu[] = '</ul>';
  3300 + $menu[] = '</ul></li></ul>';
3301 3301
3302 3302 return implode("\n", $menu);
3303 3303 }

0 comments on commit 143211e

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