2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 * Moodle's Clean theme, an example of how to make a Bootstrap theme
20 * DO NOT MODIFY THIS THEME!
21 * COPY IT FIRST, THEN RENAME THE COPY AND MODIFY IT INSTEAD.
23 * For full information about creating Moodle themes, see:
24 * http://docs.moodle.org/dev/Themes_2.0
26 * @package theme_clean
27 * @copyright 2013 Moodle, moodle.org
28 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31 function clean_process_css($css, $theme) {
33 // Set the background image for the logo.
34 $logo = $theme->setting_file_url('logo', 'logo');
35 $css = clean_set_logo($css, $logo);
38 if (!empty($theme->settings
->customcss
)) {
39 $customcss = $theme->settings
->customcss
;
43 $css = clean_set_customcss($css, $customcss);
48 function clean_set_logo($css, $logo) {
50 $tag = '[[setting:logo]]';
52 if (is_null($replacement)) {
56 $css = str_replace($tag, $replacement, $css);
61 function theme_clean_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
62 if ($context->contextlevel
== CONTEXT_SYSTEM
and $filearea === 'logo') {
63 $theme = theme_config
::load('clean');
64 return $theme->setting_file_serve('logo', $args, $forcedownload, $options);
66 send_file_not_found();
70 function clean_set_customcss($css, $customcss) {
71 $tag = '[[setting:customcss]]';
72 $replacement = $customcss;
73 if (is_null($replacement)) {
77 $css = str_replace($tag, $replacement, $css);