Skip to content
Snippets Groups Projects
Select Git revision
  • d47bc33de3da41ed4b8f2d0f83782a61aeec4a63
  • master default protected
  • more_logging
  • MDL-58395
  • accountexpires
  • hsh_3.10
  • v3.10-r1
  • v3.9-r2
  • v3.9-r1
  • v3.8-r1
  • v3.7-r1
  • v3.6-r1
  • v3.5-r2
  • v3.5-r1
  • v3.4-r4
  • v3.4-r3
  • v3.4-r2
  • v3.4-r1
  • v3.3-r1
  • v3.2-r4
  • v3.2-r3
  • v3.2-r2
  • v3.2-r1
  • v3.1-r1
  • v3.0-r3
  • v3.0-r2
26 results

CHANGES.md

Blame
  • To find the state of this project's repository at the time of any of these versions, check out the tags.
    lib.php 2.54 KiB
    <?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/>.
    
    /**
     * Theme Boost Campus - Library
     *
     * @package    theme_boost_campus
     * @copyright  2017 Kathrin Osswald, Ulm University <kathrin.osswald@uni-ulm.de>
     * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
     */
    
    defined('MOODLE_INTERNAL') || die();
    
    function theme_boost_campus_get_main_scss_content($theme) {
        global $CFG;
    
        $scss = '';
        $filename = !empty($theme->settings->preset) ? $theme->settings->preset : null;
        $fs = get_file_storage();
    
        $context = context_system::instance();
        if ($filename == 'default.scss') {
            // We still load the default preset files directly from the boost theme. No sense in duplicating them.
            $scss .= file_get_contents($CFG->dirroot . '/theme/boost/scss/preset/default.scss');
        } else if ($filename == 'plain.scss') {
            // We still load the default preset files directly from the boost theme. No sense in duplicating them.
            $scss .= file_get_contents($CFG->dirroot . '/theme/boost/scss/preset/plain.scss');
    
        } else if ($filename && ($presetfile = $fs->get_file($context->id, 'theme_boost_campus', 'preset', 0, '/', $filename))) {
            // This preset file was fetched from the file area for theme_boost_campus and not theme_boost (see the line above).
            $scss .= $presetfile->get_content();
        } else {
            // Safety fallback - maybe new installs etc.
            $scss .= file_get_contents($CFG->dirroot . '/theme/boost/scss/preset/default.scss');
        }
    
        // Pre CSS - this is loaded AFTER any prescss from the setting but before the main scss.
        $pre = file_get_contents($CFG->dirroot . '/theme/boost_campus/scss/pre.scss');
        // Post CSS - this is loaded AFTER the main scss but before the extra scss from the setting.
        $post = file_get_contents($CFG->dirroot . '/theme/boost_campus/scss/post.scss');
    
        // Combine them together.
        return $pre . "\n" . $scss . "\n" . $post;
    }