mirror of
https://github.com/moodle/moodle.git
synced 2025-03-13 20:26:32 +01:00
MDL-33027 theme: Hidden section link will be displayed dimmed in section navigation
This commit is contained in:
parent
c129f430bb
commit
bcf7175f4e
@ -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;
|
||||
@ -472,7 +484,12 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
|
||||
$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'));
|
||||
// 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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user