* @return string HTML to output.
*/
protected function section_summary($section, $course, $mods) {
+ $classattr = 'section main section-summary clearfix';
+ $linkclasses = '';
+
// If section is hidden then display grey section link
- $classattr = 'section-summary clearfix';
- If (!$section->visible) {
- $classattr .= ' dimmed_text';
+ if (!$section->visible) {
+ $classattr .= ' hidden';
+ $linkclasses .= ' dimmed_text';
+ } else if ($this->is_section_current($section, $course)) {
+ $classattr .= ' current';
}
$o = '';
- $o.= html_writer::start_tag('li', array('id' => 'section-'.$section->section,
- 'class' => $classattr));
+ $o .= html_writer::start_tag('li', array('id' => 'section-'.$section->section, 'class' => $classattr));
- $title = get_section_name($course, $section);
- $o.= html_writer::start_tag('a', array('href' => course_get_url($course, $section->section)));
- $o.= $this->output->heading($title, 3, 'header section-title');
- $o.= html_writer::end_tag('a');
+ $o .= html_writer::tag('div', '', array('class' => 'left side'));
+ $o .= html_writer::tag('div', '', array('class' => 'right side'));
+ $o .= html_writer::start_tag('div', array('class' => 'content'));
+
+ $title = html_writer::tag('a', get_section_name($course, $section),
+ array('href' => course_get_url($course, $section->section), 'class' => $linkclasses));
+ $o .= $this->output->heading($title, 3, 'section-title');
$o.= html_writer::start_tag('div', array('class' => 'summarytext'));
$o.= $this->format_summary_text($section);
$o.= $this->section_availability_message($section);
- $o.= html_writer::end_tag('li');
+ $o .= html_writer::end_tag('div');
+ $o .= html_writer::end_tag('li');
return $o;
}
)
);
- $strcancel= get_string('cancel');
-
- $o.= html_writer::start_tag('li', array('class' => 'clipboard'));
+ $o.= html_writer::start_tag('div', array('class' => 'clipboard'));
$o.= strip_tags(get_string('activityclipboard', '', $USER->activitycopyname));
$o.= ' ('.html_writer::link($url, get_string('cancel')).')';
- $o.= html_writer::end_tag('li');
+ $o.= html_writer::end_tag('div');
}
return $o;
return;
}
+ // Copy activity clipboard..
+ echo $this->course_activity_clipboard($course, $displaysection);
+
// General section if non-empty.
$thissection = $sections[0];
if ($thissection->summary or $thissection->sequence or $PAGE->user_is_editing()) {
$sectiontitle .= html_writer::end_tag('div');
echo $sectiontitle;
- // Copy activity clipboard..
- echo $this->course_activity_clipboard($course, $displaysection);
-
// Now the list of sections..
echo $this->start_section_list();
echo $OUTPUT->confirm(
get_string('duplicateconfirm', 'core', $a),
new single_button(
- new moodle_url('/course/modduplicate.php', array('cmid' => $cm->id, 'course' => $course->id)),
+ new moodle_url('/course/modduplicate.php', array(
+ 'cmid' => $cm->id, 'course' => $course->id, 'sr' => $sectionreturn)),
get_string('continue'),
'post'),
new single_button(
if (!$confirm or !confirm_sesskey()) {
$fullmodulename = get_string('modulename', $cm->modname);
- $optionsyes = array('confirm'=>1, 'delete'=>$cm->id, 'sesskey'=>sesskey());
- $optionsno = array('id'=>$cm->course);
+ $optionsyes = array('confirm'=>1, 'delete'=>$cm->id, 'sesskey'=>sesskey(), 'sr' => $sectionreturn);
$strdeletecheck = get_string('deletecheck', '', $fullmodulename);
$strdeletecheckfull = get_string('deletecheckfull', '', "$fullmodulename '$cm->name'");
// print_simple_box_start('center', '60%', '#FFAAAA', 20, 'noticebox');
echo $OUTPUT->box_start('noticebox');
$formcontinue = new single_button(new moodle_url("$CFG->wwwroot/course/mod.php", $optionsyes), get_string('yes'));
- $formcancel = new single_button(new moodle_url($return, $optionsno), get_string('no'), 'get');
+ $formcancel = new single_button($return, get_string('no'), 'get');
echo $OUTPUT->confirm($strdeletecheckfull, $formcontinue, $formcancel);
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
moveto_module($cm, $section, $beforecm);
+ $sectionreturn = $USER->activitycopysectionreturn;
unset($USER->activitycopy);
unset($USER->activitycopycourse);
unset($USER->activitycopyname);
+ unset($USER->activitycopysectionreturn);
rebuild_course_cache($section->course);
$section = $DB->get_record('course_sections', array('id'=>$cm->section), '*', MUST_EXIST);
- $USER->activitycopy = $copy;
- $USER->activitycopycourse = $cm->course;
- $USER->activitycopyname = $cm->name;
+ $USER->activitycopy = $copy;
+ $USER->activitycopycourse = $cm->course;
+ $USER->activitycopyname = $cm->name;
+ $USER->activitycopysectionreturn = $sectionreturn;
redirect(course_get_url($course, $sectionreturn));
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
require_once($CFG->libdir . '/filelib.php');
-$cmid = required_param('cmid', PARAM_INT);
-$courseid = required_param('course', PARAM_INT);
+$cmid = required_param('cmid', PARAM_INT);
+$courseid = required_param('course', PARAM_INT);
+$sectionreturn = optional_param('sr', 0, PARAM_INT);
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
$cm = get_coursemodule_from_id('', $cmid, $course->id, true, MUST_EXIST);
get_string('duplicatecontedit'),
'get'),
new single_button(
- new moodle_url('/course/view.php#section-' . $cm->sectionnum, array('id' => $cm->course)),
+ course_get_url($course, $sectionreturn),
get_string('duplicatecontcourse'),
'get')
);
} else {
echo $output->notification(get_string('duplicatesuccess', 'core', $a), 'notifysuccess');
- echo $output->continue_button(
- new moodle_url('/course/view.php#section-' . $cm->sectionnum, array('id' => $course->id))
- );
+ echo $output->continue_button(course_get_url($course, $sectionreturn));
}
echo $output->footer();
$string['activities'] = 'Activities';
$string['activities_help'] = 'Activities, such as forums, quizzes and wikis, enable interactive content to be added to the course.';
$string['activity'] = 'Activity';
-$string['activityclipboard'] = 'Moving this activity: <b>{$a}</b>';
+$string['activityclipboard'] = 'Moving this activity: {$a}';
$string['activityiscurrentlyhidden'] = 'Sorry, this activity is currently hidden';
$string['activitymodule'] = 'Activity module';
$string['activitymodules'] = 'Activity modules';
.course-content .section-summary .section-title { margin: 2px 5px 2px 5px; }
.course-content .section-summary .summarytext { margin: 2px 5px 2px 5px; }
.course-content .section-summary .section-summary-activities .activity-count {margin-right: 10px;color: #AAA; font-size: 12px; margin-right: 15px;}
+.course-content .section-summary .summary { margin-top: 5px; }
.course-content .single-section { margin-top: 1em; }
.course-content .single-section .section-navigation { display: block; padding: 0.5em; margin-bottom: -0.5em; }
.course-content .single-section .section-navigation .title { font-weight: bold; font-size: 108%; }
.path-course-view .weeks .current,
.path-course-view .topics .current,
.path-course-view .current td.side {background: #FFD991;}
+.path-course-view .section-summary.current {border-color: #FFD991;}
.path-course-view .weeks .hidden,
.path-course-view .topics .hidden,
.path-course-view .hidden td.side {background: #DDDDDD;}