'enrol_plugins_enabled' => 'manual',
'style' => 'default',
'template' => 'default',
- 'theme' => 'standard', //TODO: MDL-21149 replace with some new default theme when implemented
+ 'theme' => theme_config::DEFAULT_THEME,
'filter_multilang_converted' => 1,
'siteidentifier' => random_string(32).get_host_from_url($CFG->wwwroot),
'backup_version' => 2008111700,
* @since Moodle 2.0
*/
class theme_config {
+ /**
+ * @var string default theme, used when requested theme not found
+ * TODO: MDL-21149 replace with some new default theme when implemented
+ */
+ const DEFAULT_THEME = 'standard';
+
/**
* You can base your theme on other themes by linking to the other theme as
* parents. This lets you use the CSS and layouts from the other themes
if ($config = theme_config::find_theme_config($themename, $settings)) {
return new theme_config($config);
+
+ } else if ($themename == theme_config::DEFAULT_THEME) {
+ throw new coding_exception('Default theme '.theme_config::DEFAULT_THEME.' not available or broken!');
+
} else {
// bad luck, the requested theme has some problems - admin see details in theme config
- return new theme_config(theme_config::find_theme_config('standard', $settings)); // TODO: use some other default MDL-21149
+ return new theme_config(theme_config::find_theme_config(theme_config::DEFAULT_THEME, $settings));
}
}
public function test_cannot_set_course_once_theme_set() {
// Setup fixture
- $this->testpage->force_theme('standard');
+ $this->testpage->force_theme(theme_config::DEFAULT_THEME);
$course = $this->create_a_course();
// Set expectation.
$this->expectException();
public function test_cannot_set_category_once_theme_set() {
// Setup fixture
- $this->testpage->force_theme('standard');
+ $this->testpage->force_theme(theme_config::DEFAULT_THEME);
// Set expectation.
$this->expectException();
// Exercise SUT