From 3372adddb355a0680b2a3feb6692d29b25d514a6 Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Tue, 7 Sep 2021 13:13:29 +0800 Subject: [PATCH] MDL-72450 theme: Allow themes to specify whether they use course index Introduces a new theme config 'usecourseindex' which allows themes to specify whether they implement and use course index. --- lib/outputlib.php | 8 +++++++- theme/upgrade.txt | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index 0462b35173e..aecd3f47db6 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -678,6 +678,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)) { diff --git a/theme/upgrade.txt b/theme/upgrade.txt index b52dbc47e34..605cc11a824 100644 --- a/theme/upgrade.txt +++ b/theme/upgrade.txt @@ -1,6 +1,9 @@ This files describes API changes in /theme/* themes, information provided here is intended especially for theme designer. +=== 4.0 === +* A new theme config 'usescourseindex' allows a theme to specify whether it implements and uses course index. + === 3.11 === * The classname 'viewmode-cobmined' in course/management.php has been changed to 'viewmode-combined' -- 2.11.4.GIT