Permalink
Browse files

MDL-38747 blocks: course format options 'numsections' is required to …

…display the block
  • Loading branch information...
1 parent c2ad901 commit 47ef2a432a8b5f7a009ca5d48ac7b6ec235a80bb @satrun77 satrun77 committed Jul 4, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 blocks/section_links/block_section_links.php
View
5 blocks/section_links/block_section_links.php
@@ -84,6 +84,11 @@ public function get_content() {
$courseformatoptions = $courseformat->get_format_options();
$context = context_course::instance($course->id);
+ // Course format options 'numsections' is required to display the block.
+ if (empty($courseformatoptions['numsections'])) {
+ return $this->content;
+ }
+
// Prepare the highlight value.
if ($course->format == 'weeks') {
$highlight = ceil((time() - $course->startdate) / 604800);

0 comments on commit 47ef2a4

Please sign in to comment.