Merge branch 'wip-mdl-33027' of git://github.com/rajeshtaneja/moodle

This commit is contained in:
Dan Poltawski 2012-05-22 11:54:30 +08:00
commit c1e1560843
2 changed files with 42 additions and 16 deletions

View File

@ -261,10 +261,15 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
* @return string HTML to output.
*/
protected function section_summary($section, $course) {
// If section is hidden then display grey section link
$classattr = 'section-summary clearfix';
If (!$section->visible) {
$classattr .= ' dimmed_text';
}
$o = '';
$o.= html_writer::start_tag('li', array('id' => 'section-'.$section->section,
'class' => 'section-summary clearfix'));
'class' => $classattr));
$title = get_section_name($course, $section);
$o.= html_writer::start_tag('a', array('href' => course_get_url($course, $section->section)));
@ -351,9 +356,13 @@ 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) {
$params = array();
if (!$sections[$back]->visible) {
$params = array('class' => 'dimmed_text');
}
$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);
$links['previous'] = html_writer::link(course_get_url($course, $back), $previouslink, $params);
}
$back--;
}
@ -361,9 +370,13 @@ 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) {
$params = array();
if (!$sections[$forward]->visible) {
$params = array('class' => 'dimmed_text');
}
$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);
$links['next'] = html_writer::link(course_get_url($course, $forward), $nextlink, $params);
}
$forward++;
}
@ -444,7 +457,6 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
echo $this->start_section_list();
echo $this->section_hidden($displaysection);
echo $this->end_section_list();
echo $sectionnavlinks;
}
// Can't view this section.
return;
@ -463,20 +475,24 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
echo $this->end_section_list();
}
// Start single-section div
echo html_writer::start_tag('div', array('class' => 'single-section'));
// Title with section navigation links.
$sectionnavlinks = $this->get_nav_links($course, $sections, $displaysection);
$sectiontitle = '';
$sectiontitle .= html_writer::start_tag('div', array('class' => 'section-navigation headingblock header'));
$sectiontitle .= html_writer::start_tag('div', array('class' => 'section-navigation header headingblock'));
$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'));
// Title attributes
$titleattr = 'mdl-align title';
if (!$sections[$displaysection]->visible) {
$titleattr .= ' dimmed_text';
}
$sectiontitle .= html_writer::tag('div', get_section_name($course, $sections[$displaysection]), array('class' => $titleattr));
$sectiontitle .= html_writer::end_tag('div');
echo $sectiontitle;
// Show completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
// Copy activity clipboard..
echo $this->course_activity_clipboard($course, $displaysection);
@ -486,6 +502,10 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
// The requested section page.
$thissection = $sections[$displaysection];
echo $this->section_header($thissection, $course, true);
// Show completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
print_section($course, $thissection, $mods, $modnamesused, true);
if ($PAGE->user_is_editing()) {
print_section_add_menus($course, $displaysection, $modnames);
@ -502,6 +522,9 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$sectionbottomnav .= html_writer::tag('div', $courselink, array('class' => 'mdl-align'));
$sectionbottomnav .= html_writer::end_tag('div');
echo $sectionbottomnav;
// close single-section div.
echo html_writer::end_tag('div');
}
/**

View File

@ -11,12 +11,14 @@
.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: 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; }
.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%; }
.course-content .single-section .section-navigation .mdl-left { font-weight: normal; float: left; margin-right: 1em; }
.course-content .single-section .section-navigation .mdl-left .larrow { margin-right: 0.1em; }
.course-content .single-section .section-navigation .mdl-right { font-weight: normal; float: right; margin-left: 1em; }
.course-content .single-section .section-navigation .mdl-right .rarrow { margin-left: 0.1em; }
.course-content .single-section .section-navigation .mdl-bottom { margin-top: 0; }
#page-site-index .subscribelink {text-align:right;}
#page-site-index .headingblock {margin-bottom: 9px;}
@ -29,6 +31,7 @@
.path-course-view .block.drag .header {cursor: move;}
.path-course-view .completionprogress {float:right;}
.path-course-view .completionprogress img.iconhelp {vertical-align:top;}
.path-course-view .single-section .completionprogress {margin-right: -3.5em; padding-left: 1.5em; padding-right: 0em;}
.path-course-view .section .summary {line-height:normal;}
.path-course-view li.activity {margin-right:20px; position:relative;}