Merge branch 'MDL-72450-master-1' of git://github.com/mihailges/moodle

This commit is contained in:
Ilya Tregubov 2021-10-18 08:26:49 +02:00
commit 731b069c4d
7 changed files with 92 additions and 4 deletions

View file

@ -677,6 +677,12 @@ class theme_config {
*/
public $precompiledcsscallback = null;
/**
* Whether the theme uses course index.
* @var bool
*/
public $usescourseindex = false;
/**
* Load the config.php file for a particular theme, and return an instance
* of this class. (That is, this is a factory method.)
@ -754,7 +760,7 @@ class theme_config {
'rendererfactory', 'csspostprocess', 'editor_sheets', 'editor_scss', 'rarrow', 'larrow', 'uarrow', 'darrow',
'hidefromselector', 'doctype', 'yuicssmodules', 'blockrtlmanipulations', 'blockrendermethod',
'scss', 'extrascsscallback', 'prescsscallback', 'csstreepostprocessor', 'addblockposition',
'iconsystem', 'precompiledcsscallback', 'haseditswitch');
'iconsystem', 'precompiledcsscallback', 'haseditswitch', 'usescourseindex');
foreach ($config as $key=>$value) {
if (in_array($key, $configurable)) {

View file

@ -955,8 +955,17 @@ class core_renderer extends renderer_base {
return '';
}
// Get a list of all the activities in the course.
$course = $this->page->cm->get_course();
$courseformat = course_get_format($course);
// If the theme implements course index and the current course format uses course index and the current
// page layout is not 'frametop' (this layout does not support course index), show no links.
if ($this->page->theme->usescourseindex && $courseformat->uses_course_index() &&
$this->page->pagelayout !== 'frametop') {
return '';
}
// Get a list of all the activities in the course.
$modules = get_fast_modinfo($course->id)->get_cms();
// Put the modules into an array in order by the position they are shown in the course.