Commit 7a2dabcb authored by Frederic Massart's avatar Frederic Massart
Browse files

MDL-43784 theme: Removing all the old themes

parent 9b8555fb
......@@ -909,7 +909,9 @@ class core_plugin_manager {
'qformat' => array('blackboard'),
'enrol' => array('authorize'),
'tool' => array('bloglevelupgrade'),
'theme' => array('mymobile'),
'theme' => array('mymobile', 'afterburner', 'anomaly', 'arialist', 'binarius', 'boxxie', 'brick', 'formal_white',
'formfactor', 'fusion', 'leatherbound', 'magazine', 'nimble', 'nonzero', 'overlay', 'serenity', 'sky_high',
'splash', 'standard', 'standardold'),
);
if (!isset($plugins[$type])) {
......@@ -1111,11 +1113,7 @@ class core_plugin_manager {
),
'theme' => array(
'afterburner', 'anomaly', 'arialist', 'base', 'binarius', 'bootstrapbase',
'boxxie', 'brick', 'canvas', 'clean', 'formal_white', 'formfactor',
'fusion', 'leatherbound', 'magazine', 'nimble',
'nonzero', 'overlay', 'serenity', 'sky_high', 'splash',
'standard', 'standardold'
'base', 'bootstrapbase', 'canvas', 'clean'
),
'tool' => array(
......
......@@ -3183,5 +3183,50 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2014031400.04);
}
if ($oldversion < 2014032000.01) {
// Removing the themes from core.
$themes = array('afterburner', 'anomaly', 'arialist', 'binarius', 'boxxie', 'brick', 'formal_white', 'formfactor',
'fusion', 'leatherbound', 'magazine', 'nimble', 'nonzero', 'overlay', 'serenity', 'sky_high', 'splash',
'standard', 'standardold');
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]);
}
}
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, 2014032000.01);
}
return true;
}
......@@ -1261,7 +1261,7 @@ function disable_output_buffering() {
*/
function redirect_if_major_upgrade_required() {
global $CFG;
$lastmajordbchanges = 2014022600.00;
$lastmajordbchanges = 2014031900.00;
if (empty($CFG->version) or (float)$CFG->version < $lastmajordbchanges or
during_initial_install() or !empty($CFG->adminsetuppending)) {
try {
......
<?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/>.
/**
* Afterburner theme configuration.
*
* @package theme_afterburner
* @copyright 2011 Mary Evans
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$THEME->name = 'afterburner';
$THEME->parents = array('base');
$THEME->sheets = array(
'afterburner_pagelayout', // Must come first: page layout.
'afterburner_styles', // Must come second: default styles.
'afterburner_menu',
'afterburner_blocks',
'afterburner_mod',
'afterburner_calendar',
'afterburner_dock',
'afterburner_rtl',
'afterburner_responsive',
'afterburner_settings',
);
$THEME->parents_exclude_sheets = array(
'base' => array(
'pagelayout',
'dock'
),
);
$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' => 'default.php',
'regions' => array(),
),
// Standard layout with blocks, this is recommended for most pages with default information.
'standard' => array(
'file' => 'default.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
),
// Main course page.
'course' => array(
'file' => 'default.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
'options' => array('langmenu'=>true),
),
'coursecategory' => array(
'file' => 'default.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' => 'default.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
),
// The site home page.
'frontpage' => array(
'file' => 'default.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
'options' => array('langmenu'=>true),
),
// Server administration scripts.
'admin' => array(
'file' => 'default.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// My dashboard page.
'mydashboard' => array(
'file' => 'default.php',
'regions' => array('side-post'),
'defaultregion' => 'side-post',
'options' => array('langmenu'=>true),
),
// My public page.
'mypublic' => array(
'file' => 'default.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
'login' => array(
'file' => 'default.php',
'regions' => array(),
'options' => array('langmenu'=>true),
),
// Pages that appear in pop-up windows - no navigation, no blocks, no header.
'popup' => array(
'file' => 'default.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' => 'default.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
// Embedded pages, like iframe/object embeded in moodleform - it needs as much space as possible.
'embedded' => array(
'file' => 'embedded.php',
'regions' => array()
),
// 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' => 'default.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' => 'default.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()
),
// The pagelayout used for reports.
'report' => array(
'file' => 'default.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// The pagelayout used for safebrowser and securewindow.
'secure' => array(
'file' => 'default.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologinlinks'=>true, 'nocourseheaderfooter'=>true),
),
);
$THEME->enable_dock = true;
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->csspostprocess = 'afterburner_process_css';
<?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/>.
/**
* Afterburner upgrades.
*
* @package theme_afterburner
* @copyright 2013 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Upgrade steps for the Afterburner theme.
*
* @param int $oldversion
* @return bool
*/
function xmldb_theme_afterburner_upgrade($oldversion) {
global $CFG, $DB, $OUTPUT;
$dbman = $DB->get_manager();
if ($oldversion < 2013041200) {
// Migrate logo URL.
$logo = get_config('theme_afterburner', 'logo');
if ($logo === '') {
// No logo means nothing to do.
} else if ($logo = clean_param($logo, PARAM_URL)) {
require_once("$CFG->libdir/filelib.php");
if ($content = download_file_content($logo)) {
$filename = preg_replace('/^.*\//', '', $logo);
if (!$filename = clean_param($filename, PARAM_FILE)) {
// Some name is better than no name...
$filename = 'logo.jpg';
}
$fs = get_file_storage();
$record = array(
'contextid' => context_system::instance()->id, 'component' => 'theme_afterburner',
'filearea' => 'logo', 'itemid'=>0, 'filepath'=>'/', 'filename'=>$filename);
$fs->create_file_from_string($record, $content);
set_config('logo', '/'.$filename, 'theme_afterburner');
unset($content);
} else {
unset_config('theme_afterburner', 'logo');
}
} else {
// Prompt for new logo, the old setting was invalid.
unset_config('theme_afterburner', 'logo');
}
upgrade_plugin_savepoint(true, 2013041200, 'theme', 'afterburner');
}
// Moodle v2.5.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
<?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_afterburner', language 'en'
*
* @package theme_afterburner
* @copyright 2011
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['configtitle'] = 'Afterburner Custom Settings';
$string['pluginname'] = 'Afterburner';
$string['region-side-post'] = 'Right';
$string['region-side-pre'] = 'Left';
$string['logo'] = 'Logo';
$string['logodesc'] = 'Please add your custom logo if you want to replace the default logo for this theme.<br />For your information, the default logo is a JPG image 320px (wide) by 75px (high)';
$string['footnote'] = 'Footnote';
$string['footnotedesc'] = 'Whatever you add to this textarea will be displayed in the footer of every page.';
$string['customcss'] = 'Custom CSS';
$string['customcssdesc'] = 'Whatever CSS rules you add to this textarea will be reflected in every page, making for easier customization of this theme.';
$string['choosereadme'] = '
<div class="clearfix">
<div class="theme_screenshot">
<h2>Afterburner</h2>
<img src="afterburner/pix/screenshot.jpg" />
<h3>Theme Discussion Forum:</h3>
<p><a href="http://moodle.org/mod/forum/view.php?id=46">http://moodle.org/mod/forum/view.php?id=46</a></p>
<h3>Theme Credits</h3>
<p><a href="http://docs.moodle.org/en/Theme_credits">http://docs.moodle.org/en/Theme_credits</a></p>
<h3>Theme Documentation:</h3>
<p><a href="http://docs.moodle.org/en/Themes">http://docs.moodle.org/en/Themes</a></p><h3>Report a bug:</h3><p><a href="http://tracker.moodle.org">http://tracker.moodle.org</a></p>
</div>
<div class="theme_description">
<h2>About</h2>
<p>Afterburner is a three-column, fluid-width theme coded for Moodle 2.0. It makes use of custom menus that appear below the site title on every page. An added function, which allows users to login and logout, has now been integrated into the custom menu for this theme.</p>
<h2>Parents</h2>
<p>This theme is built on Base, a parent theme included in the Moodle core. If you wish to modify aspects of this theme, beyond the settings offered, we advise creating a new theme using this theme and Base theme as parent themes, so any updates to these parent themes, in the core, will find their way into your new theme.</p>
<h2>Credits</h2>
<p>This design was originally created for Moodle 1.9 by Patrick Malley of NewSchool Learning (www.newschoollearning.com)from an original design by Rocket Themes (www.rockettheme.com) before being ported to Moodle 2.0 by Mary Evans of NewSchool Learning (contact@newschoollearning.com).</p>
<h2>License</h2>
<p>This, and all other themes included in the Moodle core, are licensed under the <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>.</p>
</div>
</div>';
<?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 default layout for the afterburner theme.
*
* @package theme_afterburner
* @copyright 2011 Mary Evans
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$hasheading = ($PAGE->heading);
$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
$hasfooter = (empty($PAGE->layout_options['nofooter']));
$hassidepre = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-pre', $OUTPUT));
$hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-post', $OUTPUT));
$haslogininfo = (empty($PAGE->layout_options['nologininfo']));
$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));
$hasfootnote = (!empty($PAGE->theme->settings->footnote));
$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
$courseheader = $OUTPUT->course_header();
$coursecontentheader = $OUTPUT->course_content_header();
if (empty($PAGE->layout_options['nocoursefooter'])) {
$coursecontentfooter = $OUTPUT->course_content_footer();
$coursefooter = $OUTPUT->course_footer();
}
}
$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="viewport" content="width=device-width, initial-scale=1">
<?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-wrapper">
<div id="page">
<?php if ($hasheading) { ?>
<div id="page-header">
<a class="logo" href="<?php echo $CFG->wwwroot; ?>" title="<?php print_string('home'); ?>"></a>
<div class="headermenu"><?php
if ($haslogininfo) {
echo $OUTPUT->login_info();
}
if (!empty($PAGE->layout_options['langmenu'])) {
echo $OUTPUT->lang_menu();
}
echo $PAGE->headingmenu
?></div>
</div>
<?php } ?>
<!-- END OF HEADER -->
<!-- START CUSTOMMENU AND NAVBAR -->
<div id="navcontainer">
<?php if ($hascustommenu) { ?>
<div id="custommenu" class="javascript-disabled"><?php echo $custommenu; ?></div>
<?php } ?>
</div>
<?php if (!empty($courseheader)) { ?>
<div id="course-header"><?php echo $courseheader; ?></div>
<?php } ?>
<?php if ($hasnavbar) { ?>
<div class="navbar clearfix">
<div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
<div class="navbutton"> <?php echo $PAGE->button; ?></div>
</div>
<?php } ?>
<!-- END OF CUSTOMMENU AND NAVBAR -->
<div id="page-content">
<div id="region-main-box">
<div id="region-pre-box">
<div id="region-main">
<div class="region-content">
<?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
<?php echo $coursecontentfooter; ?>
</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 -->
<?php if (!empty($coursefooter)) { ?>
<div id="course-footer"><?php echo $coursefooter; ?></div>
<?php } ?>
<?php if ($hasfooter) { ?>
<div id="page-footer" class="clearfix">
<div class="footer-left">
<?php if ($hasfootnote) { ?>
<div id="footnote"><?php echo $PAGE->theme->settings->footnote;?></div>
<?php } ?>
<a href="http://moodle.org" title="Moodle">
<img src="<?php echo $OUTPUT->pix_url('footer/moodle-logo','theme')?>" alt="Moodle logo" />
</a>
</div>
<div class="footer-right">
<?php echo $OUTPUT->login_info();?>
</div>
<?php echo $OUTPUT->standard_footer_html(); ?>
</div>
<?php } ?>
<div class="clearfix"></div>
</div>
</div>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</body>
</html>
<?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.
*
* This layout is used for content that is embedded within an existing Moodle page.
*
* @package theme_afterburner
* @copyright 2011 Mary Evans