diff --git a/Readme.md b/Readme.md index b566a1bd..b8ef5fb0 100644 --- a/Readme.md +++ b/Readme.md @@ -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. diff --git a/renderer.php b/renderer.php index f2a3eb1f..bd611a18 100644 --- a/renderer.php +++ b/renderer.php @@ -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; @@ -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); @@ -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); @@ -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); @@ -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); @@ -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;