Commit 644fcbb6 authored by Damyon Wiese's avatar Damyon Wiese
Browse files

MDL-55837 themes: base and canvas themes removed

Look for them in the plugins DB if you still need them.
parent 1f274485
......@@ -17,7 +17,7 @@
/**
* This script implements some useful svg manipulation tricks.
*
* @package theme_base
* @package core_admin
* @subpackage cli
* @copyright 2012 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
......@@ -25,7 +25,7 @@
define('CLI_SCRIPT', true);
require(__DIR__.'/../../../config.php');
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
// Now get cli options.
......@@ -45,10 +45,10 @@ if (!file_exists($path)) {
}
if ($options['ie9fix']) {
theme_base_recurse_svgs($path, '', 'theme_base_svgtool_ie9fix', $blacklist);
core_admin_recurse_svgs($path, '', 'core_admin_svgtool_ie9fix', $blacklist);
} else if ($options['noaspectratio']) {
theme_base_recurse_svgs($path, '', 'theme_base_svgtool_noaspectratio', $blacklist);
core_admin_recurse_svgs($path, '', 'core_admin_svgtool_noaspectratio', $blacklist);
} else {
$help =
......@@ -78,7 +78,7 @@ exit(0);
*
* @param string $file
*/
function theme_base_svgtool_ie9fix($file) {
function core_admin_svgtool_ie9fix($file) {
global $CFG;
if (strpos($file, $CFG->dirroot.DIRECTORY_SEPARATOR) === 0) {
......@@ -115,7 +115,7 @@ function theme_base_svgtool_ie9fix($file) {
*
* @param string $file
*/
function theme_base_svgtool_noaspectratio($file) {
function core_admin_svgtool_noaspectratio($file) {
global $CFG;
if (strpos($file, $CFG->dirroot.DIRECTORY_SEPARATOR) === 0) {
......@@ -155,7 +155,7 @@ function theme_base_svgtool_noaspectratio($file) {
* @param string $filecallback
* @param array $blacklist
*/
function theme_base_recurse_svgs($base, $sub, $filecallback, $blacklist) {
function core_admin_recurse_svgs($base, $sub, $filecallback, $blacklist) {
if (is_dir("$base/$sub")) {
$items = new DirectoryIterator("$base/$sub");
foreach ($items as $item) {
......@@ -163,7 +163,7 @@ function theme_base_recurse_svgs($base, $sub, $filecallback, $blacklist) {
continue;
}
$file = $item->getFilename();
theme_base_recurse_svgs("$base/$sub", $file, $filecallback, $blacklist);
core_admin_recurse_svgs("$base/$sub", $file, $filecallback, $blacklist);
}
unset($item);
unset($items);
......
......@@ -67,7 +67,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
$category2->name = 'Root Test Category 2';
$category2->idnumber = 'rootcattest2';
$category2->desc = 'Description for root test category 1';
$category2->theme = 'base';
$category2->theme = 'bootstrapbase';
$categories = array(
array('name' => $category1->name, 'parent' => 0),
array('name' => $category2->name, 'parent' => 0, 'idnumber' => $category2->idnumber,
......@@ -395,7 +395,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
$course2['enablecompletion'] = 1;
$course2['completionnotify'] = 1;
$course2['lang'] = 'en';
$course2['forcetheme'] = 'base';
$course2['forcetheme'] = 'bootstrapbase';
$course3['fullname'] = 'Test course 3';
$course3['shortname'] = 'Testcourse3';
$course3['categoryid'] = $category->id;
......@@ -1061,7 +1061,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
$course2['defaultgroupingid'] = 0;
$course2['enablecompletion'] = 1;
$course2['lang'] = 'en';
$course2['forcetheme'] = 'base';
$course2['forcetheme'] = 'bootstrapbase';
$courses = array($course1, $course2);
$updatedcoursewarnings = core_course_external::update_courses($courses);
......
......@@ -1664,9 +1664,9 @@ class core_plugin_manager {
'repository' => array('alfresco'),
'tinymce' => array('dragmath'),
'tool' => array('bloglevelupgrade', 'qeupgradehelper', 'timezoneimport'),
'theme' => array('mymobile', 'afterburner', 'anomaly', 'arialist', 'binarius', 'boxxie', 'brick', 'formal_white',
'formfactor', 'fusion', 'leatherbound', 'magazine', 'nimble', 'nonzero', 'overlay', 'serenity', 'sky_high',
'splash', 'standard', 'standardold'),
'theme' => array('afterburner', 'anomaly', 'arialist', 'base', 'binarius', 'boxxie', 'brick', 'canvas',
'formal_white', 'formfactor', 'fusion', 'leatherbound', 'magazine', 'mymobile', 'nimble', 'nonzero',
'overlay', 'serenity', 'sky_high', 'splash', 'standard', 'standardold'),
'webservice' => array('amf'),
);
......@@ -1900,7 +1900,7 @@ class core_plugin_manager {
),
'theme' => array(
'base', 'bootstrapbase', 'canvas', 'clean', 'more'
'bootstrapbase', 'clean', 'more'
),
'tool' => array(
......
......@@ -2177,5 +2177,51 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2016082200.00);
}
if ($oldversion < 2016091900.00) {
// Removing the themes from core.
$themes = array('base', 'canvas');
foreach ($themes as $key => $theme) {
if (check_dir_exists($CFG->dirroot . '/theme/' . $theme, false)) {
// Ignore the themes that have been re-downloaded.
unset($themes[$key]);
}
}
if (!empty($themes)) {
list($insql, $inparams) = $DB->get_in_or_equal($themes, SQL_PARAMS_NAMED);
// Replace the theme usage.
$DB->set_field_select('course', 'theme', 'clean', "theme $insql", $inparams);
$DB->set_field_select('course_categories', 'theme', 'clean', "theme $insql", $inparams);
$DB->set_field_select('user', 'theme', 'clean', "theme $insql", $inparams);
$DB->set_field_select('mnet_host', 'theme', 'clean', "theme $insql", $inparams);
// Replace the theme configs.
if (in_array(get_config('core', 'theme'), $themes)) {
set_config('theme', 'clean');
}
if (in_array(get_config('core', 'thememobile'), $themes)) {
set_config('thememobile', 'clean');
}
if (in_array(get_config('core', 'themelegacy'), $themes)) {
set_config('themelegacy', 'clean');
}
if (in_array(get_config('core', 'themetablet'), $themes)) {
set_config('themetablet', 'clean');
}
// Hacky emulation of plugin uninstallation.
foreach ($themes as $theme) {
unset_all_config_for_plugin('theme_' . $theme);
}
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2016091900.00);
}
return true;
}
......@@ -488,8 +488,8 @@ class theme_config {
$this->name = $config->name;
$this->dir = $config->dir;
if ($this->name != 'base') {
$baseconfig = theme_config::find_theme_config('base', $this->settings);
if ($this->name != 'bootstrapbase') {
$baseconfig = theme_config::find_theme_config('bootstrapbase', $this->settings);
} else {
$baseconfig = $config;
}
......@@ -510,9 +510,7 @@ class theme_config {
// verify all parents and load configs and renderers
foreach ($this->parents as $parent) {
if ($parent == 'base') {
$parent_config = $baseconfig;
} else if (!$parent_config = theme_config::find_theme_config($parent, $this->settings)) {
if (!$parent_config = theme_config::find_theme_config($parent, $this->settings)) {
// this is not good - better exclude faulty parents
continue;
}
......@@ -1947,8 +1945,8 @@ class theme_config {
}
}
// Last resort, try the base theme for names
return get_string('region-' . $region, 'theme_base');
// Last resort, try the bootstrapbase theme for names
return get_string('region-' . $region, 'theme_bootstrapbase');
}
/**
......
......@@ -360,7 +360,7 @@ class core_user_testcase extends advanced_testcase {
// Test against theme property choices.
$choices = core_user::get_property_choices('theme');
$this->assertArrayHasKey('base', $choices);
$this->assertArrayHasKey('bootstrapbase', $choices);
$this->assertArrayHasKey('clean', $choices);
$this->assertArrayNotHasKey('unknowntheme', $choices);
$this->assertArrayNotHasKey('wrongtheme', $choices);
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Configuration for Moodle's base theme.
*
* This theme is special, and implements a minimalist theme with only
* basic layout. It is intended as a base for other themes to build upon.
* It is not recommend to actually choose this theme for production sites!
*
* DO NOT COPY THIS TO START NEW THEMES!
* Start with another theme, like "standard".
*
* For full information about creating Moodle themes, see:
* http://docs.moodle.org/dev/Themes_2.0
*
* @package theme_base
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$THEME->name = 'base';
$THEME->parents = array();
$THEME->sheets = array(
'pagelayout', // Must come first: Page layout.
'core', // Must come second: General styles.
'admin',
'blocks',
'calendar',
'course',
'dock',
'grade',
'message',
'question',
'user',
'tabs',
'filemanager',
'templates',
'autocomplete',
'search',
'modal'
);
$THEME->editor_sheets = array('editor');
$THEME->layouts = array(
// Most backwards compatible layout without the blocks - this is the layout used by default.
'base' => array(
'file' => 'general.php',
'regions' => array(),
),
// Standard layout with blocks, this is recommended for most pages with general information.
'standard' => array(
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
),
// Main course page.
'course' => array(
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
'options' => array('langmenu'=>true),
),
'coursecategory' => array(
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
),
// Part of course, typical for modules - default page layout if $cm specified in require_login().
'incourse' => array(
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
),
// The site home page.
'frontpage' => array(
'file' => 'frontpage.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
),
// Server administration scripts.
'admin' => array(
'file' => 'general.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// My dashboard page.
'mydashboard' => array(
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
'options' => array('langmenu'=>true),
),
// My public page.
'mypublic' => array(
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
),
'login' => array(
'file' => 'general.php',
'regions' => array(),
'options' => array('langmenu'=>true),
),
// Pages that appear in pop-up windows - no navigation, no blocks, no header.
'popup' => array(
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologininfo'=>true, 'nocourseheaderfooter'=>true),
),
// No blocks and minimal footer - used for legacy frame layouts only!
'frametop' => array(
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
// Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible.
'embedded' => array(
'file' => 'embedded.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// Used during upgrade and install, and for the 'This site is undergoing maintenance' message.
// This must not have any blocks, and it is good idea if it does not have links to
// other places - for example there should not be a home link in the footer...
'maintenance' => array(
'file' => 'general.php',
'regions' => array(),
'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'general.php',
'regions' => array(),
'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>false, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// The pagelayout used when a redirection is occuring.
'redirect' => array(
'file' => 'embedded.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// The pagelayout used for reports.
'report' => array(
'file' => 'report.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// The pagelayout used for safebrowser and securewindow.
'secure' => array(
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologinlinks'=>true, 'nocourseheaderfooter'=>true),
),
);
// We don't want the base theme to be shown on the theme selection screen, by setting
// this to true it will only be shown if theme designer mode is switched on.
$THEME->hidefromselector = true;
/** List of javascript files that need to included on each page */
$THEME->javascripts = array();
$THEME->javascripts_footer = array();
// Set this to the method you will use in your layout files for rendering blocks.
// It should be either blocks (default) or blocks_for_region.
$THEME->blockrendermethod = 'blocks_for_region';
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'theme_base', language 'en', branch 'MOODLE_20_STABLE'
*
* @package theme_base
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['pluginname'] = 'Base';
$string['region-side-post'] = 'Right';
$string['region-side-pre'] = 'Left';
$string['choosereadme'] = 'Base is a special minimalist theme with only basic layout. It is intended as a starting point for other themes to build upon. It is not recommend to actually choose this theme for production sites!';
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* The embedded layout for the base theme.
*
* @package theme_base
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
echo $OUTPUT->doctype(); ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<title><?php echo $PAGE->title ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
<?php echo $OUTPUT->standard_head_html() ?>
</head>
<body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses) ?>">
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<div id="page">
<!-- END OF HEADER -->
<div id="page-content" class="clearfix">
<?php echo $OUTPUT->main_content() ?>
</div>
<!-- START OF FOOTER -->
</div>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</body>
</html>
\ No newline at end of file
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* The frontpage layout for the base theme.
*
* @package theme_base
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
$showsidepre = $hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT);
$showsidepost = $hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT);
$custommenu = $OUTPUT->custom_menu();
$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
$bodyclasses = array();
if ($showsidepre && !$showsidepost) {
if (!right_to_left()) {
$bodyclasses[] = 'side-pre-only';
}else{
$bodyclasses[] = 'side-post-only';
}
} else if ($showsidepost && !$showsidepre) {
if (!right_to_left()) {
$bodyclasses[] = 'side-post-only';
}else{
$bodyclasses[] = 'side-pre-only';
}
} else if (!$showsidepost && !$showsidepre) {
$bodyclasses[] = 'content-only';
}
if ($hascustommenu) {
$bodyclasses[] = 'has_custom_menu';
}
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<title><?php echo $PAGE->title ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
<meta name="description" content="<?php p(strip_tags(format_text($SITE->summary, FORMAT_HTML))) ?>" />
<?php echo $OUTPUT->standard_head_html() ?>
</head>
<body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<div id="page">
<div id="page-header" class="clearfix">
<h1 class="headermain"><?php echo $PAGE->heading ?></h1>
<div class="headermenu"><?php
echo $OUTPUT->user_menu();
echo $OUTPUT->lang_menu();
echo $PAGE->headingmenu;
?></div>
<?php if ($hascustommenu) { ?>
<div id="custommenu"><?php echo $custommenu; ?></div>
<?php } ?>
</div>
<!-- END OF HEADER -->
<div id="page-content">
<div id="region-main-box">
<div id="region-post-box">
<div id="region-main-wrap">
<div id="region-main">
<div class="region-content">
<?php echo $OUTPUT->main_content() ?>
</div>
</div>
</div>
<?php if ($hassidepre OR (right_to_left() AND $hassidepost)) { ?>
<div id="region-pre" class="block-region">
<div class="region-content">
<?php
if (!right_to_left()) {
echo $OUTPUT->blocks_for_region('side-pre');
} elseif ($hassidepost) {
echo $OUTPUT->blocks_for_region('side-post');
} ?>
</div>
</div>
<?php } ?>
<?php if ($hassidepost OR (right_to_left() AND $hassidepre)) { ?>
<div id="region-post" class="block-region">
<div class="region-content">
<?php
if (!right_to_left()) {
echo $OUTPUT->blocks_for_region('side-post');
} elseif ($hassidepre) {
echo $OUTPUT->blocks_for_region('side-pre');
} ?>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<!-- START OF FOOTER -->
<div id="page-footer">
<p class="helplink">
<?php echo page_doc_link(get_string('moodledocslink')) ?>
</p>
<?php
echo $OUTPUT->login_info();
echo $OUTPUT->home_link();
echo $OUTPUT->standard_footer_html();
?>
</div>
<div class="clearfix"></div>
</div>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</body>
</html>
\ No newline at end of file
<?php
// This file is part of Moodle - http://moodle.org/
//