mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
Merge branch 'wip-mdl-32770' of git://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
154128a50f
@ -314,7 +314,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
* @param stdClass $course The course entry from DB
|
||||
* @param array $sections The course_sections entries from the DB
|
||||
* @param int $sectionno The section number in the coruse which is being dsiplayed
|
||||
* @return string HTML to output.
|
||||
* @return array associative array with previous and next section link
|
||||
*/
|
||||
protected function get_nav_links($course, $sections, $sectionno) {
|
||||
// FIXME: This is really evil and should by using the navigation API.
|
||||
@ -325,8 +325,9 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$back = $sectionno - 1;
|
||||
while ($back > 0 and empty($links['previous'])) {
|
||||
if ($canviewhidden || $sections[$back]->visible) {
|
||||
$links['previous'] = html_writer::link(course_get_url($course, $back),
|
||||
$this->output->larrow().$this->output->spacer().get_section_name($course, $sections[$back]));
|
||||
$previouslink = html_writer::tag('span', $this->output->larrow(), array('class' => 'larrow'));
|
||||
$previouslink .= get_section_name($course, $sections[$back]);
|
||||
$links['previous'] = html_writer::link(course_get_url($course, $back), $previouslink);
|
||||
}
|
||||
$back--;
|
||||
}
|
||||
@ -334,19 +335,14 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$forward = $sectionno + 1;
|
||||
while ($forward <= $course->numsections and empty($links['next'])) {
|
||||
if ($canviewhidden || $sections[$forward]->visible) {
|
||||
$links['next'] = html_writer::link(course_get_url($course, $forward),
|
||||
get_section_name($course, $sections[$forward]).$this->output->spacer().$this->output->rarrow());
|
||||
$nextlink = get_section_name($course, $sections[$forward]);
|
||||
$nextlink .= html_writer::tag('span', $this->output->rarrow(), array('class' => 'rarrow'));
|
||||
$links['next'] = html_writer::link(course_get_url($course, $forward), $nextlink);
|
||||
}
|
||||
$forward++;
|
||||
}
|
||||
|
||||
$o = '';
|
||||
$o.= html_writer::start_tag('div', array('class' => 'section-navigation yui3-g'));
|
||||
$o.= html_writer::tag('div', $links['previous'], array('class' => 'yui3-u'));
|
||||
$o.= html_writer::tag('div', $links['next'], array('class' => 'right yui3-u'));
|
||||
$o.= html_writer::end_tag('div');
|
||||
|
||||
return $o;
|
||||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -441,16 +437,19 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
echo $this->end_section_list();
|
||||
}
|
||||
|
||||
// Section next/previous links.
|
||||
// Title with section navigation links.
|
||||
$sectionnavlinks = $this->get_nav_links($course, $sections, $displaysection);
|
||||
echo $sectionnavlinks;
|
||||
$sectiontitle = '';
|
||||
$sectiontitle .= html_writer::start_tag('div', array('class' => 'section-navigation headingblock header'));
|
||||
$sectiontitle .= html_writer::tag('span', $sectionnavlinks['previous'], array('class' => 'mdl-left'));
|
||||
$sectiontitle .= html_writer::tag('span', $sectionnavlinks['next'], array('class' => 'mdl-right'));
|
||||
$sectiontitle .= html_writer::tag('div', get_section_name($course, $sections[$displaysection]), array('class' => 'mdl-align'));
|
||||
$sectiontitle .= html_writer::end_tag('div');
|
||||
echo $sectiontitle;
|
||||
|
||||
|
||||
// Title with completion help icon.
|
||||
// Show completion help icon.
|
||||
$completioninfo = new completion_info($course);
|
||||
echo $completioninfo->display_help_icon();
|
||||
$title = get_section_name($course, $sections[$displaysection]);
|
||||
echo $this->output->heading($title, 2, 'headingblock header outline');
|
||||
|
||||
// Copy activity clipboard..
|
||||
echo $this->course_activity_clipboard($course, $displaysection);
|
||||
@ -466,8 +465,17 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
print_section_add_menus($course, $displaysection, $modnames);
|
||||
}
|
||||
echo $this->section_footer();
|
||||
echo $sectionnavlinks;
|
||||
echo $this->end_section_list();
|
||||
|
||||
// Display section bottom navigation.
|
||||
$courselink = html_writer::link(course_get_url($course), get_string('returntomaincoursepage'));
|
||||
$sectionbottomnav = '';
|
||||
$sectionbottomnav .= html_writer::start_tag('div', array('class' => 'section-navigation mdl-bottom'));
|
||||
$sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['previous'], array('class' => 'mdl-left'));
|
||||
$sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['next'], array('class' => 'mdl-right'));
|
||||
$sectionbottomnav .= html_writer::tag('div', $courselink, array('class' => 'mdl-align'));
|
||||
$sectionbottomnav .= html_writer::end_tag('div');
|
||||
echo $sectionbottomnav;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1393,6 +1393,7 @@ $string['restoreusersprecheck'] = 'Checking user data';
|
||||
$string['restoreusersprecheckerror'] = 'Some problems were detected when checking user data';
|
||||
$string['restricted'] = 'Restricted';
|
||||
$string['returningtosite'] = 'Returning to this web site?';
|
||||
$string['returntomaincoursepage'] = 'Return to main course page';
|
||||
$string['returntooriginaluser'] = 'Return to {$a}';
|
||||
$string['revert'] = 'Revert';
|
||||
$string['role'] = 'Role';
|
||||
|
@ -11,8 +11,12 @@
|
||||
.course-content .section-summary { border: 1px solid #DDD; margin-top: 5px; list-style: none; }
|
||||
.course-content .section-summary .section-title { margin: 2px 5px 2px 5px; }
|
||||
.course-content .section-summary .summarytext { margin: 2px 5px 2px 5px; }
|
||||
.course-content .section-navigation { display: block; padding: 10px; }
|
||||
.course-content .section-navigation .right { float: right; }
|
||||
.course-content .section-navigation { display: block; padding: 0.5em; margin-top: 1em; margin-bottom: -0.5em !important; }
|
||||
.course-content .section-navigation .mdl-left { float: left; font-weight: normal; margin-right: 1em; }
|
||||
.course-content .section-navigation .mdl-left .larrow { margin-right: 0.1em; }
|
||||
.course-content .section-navigation .mdl-right { float: right; font-weight: normal; margin-left: 1em; }
|
||||
.course-content .section-navigation .mdl-right .rarrow { margin-left: 0.1em; }
|
||||
.course-content .section-navigation .mdl-bottom { font-weight: normal; margin-top: 0; }
|
||||
|
||||
#page-site-index .subscribelink {text-align:right;}
|
||||
#page-site-index .headingblock {margin-bottom: 9px;}
|
||||
|
Loading…
x
Reference in New Issue
Block a user