Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…splay the block
  • Loading branch information...
commit 3bf3451872a70e2cdf30ea45e96b1b06f2016c74 1 parent 2c66b71
@satrun77 satrun77 authored
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
@@ -75,6 +75,11 @@ function get_content() {
$courseformatoptions = course_get_format($course)->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;
+ }
+
if ($course->format == 'weeks' or $course->format == 'weekscss') {
$highlight = ceil((time()-$course->startdate)/604800);
$linktext = get_string('jumptocurrentweek', 'block_section_links');
Please sign in to comment.
Something went wrong with that request. Please try again.