Skip to content

Commit

Permalink
course MDL-23996 section names now used in jump to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Aug 30, 2010
1 parent 6162086 commit 47e75d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
8 changes: 1 addition & 7 deletions course/format/topics/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,7 @@

if (!empty($displaysection) and $displaysection != $section) { // Check this topic is visible
if ($showsection) {
$strsummary = strip_tags(format_string($thissection->summary,true));
if (strlen($strsummary) < 57) {
$strsummary = ' - '.$strsummary;
} else {
$strsummary = ' - '.substr($strsummary, 0, 60).'...';
}
$sectionmenu[$section] = s($section.$strsummary);
$sectionmenu[$section] = get_section_name($course, $thissection);
}
$section++;
continue;
Expand Down
2 changes: 1 addition & 1 deletion course/format/weeks/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

if (!empty($displaysection) and $displaysection != $section) { // Check this week is visible
if ($showsection) {
$sectionmenu[$section] = s("$strweek $section | $weekday - $endweekday");
$sectionmenu[$section] = get_section_name($course, $thissection);
}
$section++;
$weekdate = $nextweekdate;
Expand Down
16 changes: 9 additions & 7 deletions course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,15 @@
// go to another page, (c) clicks Back button - the page will
// automatically reload. Otherwise it would start with the wrong tick
// values.
print '<form action="."><div><input type="hidden" id="completion_dynamic_change"
name="completion_dynamic_change" value="0" /></div></form>';
echo html_writer::start_tag('form', array('action'=>'.', 'method'=>'get'));
echo html_writer::start_tag('div');
echo html_writer::empty_tag('input', array('type'=>'hidden', 'id'=>'completion_dynamic_change', 'name'=>'completion_dynamic_change', 'value'=>'0'));
echo html_writer::end_tag('div');
echo html_writer::end_tag('form');
}

// Course wrapper start.
echo '<div class="course-content">';
echo html_writer::start_tag('div', array('class'=>'course-content'));

$modinfo =& get_fast_modinfo($COURSE);
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
Expand Down Expand Up @@ -242,16 +245,15 @@
// Include the actual course format.
require($CFG->dirroot .'/course/format/'. $course->format .'/format.php');
// Content wrapper end.
echo "</div>\n\n";

echo html_writer::end_tag('div');

// Use AJAX?
if ($useajax && has_capability('moodle/course:manageactivities', $context)) {
// At the bottom because we want to process sections and activities
// after the relevant html has been generated. We're forced to do this
// because of the way in which lib/ajax/ajaxcourse.js is written.

echo '<script type="text/javascript" ';
echo "src=\"{$CFG->wwwroot}/lib/ajax/ajaxcourse.js\"></script>\n";
echo html_writer::script(false, new moodle_url('/lib/ajax/ajaxcourse.js'));
$COURSE->javascriptportal->print_javascript($course->id);
}

Expand Down

0 comments on commit 47e75d0

Please sign in to comment.