Skip to content

Commit

Permalink
V2.9.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed May 18, 2015
1 parent ec626a6 commit 66c639f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ Version Information
===================
Version 2.9.0.2.
1. Added the capability to delete a section.
2. Tidy up column padding after testing with Shoehorn.

Version 2.9.0.1.
1. First 'release candidate' version for Moodle 2.9.
Expand Down
16 changes: 8 additions & 8 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
class format_topcoll_renderer extends format_section_renderer_base {

private $tccolumnwidth = 100; // Default width in percent of the column(s).
private $tccolumnpadding = 0; // Default padding in pixels of the column(s).
private $tccolumnpadding = 20; // Default padding in pixels of the column(s).
private $mobiletheme = false; // As not using a mobile theme we can react to the number of columns setting.
private $tablettheme = false; // As not using a tablet theme we can react to the number of columns setting.
private $courseformat = null; // Our course format object as defined in lib.php;
Expand Down Expand Up @@ -91,12 +91,12 @@ protected function start_toggle_section_list() {
if ($this->tcsettings['layoutcolumnorientation'] == 1) {
$style .= 'width:' . $this->tccolumnwidth . '%;'; // Vertical columns.
} else {
$style .= 'width:100%;'; // Horizontal columns.
$style .= 'width: 100%;'; // Horizontal columns.
}
if ($this->mobiletheme === false) {
$classes .= ' ctlayout';
}
$style .= ' padding:' . $this->tccolumnpadding . 'px;';
$style .= ' padding: ' . $this->tccolumnpadding . 'px;';
$attributes = array('class' => $classes);
$attributes['style'] = $style;
return html_writer::start_tag('ul', $attributes);
Expand Down Expand Up @@ -275,7 +275,7 @@ protected function section_summary($section, $course, $mods) {
'aria-label' => $title
);
if ($this->tcsettings['layoutcolumnorientation'] == 2) { // Horizontal column layout.
$liattributes['style'] = 'width:' . $this->tccolumnwidth . '%;';
$liattributes['style'] = 'width: ' . $this->tccolumnwidth . '%;';
}
$o .= html_writer::start_tag('li', $liattributes);

Expand Down Expand Up @@ -339,7 +339,7 @@ protected function section_header($section, $course, $onsectionpage, $sectionret
'aria-label' => $this->courseformat->get_topcoll_section_name($course, $section, false)
);
if ($this->tcsettings['layoutcolumnorientation'] == 2) { // Horizontal column layout.
$liattributes['style'] = 'width:' . $this->tccolumnwidth . '%;';
$liattributes['style'] = 'width: ' . $this->tccolumnwidth . '%;';
}
$o .= html_writer::start_tag('li', $liattributes);

Expand Down Expand Up @@ -475,7 +475,7 @@ protected function section_hidden($section, $courseorid = null) {
'aria-label' => $this->courseformat->get_topcoll_section_name($course, $section, false)
);
if ($this->tcsettings['layoutcolumnorientation'] == 2) { // Horizontal column layout.
$liattributes['style'] = 'width:' . $this->tccolumnwidth . '%;';
$liattributes['style'] = 'width: ' . $this->tccolumnwidth . '%;';
}

$o .= html_writer::start_tag('li', $liattributes);
Expand Down Expand Up @@ -621,11 +621,11 @@ public function print_multiple_section_page($course, $sections, $mods, $modnames

$this->tccolumnwidth = 100 / $this->tcsettings['layoutcolumns'];
if ($this->tcsettings['layoutcolumnorientation'] == 2) { // Horizontal column layout.
$this->tccolumnwidth -= 1;
$this->tccolumnwidth -= 0.5;
} else {
$this->tccolumnwidth -= 0.2;
}
$this->tccolumnpadding = 0; // In 'px'.
$this->tccolumnpadding = 20; // In 'px'.
} else if ($this->tcsettings['layoutcolumns'] < 1) {
// Distributed default in plugin settings (and reset in database) or database has been changed incorrectly.
$this->tcsettings['layoutcolumns'] = 1;
Expand Down

0 comments on commit 66c639f

Please sign in to comment.