MDL-58300 block_myoverview: conditionally disable paging bar
authorSimey Lameze <simey@moodle.com>
Wed, 22 Mar 2017 07:10:17 +0000 (15:10 +0800)
committerDamyon Wiese <damyon@moodle.com>
Mon, 3 Apr 2017 03:37:09 +0000 (11:37 +0800)
Part of MDL-55611 epic.

blocks/myoverview/classes/output/courses_view.php

index bbd8635..8c932e8 100644 (file)
@@ -122,6 +122,7 @@ class courses_view implements renderable, templatable {
             $quantpages = ceil($total / $this::COURSES_PER_PAGE);
 
             if ($quantpages) {
+                $coursesview[$status]['pagingbar']['disabled'] = ($quantpages <= 1);
                 $coursesview[$status]['pagingbar']['pagecount'] = $quantpages;
                 $coursesview[$status]['pagingbar']['first'] = ['page' => '&laquo;', 'url' => '#'];
                 $coursesview[$status]['pagingbar']['last'] = ['page' => '&raquo;', 'url' => '#'];