mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-64505 theme_classic: Created the classic theme
The Classic theme is being introduced as a Bootstrap 4 replacement for the older themes based on Bootstrap 2, such as Bootstrapbase, Clean and More. It is a child theme of Boost, with a navigation structure similar to the Clean theme. Co-authored-by: Bas Brands <bmbrands@gmail.com> Co-authored-by: Michael Hawkins <michaelh@moodle.com>
This commit is contained in:
parent
ec819146cc
commit
de213bf079
@ -4,6 +4,7 @@ theme/bootstrapbase/style/
|
||||
theme/clean/style/custom.css
|
||||
theme/more/style/custom.css
|
||||
theme/boost/style/moodle.css
|
||||
theme/classic/style/moodle.css
|
||||
node_modules/
|
||||
vendor/
|
||||
admin/tool/policy/amd/src/jquery-eu-cookie-law-popup.js
|
||||
|
@ -140,11 +140,12 @@ module.exports = function(grunt) {
|
||||
sass: {
|
||||
dist: {
|
||||
files: {
|
||||
"theme/boost/style/moodle.css": "theme/boost/scss/preset/default.scss"
|
||||
"theme/boost/style/moodle.css": "theme/boost/scss/preset/default.scss",
|
||||
"theme/classic/style/moodle.css": "theme/classic/scss/classicgrunt.scss"
|
||||
}
|
||||
},
|
||||
options: {
|
||||
includePaths: ["theme/boost/scss/"]
|
||||
includePaths: ["theme/boost/scss/", "theme/classic/scss/"]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -226,7 +227,8 @@ module.exports = function(grunt) {
|
||||
'theme/bootstrapbase/style/',
|
||||
'theme/clean/style/custom.css',
|
||||
'theme/more/style/custom.css',
|
||||
'theme/boost/style/moodle.css'
|
||||
'theme/boost/style/moodle.css',
|
||||
'theme/classic/style/moodle.css',
|
||||
].concat(thirdPartyPaths);
|
||||
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n'));
|
||||
};
|
||||
|
@ -1905,7 +1905,7 @@ class core_plugin_manager {
|
||||
),
|
||||
|
||||
'theme' => array(
|
||||
'boost', 'bootstrapbase', 'clean', 'more'
|
||||
'boost', 'classic', 'bootstrapbase', 'clean', 'more'
|
||||
),
|
||||
|
||||
'tool' => array(
|
||||
|
41
theme/classic/classes/output/core_renderer.php
Normal file
41
theme/classic/classes/output/core_renderer.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Renderers to align Moodle's HTML with that expected by Bootstrap
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace theme_classic\output;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
/**
|
||||
* Renderers to align Moodle's HTML with that expected by Bootstrap
|
||||
*
|
||||
* Note: This class is required to avoid inheriting Boost's core_renderer,
|
||||
* which removes the edit button required by Classic.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class core_renderer extends \core_renderer {
|
||||
|
||||
}
|
46
theme/classic/classes/privacy/provider.php
Normal file
46
theme/classic/classes/privacy/provider.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Privacy Subsystem implementation for theme_classic.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace theme_classic\privacy;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* The classic theme does not store any data.
|
||||
*
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class provider implements \core_privacy\local\metadata\null_provider {
|
||||
|
||||
/**
|
||||
* Get the language string identifier with the component's language
|
||||
* file to explain why this plugin stores no data.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
158
theme/classic/config.php
Normal file
158
theme/classic/config.php
Normal file
@ -0,0 +1,158 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* classic config.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
// This line protects the file from being accessed by a URL directly.
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$THEME->name = 'classic';
|
||||
|
||||
$THEME->sheets = [];
|
||||
|
||||
$THEME->layouts = [
|
||||
// Most backwards compatible layout without the blocks - this is the layout used by default.
|
||||
'base' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array(),
|
||||
),
|
||||
// Standard layout with blocks, this is recommended for most pages with general information.
|
||||
'standard' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre', 'side-post'),
|
||||
'defaultregion' => 'side-pre',
|
||||
),
|
||||
// Main course page.
|
||||
'course' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre', 'side-post'),
|
||||
'defaultregion' => 'side-pre',
|
||||
'options' => array('langmenu' => true),
|
||||
),
|
||||
'coursecategory' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre'),
|
||||
'defaultregion' => 'side-pre',
|
||||
),
|
||||
// Part of course, typical for modules - default page layout if $cm specified in require_login().
|
||||
'incourse' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre'),
|
||||
'defaultregion' => 'side-pre',
|
||||
),
|
||||
// The site home page.
|
||||
'frontpage' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre', 'side-post'),
|
||||
'defaultregion' => 'side-pre',
|
||||
'options' => array('nofullheader' => true),
|
||||
),
|
||||
// Server administration scripts.
|
||||
'admin' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre'),
|
||||
'defaultregion' => 'side-pre',
|
||||
),
|
||||
// My dashboard page.
|
||||
'mydashboard' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre', 'side-post'),
|
||||
'defaultregion' => 'side-pre',
|
||||
'options' => array('nonavbar' => true, 'langmenu' => true, 'nocontextheader' => true),
|
||||
),
|
||||
// My public page.
|
||||
'mypublic' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre'),
|
||||
'defaultregion' => 'side-pre',
|
||||
),
|
||||
'login' => array(
|
||||
'theme' => 'boost',
|
||||
'file' => 'login.php',
|
||||
'regions' => array(),
|
||||
'options' => array('langmenu' => true),
|
||||
),
|
||||
|
||||
// Pages that appear in pop-up windows - no navigation, no blocks, no header.
|
||||
'popup' => array(
|
||||
'file' => 'contentonly.php',
|
||||
'regions' => array(),
|
||||
'options' => array('nofooter' => true, 'nonavbar' => true),
|
||||
),
|
||||
// No blocks and minimal footer - used for legacy frame layouts only!
|
||||
'frametop' => array(
|
||||
'file' => 'contentonly.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(
|
||||
'theme' => 'boost',
|
||||
'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, links, or API calls that would lead to database or cache interaction.
|
||||
// Please be extremely careful if you are modifying this layout.
|
||||
'maintenance' => array(
|
||||
'theme' => 'boost',
|
||||
'file' => 'maintenance.php',
|
||||
'regions' => array(),
|
||||
),
|
||||
// Should display the content and basic headers only.
|
||||
'print' => array(
|
||||
'file' => 'contentonly.php',
|
||||
'regions' => array(),
|
||||
'options' => array('nofooter' => true, 'nonavbar' => false),
|
||||
),
|
||||
// The pagelayout used when a redirection is occuring.
|
||||
'redirect' => array(
|
||||
'theme' => 'boost',
|
||||
'file' => 'embedded.php',
|
||||
'regions' => array(),
|
||||
),
|
||||
// The pagelayout used for reports.
|
||||
'report' => array(
|
||||
'file' => 'columns.php',
|
||||
'regions' => array('side-pre'),
|
||||
'defaultregion' => 'side-pre',
|
||||
),
|
||||
// The pagelayout used for safebrowser and securewindow.
|
||||
'secure' => array(
|
||||
'file' => 'secure.php',
|
||||
'regions' => array('side-pre'),
|
||||
'defaultregion' => 'side-pre'
|
||||
)
|
||||
];
|
||||
|
||||
$THEME->editor_sheets = [];
|
||||
$THEME->parents = ['boost'];
|
||||
$THEME->enable_dock = false;
|
||||
$THEME->extrascsscallback = 'theme_classic_get_extra_scss';
|
||||
$THEME->prescsscallback = 'theme_classic_get_pre_scss';
|
||||
$THEME->precompiledcsscallback = 'theme_classic_get_precompiled_css';
|
||||
$THEME->yuicssmodules = array();
|
||||
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
|
||||
$THEME->scss = function($theme) {
|
||||
return theme_classic_get_main_scss_content($theme);
|
||||
};
|
||||
$THEME->usefallback = true;
|
41
theme/classic/lang/en/theme_classic.php
Normal file
41
theme/classic/lang/en/theme_classic.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Language file.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
// This line protects the file from being accessed by a URL directly.
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
// Raw SCSS setting.
|
||||
$string['choosereadme'] = 'Classic is a highly-customisable theme, based on Boost, with an alternative navigation layout. This theme is intended to be used directly, or as a parent theme when creating or updating custom themes to utilise Bootstrap 4.';
|
||||
$string['configtitle'] = 'Classic';
|
||||
$string['navbardark'] = 'Use a dark style navbar';
|
||||
$string['navbardarkdesc'] = 'Swaps text and background colours for the navbar at the top of the page between dark and light.';
|
||||
$string['pluginname'] = 'Classic';
|
||||
$string['presetfiles'] = 'Additional theme preset files';
|
||||
$string['presetfiles_desc'] = 'Preset files can be used to dramatically alter the appearance of the theme. See <a href=https://docs.moodle.org/dev/Boost_Presets>Boost presets</a> for information on creating and sharing your own preset files, and see the <a href=http://moodle.net/boost>Presets repository</a> for presets that others have shared.';
|
||||
$string['preset'] = 'Theme preset';
|
||||
$string['preset_desc'] = 'Pick a preset to broadly change the look of the theme.';
|
||||
$string['region-side-post'] = 'Right';
|
||||
$string['region-side-pre'] = 'Left';
|
||||
$string['sitetitle'] = 'Site Title';
|
||||
$string['privacy:metadata'] = 'The Classic theme does not store any personal data.';
|
45
theme/classic/layout/columns.php
Normal file
45
theme/classic/layout/columns.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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 columns layout for the classic theme.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$bodyattributes = $OUTPUT->body_attributes();
|
||||
$blockspre = $OUTPUT->blocks('side-pre');
|
||||
$blockspost = $OUTPUT->blocks('side-post');
|
||||
|
||||
$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
|
||||
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
|
||||
|
||||
$templatecontext = [
|
||||
'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
|
||||
'output' => $OUTPUT,
|
||||
'sidepreblocks' => $blockspre,
|
||||
'sidepostblocks' => $blockspost,
|
||||
'haspreblocks' => $hassidepre,
|
||||
'haspostblocks' => $hassidepost,
|
||||
'bodyattributes' => $bodyattributes
|
||||
];
|
||||
|
||||
echo $OUTPUT->render_from_template('theme_classic/columns', $templatecontext);
|
||||
|
36
theme/classic/layout/contentonly.php
Normal file
36
theme/classic/layout/contentonly.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* A one column layout for the classic theme.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$bodyattributes = $OUTPUT->body_attributes([]);
|
||||
|
||||
$templatecontext = [
|
||||
'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
|
||||
'output' => $OUTPUT,
|
||||
'bodyattributes' => $bodyattributes
|
||||
];
|
||||
|
||||
echo $OUTPUT->render_from_template('theme_classic/contentonly', $templatecontext);
|
||||
|
46
theme/classic/layout/secure.php
Normal file
46
theme/classic/layout/secure.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* A secure layout for the classic theme.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$bodyattributes = $OUTPUT->body_attributes();
|
||||
|
||||
$blockspre = $OUTPUT->blocks('side-pre');
|
||||
$blockspost = $OUTPUT->blocks('side-post');
|
||||
|
||||
$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
|
||||
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
|
||||
|
||||
$templatecontext = [
|
||||
'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
|
||||
'output' => $OUTPUT,
|
||||
'sidepreblocks' => $blockspre,
|
||||
'sidepostblocks' => $blockspost,
|
||||
'haspreblocks' => $hassidepre,
|
||||
'haspostblocks' => $hassidepost,
|
||||
'bodyattributes' => $bodyattributes
|
||||
];
|
||||
|
||||
echo $OUTPUT->render_from_template('theme_classic/secure', $templatecontext);
|
||||
|
150
theme/classic/lib.php
Normal file
150
theme/classic/lib.php
Normal file
@ -0,0 +1,150 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Classic theme callbacks.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
// This line protects the file from being accessed by a URL directly.
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Returns the main SCSS content.
|
||||
*
|
||||
* @param theme_config $theme The theme config object.
|
||||
* @return string
|
||||
*/
|
||||
function theme_classic_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();
|
||||
$scss .= file_get_contents($CFG->dirroot . '/theme/classic/scss/classic/pre.scss');
|
||||
if ($filename && ($presetfile = $fs->get_file($context->id, 'theme_classic', 'preset', 0, '/', $filename))) {
|
||||
$scss .= $presetfile->get_content();
|
||||
} else {
|
||||
// Safety fallback - maybe new installs etc.
|
||||
$scss .= file_get_contents($CFG->dirroot . '/theme/classic/scss/preset/default.scss');
|
||||
}
|
||||
$scss .= file_get_contents($CFG->dirroot . '/theme/classic/scss/classic/post.scss');
|
||||
|
||||
return $scss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SCSS to prepend.
|
||||
*
|
||||
* @param theme_config $theme The theme config object.
|
||||
* @return array
|
||||
*/
|
||||
function theme_classic_get_pre_scss($theme) {
|
||||
$scss = '';
|
||||
$configurable = [
|
||||
// Config key => [variableName, ...].
|
||||
'brandcolor' => ['primary'],
|
||||
];
|
||||
|
||||
// Prepend variables first.
|
||||
foreach ($configurable as $configkey => $targets) {
|
||||
$value = isset($theme->settings->{$configkey}) ? $theme->settings->{$configkey} : null;
|
||||
if (empty($value)) {
|
||||
continue;
|
||||
}
|
||||
array_map(function($target) use (&$scss, $value) {
|
||||
$scss .= '$' . $target . ': ' . $value . ";\n";
|
||||
}, (array) $targets);
|
||||
}
|
||||
|
||||
// Prepend pre-scss.
|
||||
if (!empty($theme->settings->scsspre)) {
|
||||
$scss .= $theme->settings->scsspre;
|
||||
}
|
||||
|
||||
return $scss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inject additional SCSS.
|
||||
*
|
||||
* @param theme_config $theme The theme config object.
|
||||
* @return string
|
||||
*/
|
||||
function theme_classic_get_extra_scss($theme) {
|
||||
global $CFG;
|
||||
$content = '';
|
||||
|
||||
// Set the page background image.
|
||||
$imageurl = $theme->setting_file_url('backgroundimage', 'backgroundimage');
|
||||
if (!empty($imageurl)) {
|
||||
$content .= '$imageurl: "' . $imageurl . '";';
|
||||
$content .= file_get_contents($CFG->dirroot .
|
||||
'/theme/classic/scss/classic/body-background.scss');
|
||||
}
|
||||
|
||||
if (!empty($theme->settings->navbardark)) {
|
||||
$content .= file_get_contents($CFG->dirroot .
|
||||
'/theme/classic/scss/classic/navbar-dark.scss');
|
||||
} else {
|
||||
$content .= file_get_contents($CFG->dirroot .
|
||||
'/theme/classic/scss/classic/navbar-light.scss');
|
||||
}
|
||||
if (!empty($theme->settings->scss)) {
|
||||
$content .= $theme->settings->scss;
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get compiled css.
|
||||
*
|
||||
* @return string compiled css
|
||||
*/
|
||||
function theme_classic_get_precompiled_css() {
|
||||
global $CFG;
|
||||
return file_get_contents($CFG->dirroot . '/theme/classic/style/moodle.css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Serves any files associated with the theme settings.
|
||||
*
|
||||
* @param stdClass $course
|
||||
* @param stdClass $cm
|
||||
* @param context $context
|
||||
* @param string $filearea
|
||||
* @param array $args
|
||||
* @param bool $forcedownload
|
||||
* @param array $options
|
||||
* @return bool
|
||||
*/
|
||||
function theme_classic_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
|
||||
if ($context->contextlevel == CONTEXT_SYSTEM && ($filearea === 'backgroundimage')) {
|
||||
$theme = theme_config::load('classic');
|
||||
// By default, theme files must be cache-able by both browsers and proxies.
|
||||
if (!array_key_exists('cacheability', $options)) {
|
||||
$options['cacheability'] = 'public';
|
||||
}
|
||||
return $theme->setting_file_serve($filearea, $args, $forcedownload, $options);
|
||||
} else {
|
||||
send_file_not_found();
|
||||
}
|
||||
}
|
BIN
theme/classic/pix/favicon.ico
Normal file
BIN
theme/classic/pix/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
theme/classic/pix/screenshot.png
Normal file
BIN
theme/classic/pix/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 186 KiB |
2
theme/classic/scss/bootstrap.scss
vendored
Normal file
2
theme/classic/scss/bootstrap.scss
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
// Import All of Bootstrap
|
||||
@import "../../boost/scss/bootstrap";
|
10
theme/classic/scss/classic/body-background.scss
Normal file
10
theme/classic/scss/classic/body-background.scss
Normal file
@ -0,0 +1,10 @@
|
||||
body {
|
||||
background-image: url($imageurl);
|
||||
background-size: cover;
|
||||
}
|
||||
.region-main .region-main-content {
|
||||
padding: 0.875rem;
|
||||
background-color: $body-bg;
|
||||
border: $card-border-width solid $card-border-color;
|
||||
@include border-radius($card-border-radius);
|
||||
}
|
25
theme/classic/scss/classic/navbar-dark.scss
Normal file
25
theme/classic/scss/classic/navbar-dark.scss
Normal file
@ -0,0 +1,25 @@
|
||||
.navbar-bootswatch {
|
||||
@extend .navbar-dark;
|
||||
background-color: $primary;
|
||||
|
||||
.usermenu {
|
||||
color: $navbar-dark-color;
|
||||
.login a {
|
||||
color: $navbar-dark-color;
|
||||
}
|
||||
}
|
||||
a.dropdown-toggle,
|
||||
a .usertext {
|
||||
color: $navbar-dark-color;
|
||||
@include hover-focus {
|
||||
color: $navbar-dark-hover-color;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $navbar-dark-disabled-color;
|
||||
}
|
||||
}
|
||||
.dropdown-menu a .icon {
|
||||
color: inherit !important; // stylelint-disable-line declaration-no-important
|
||||
}
|
||||
}
|
4
theme/classic/scss/classic/navbar-light.scss
Normal file
4
theme/classic/scss/classic/navbar-light.scss
Normal file
@ -0,0 +1,4 @@
|
||||
.navbar-bootswatch {
|
||||
@extend .navbar-light;
|
||||
background-color: $white;
|
||||
}
|
192
theme/classic/scss/classic/post.scss
Normal file
192
theme/classic/scss/classic/post.scss
Normal file
@ -0,0 +1,192 @@
|
||||
// General Post SCSS for use in all presets.
|
||||
|
||||
// Generate the column layout css.
|
||||
@mixin page_layout($blockswidth) {
|
||||
$mainwidth-oneblock: (100% - $blockswidth);
|
||||
$mainwidth-twoblocks: (100% - $blockswidth * 2);
|
||||
#page-content {
|
||||
display: flex;
|
||||
|
||||
.region-main {
|
||||
flex: 0 0 100%;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
&.blocks-pre {
|
||||
.columnleft {
|
||||
flex: 0 0 $blockswidth;
|
||||
order: -1;
|
||||
padding: 0 1rem;
|
||||
max-width: $blockswidth;
|
||||
}
|
||||
.region-main {
|
||||
flex: 0 0 $mainwidth-oneblock;
|
||||
max-width: $mainwidth-oneblock;
|
||||
padding: 0 1rem 0 0;
|
||||
}
|
||||
}
|
||||
&.blocks-post {
|
||||
.region-main {
|
||||
flex: 0 0 $mainwidth-oneblock;
|
||||
max-width: $mainwidth-oneblock;
|
||||
padding: 0 0 0 1rem;
|
||||
}
|
||||
.columnright {
|
||||
flex: 0 0 $blockswidth;
|
||||
padding: 0 1rem;
|
||||
max-width: $blockswidth;
|
||||
}
|
||||
}
|
||||
&.blocks-pre.blocks-post {
|
||||
.region-main {
|
||||
flex: 0 0 $mainwidth-twoblocks;
|
||||
max-width: $mainwidth-twoblocks;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
[data-region="blocks-column"] {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-region-side-pre {
|
||||
&.used-region-side-post {
|
||||
#page-content {
|
||||
.region-main {
|
||||
flex: 0 0 $mainwidth-oneblock;
|
||||
max-width: $mainwidth-oneblock;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
.columnright {
|
||||
flex: 0 0 $blockswidth;
|
||||
padding: 0 1rem;
|
||||
max-width: $blockswidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.empty-region-side-post {
|
||||
&.used-region-side-pre {
|
||||
#page-content {
|
||||
.region-main {
|
||||
flex: 0 0 $mainwidth-oneblock;
|
||||
max-width: $mainwidth-oneblock;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
.columnleft {
|
||||
flex: 0 0 $blockswidth;
|
||||
order: -1;
|
||||
padding: 0 1rem;
|
||||
max-width: $blockswidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.used-region-side-post {
|
||||
&.used-region-side-pre {
|
||||
#page-content {
|
||||
.region-main {
|
||||
flex: 0 0 $mainwidth-twoblocks;
|
||||
max-width: $mainwidth-twoblocks;
|
||||
padding: 0;
|
||||
}
|
||||
.columnleft {
|
||||
flex: 0 0 $blockswidth;
|
||||
order: -1;
|
||||
padding: 0 1rem;
|
||||
max-width: $blockswidth;
|
||||
}
|
||||
.columnright {
|
||||
flex: 0 0 $blockswidth;
|
||||
padding: 0 1rem;
|
||||
max-width: $blockswidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The block column needs some padding on small devices.
|
||||
@include media-breakpoint-down(sm) {
|
||||
.blockcolumn,
|
||||
.region-main {
|
||||
flex: 0 0 100%;
|
||||
padding: 0 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
// When changing this please check the size of the calendar block.
|
||||
@include media-breakpoint-up(md) {
|
||||
@include page_layout(32%);
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(lg) {
|
||||
@include page_layout(25%);
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(xl) {
|
||||
@include page_layout(20%);
|
||||
}
|
||||
|
||||
.block_myoverview,
|
||||
.block_recentlyaccesseditems {
|
||||
.dashboard-card-deck {
|
||||
.dashboard-card {
|
||||
width: calc(33.33% - #{$card-gutter});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
.blockcolumn {
|
||||
.dashboard-card-deck {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
.dashboard-card {
|
||||
width: calc(100% - #{$card-gutter}) !important; /* stylelint-disable-line declaration-no-important */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Settings and Navigation blocks don't render well from default boost.
|
||||
.block_navigation,
|
||||
.block_settings {
|
||||
.block_tree {
|
||||
&.list > li > ul {
|
||||
padding-left: 0;
|
||||
}
|
||||
.tree_item.branch {
|
||||
margin-left: 5px;
|
||||
padding-left: 0.75rem;
|
||||
}
|
||||
p.hasicon {
|
||||
text-indent: 0;
|
||||
padding-left: 0.75rem;
|
||||
}
|
||||
ul {
|
||||
margin-left: 0.25rem;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.block_navigation .block_tree p.hasicon .icon,
|
||||
.block_settings .block_tree p.hasicon .icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
// Remove left indenting from root nodes to allow sub-nodes to indent correctly.
|
||||
.root_node,
|
||||
.navigation_node {
|
||||
margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */
|
||||
padding-left: 0 !important; /* stylelint-disable-line declaration-no-important */
|
||||
}
|
||||
|
||||
.block.block_settings {
|
||||
#settingsnav {
|
||||
padding-top: 0 !important; /* stylelint-disable-line declaration-no-important */
|
||||
}
|
||||
}
|
1
theme/classic/scss/classic/pre.scss
Normal file
1
theme/classic/scss/classic/pre.scss
Normal file
@ -0,0 +1 @@
|
||||
// General variables for all presets
|
4
theme/classic/scss/classicgrunt.scss
Normal file
4
theme/classic/scss/classicgrunt.scss
Normal file
@ -0,0 +1,4 @@
|
||||
// This file allows the creation of precompiled css from the core Grunt task.
|
||||
@import "classic/pre";
|
||||
@import "preset/default";
|
||||
@import "classic/post";
|
2
theme/classic/scss/fontawesome.scss
vendored
Normal file
2
theme/classic/scss/fontawesome.scss
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
// Import FontAwesome.
|
||||
@import "../../boost/scss/fontawesome";
|
2
theme/classic/scss/moodle.scss
Normal file
2
theme/classic/scss/moodle.scss
Normal file
@ -0,0 +1,2 @@
|
||||
// Import Boost Core moodle CSS
|
||||
@import "../../boost/scss/moodle";
|
107
theme/classic/scss/preset/default.scss
Normal file
107
theme/classic/scss/preset/default.scss
Normal file
@ -0,0 +1,107 @@
|
||||
// Bootstrap variables
|
||||
|
||||
$white: #fff !default;
|
||||
$gray-100: #f8f9fa !default;
|
||||
$gray-200: #e9ecef !default;
|
||||
$gray-300: #dee2e6 !default;
|
||||
$gray-400: #ced4da !default;
|
||||
$gray-500: #adb5bd !default;
|
||||
$gray-600: #868e96 !default;
|
||||
$gray-700: #495057 !default;
|
||||
$gray-800: #373a3c !default;
|
||||
$gray-900: #212529 !default;
|
||||
$black: #000 !default;
|
||||
|
||||
$blue: #1177d1 !default;
|
||||
$indigo: #6610f2 !default;
|
||||
$purple: #613d7c !default;
|
||||
$pink: #e83e8c !default;
|
||||
$red: #d9534f !default;
|
||||
$orange: #f0ad4e !default;
|
||||
$yellow: #ff7518 !default;
|
||||
$green: #5cb85c !default;
|
||||
$teal: #20c997 !default;
|
||||
$cyan: #5bc0de !default;
|
||||
|
||||
$primary: $blue !default;
|
||||
$secondary: $gray-800 !default;
|
||||
$success: $green !default;
|
||||
$info: $cyan !default;
|
||||
$warning: $yellow !default;
|
||||
$danger: $red !default;
|
||||
$light: $gray-100 !default;
|
||||
$dark: $gray-800 !default;
|
||||
|
||||
// Options
|
||||
$enable-rounded: true !default;
|
||||
|
||||
// Body
|
||||
$body-color: $gray-800 !default;
|
||||
|
||||
// Fonts
|
||||
$font-size-base: 0.9375rem !default;
|
||||
$headings-font-weight: 300 !default;
|
||||
|
||||
// Navbar
|
||||
$navbar-dark-hover-color: rgba($white, 1) !default;
|
||||
$navbar-light-hover-color: rgba($black, .9) !default;
|
||||
|
||||
// Breadcrumbs
|
||||
$breadcrumb-padding-y: .25rem !default;
|
||||
$breadcrumb-padding-x: 0 !default;
|
||||
$breadcrumb-item-padding: .5rem !default;
|
||||
$breadcrumb-margin-bottom: 0 !default;
|
||||
$breadcrumb-bg: transparent !default;
|
||||
$breadcrumb-divider: "/" !default;
|
||||
$breadcrumb-divider-rtl: "/" !default;
|
||||
|
||||
// Alerts
|
||||
$alert-border-width: 0 !default;
|
||||
|
||||
$card-group-margin: .25rem;
|
||||
|
||||
$theme-colors: (
|
||||
primary: $primary,
|
||||
secondary: $gray-200,
|
||||
success: $success,
|
||||
info: $info,
|
||||
warning: $orange,
|
||||
danger: $danger,
|
||||
light: $gray-100,
|
||||
dark: $gray-800
|
||||
);
|
||||
|
||||
// Import FontAwesome.
|
||||
@import "fontawesome";
|
||||
|
||||
// Import All of Bootstrap
|
||||
@import "bootstrap";
|
||||
|
||||
// Import Core moodle CSS
|
||||
@import "moodle";
|
||||
|
||||
// Preset CSS
|
||||
.navbar {
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
|
||||
}
|
||||
|
||||
.filemanager-container,
|
||||
.filepicker-filelist {
|
||||
border: $border-width solid $border-color;
|
||||
}
|
||||
|
||||
// Rounded user pictures
|
||||
.userpicture {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.block {
|
||||
background-color: $gray-100;
|
||||
}
|
||||
// Reset the default styling back to the bootstrap defaults for
|
||||
// the secondary outline button because gray-200 is much too light
|
||||
// for an outline button.
|
||||
.btn-outline-secondary {
|
||||
@include button-outline-variant($gray-600);
|
||||
border-color: $border-color;
|
||||
}
|
8
theme/classic/scss/preset/plain.scss
Normal file
8
theme/classic/scss/preset/plain.scss
Normal file
@ -0,0 +1,8 @@
|
||||
// Import FontAwesome.
|
||||
@import "fontawesome";
|
||||
|
||||
// Import All of Bootstrap
|
||||
@import "bootstrap";
|
||||
|
||||
// Import Core moodle CSS
|
||||
@import "moodle";
|
106
theme/classic/settings.php
Normal file
106
theme/classic/settings.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Classic theme settings file.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
if ($ADMIN->fulltree) {
|
||||
|
||||
$settings = new theme_boost_admin_settingspage_tabs('themesettingclassic', get_string('configtitle', 'theme_classic'));
|
||||
$page = new admin_settingpage('theme_classic_general', get_string('generalsettings', 'theme_boost'));
|
||||
|
||||
$name = 'theme_classic/navbardark';
|
||||
$title = get_string('navbardark', 'theme_classic');
|
||||
$description = get_string('navbardarkdesc', 'theme_classic');
|
||||
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$page->add($setting);
|
||||
|
||||
// Preset.
|
||||
$name = 'theme_classic/preset';
|
||||
$title = get_string('preset', 'theme_classic');
|
||||
$description = get_string('preset_desc', 'theme_classic');
|
||||
$default = 'default.scss';
|
||||
|
||||
$context = context_system::instance();
|
||||
$fs = get_file_storage();
|
||||
$files = $fs->get_area_files($context->id, 'theme_classic', 'preset', 0, 'itemid, filepath, filename', false);
|
||||
|
||||
$choices = [];
|
||||
foreach ($files as $file) {
|
||||
$choices[$file->get_filename()] = $file->get_filename();
|
||||
}
|
||||
|
||||
// These are the built in presets.
|
||||
$choices['default.scss'] = 'default.scss';
|
||||
$choices['plain.scss'] = 'plain.scss';
|
||||
|
||||
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$page->add($setting);
|
||||
|
||||
// Preset files setting.
|
||||
$name = 'theme_classic/presetfiles';
|
||||
$title = get_string('presetfiles', 'theme_classic');
|
||||
$description = get_string('presetfiles_desc', 'theme_classic');
|
||||
|
||||
$setting = new admin_setting_configstoredfile($name, $title, $description, 'preset', 0,
|
||||
array('maxfiles' => 20, 'accepted_types' => array('.scss')));
|
||||
$page->add($setting);
|
||||
|
||||
// Background image setting.
|
||||
$name = 'theme_classic/backgroundimage';
|
||||
$title = get_string('backgroundimage', 'theme_boost');
|
||||
$description = get_string('backgroundimage_desc', 'theme_boost');
|
||||
$setting = new admin_setting_configstoredfile($name, $title, $description, 'backgroundimage');
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$page->add($setting);
|
||||
|
||||
// Variable $body-color.
|
||||
// We use an empty default value because the default colour should come from the preset.
|
||||
$name = 'theme_classic/brandcolor';
|
||||
$title = get_string('brandcolor', 'theme_boost');
|
||||
$description = get_string('brandcolor_desc', 'theme_boost');
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$page->add($setting);
|
||||
|
||||
// Must add the page after definiting all the settings!
|
||||
$settings->add($page);
|
||||
|
||||
// Advanced settings.
|
||||
$page = new admin_settingpage('theme_classic_advanced', get_string('advancedsettings', 'theme_boost'));
|
||||
|
||||
// Raw SCSS to include before the content.
|
||||
$setting = new admin_setting_scsscode('theme_classic/scsspre',
|
||||
get_string('rawscsspre', 'theme_boost'), get_string('rawscsspre_desc', 'theme_boost'), '', PARAM_RAW);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$page->add($setting);
|
||||
|
||||
// Raw SCSS to include after the content.
|
||||
$setting = new admin_setting_scsscode('theme_classic/scss', get_string('rawscss', 'theme_boost'),
|
||||
get_string('rawscss_desc', 'theme_boost'), '', PARAM_RAW);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$page->add($setting);
|
||||
|
||||
$settings->add($page);
|
||||
}
|
17210
theme/classic/style/moodle.css
Normal file
17210
theme/classic/style/moodle.css
Normal file
File diff suppressed because it is too large
Load Diff
101
theme/classic/templates/columns.mustache
Normal file
101
theme/classic/templates/columns.mustache
Normal file
@ -0,0 +1,101 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template theme_classic/columns
|
||||
|
||||
Admin time setting template.
|
||||
|
||||
Classic 1-3 column layout template.
|
||||
|
||||
Context variables required for this template:
|
||||
* sitename - The name of the site
|
||||
* output - The core renderer for the page
|
||||
* bodyattributes - attributes for the body tag as a string of html attributes
|
||||
* sidepreblocks - HTML for the blocks
|
||||
* hasblocks - true if there are blocks on this page
|
||||
* regionmainsettingsmenu - HTML for the region main settings menu
|
||||
* hasregionmainsettingsmenu - There is a region main settings menu on this page.
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"sitename": "Moodle",
|
||||
"output": {
|
||||
"doctype": "<!DOCTYPE html>",
|
||||
"page_title": "Test page",
|
||||
"favicon": "favicon.ico",
|
||||
"main_content": "<h1>Headings make html validators happier</h1>"
|
||||
},
|
||||
"bodyattributes":"",
|
||||
"sidepreblocks": "<h2>Blocks html goes here</h2>",
|
||||
"sidepostblocks": "<h2>Blocks html goes here</h2>",
|
||||
"haspreblocks":true,
|
||||
"haspostblocks":true
|
||||
}
|
||||
}}
|
||||
{{> theme_boost/head }}
|
||||
|
||||
<body {{{ bodyattributes }}}>
|
||||
|
||||
<div id="page-wrapper">
|
||||
|
||||
{{{ output.standard_top_of_body_html }}}
|
||||
|
||||
{{>theme_classic/navbar}}
|
||||
|
||||
<div id="page" class="container-fluid">
|
||||
{{{ output.full_header }}}
|
||||
|
||||
<div id="page-content" class="row {{#haspreblocks}} blocks-pre {{/haspreblocks}} {{#haspostblocks}} blocks-post {{/haspostblocks}}">
|
||||
<div id="region-main-box" class="region-main">
|
||||
{{#hasregionmainsettingsmenu}}
|
||||
<div id="region-main-settings-menu" class="d-print-none {{#hasblocks}}has-blocks{{/hasblocks}}">
|
||||
<div> {{{ output.region_main_settings_menu }}} </div>
|
||||
</div>
|
||||
{{/hasregionmainsettingsmenu}}
|
||||
<section id="region-main" class="region-main-content" aria-label="{{#str}}content{{/str}}">
|
||||
{{#hasregionmainsettingsmenu}}
|
||||
<div class="region_main_settings_menu_proxy"></div>
|
||||
{{/hasregionmainsettingsmenu}}
|
||||
{{{ output.course_content_header }}}
|
||||
{{{ output.main_content }}}
|
||||
{{{ output.activity_navigation }}}
|
||||
{{{ output.course_content_footer }}}
|
||||
</section>
|
||||
</div>
|
||||
<div class="columnleft blockcolumn {{#haspreblocks}} has-blocks {{/haspreblocks}}">
|
||||
<section data-region="blocks-column" class="hidden-print" aria-label="{{#str}}blocks{{/str}}">
|
||||
{{{ sidepreblocks }}}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="columnright blockcolumn {{#haspostblocks}} has-blocks {{/haspostblocks}}">
|
||||
<section data-region="blocks-column" class="hidden-print" aria-label="{{#str}}blocks{{/str}}">
|
||||
{{{ sidepostblocks }}}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{{ output.standard_after_main_region_html }}}
|
||||
{{> theme_boost/footer }}
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{{#js}}
|
||||
require(['theme_boost/loader']);
|
||||
{{/js}}
|
||||
|
72
theme/classic/templates/contentonly.mustache
Normal file
72
theme/classic/templates/contentonly.mustache
Normal file
@ -0,0 +1,72 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template theme_classic/contentonly
|
||||
|
||||
Classic 1 column layout template.
|
||||
|
||||
Context variables required for this template:
|
||||
* sitename - The name of the site
|
||||
* output - The core renderer for the page
|
||||
* bodyattributes - attributes for the body tag as a string of html attributes
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"sitename": "Moodle",
|
||||
"output": {
|
||||
"doctype": "<!DOCTYPE html>",
|
||||
"page_title": "Test page",
|
||||
"favicon": "favicon.ico",
|
||||
"main_content": "<h1>Headings make html validators happier</h1>"
|
||||
},
|
||||
"bodyattributes":""
|
||||
}
|
||||
}}
|
||||
{{{ output.doctype }}}
|
||||
<html {{{ output.htmlattributes }}}>
|
||||
<head>
|
||||
<title>{{{ output.page_title }}}</title>
|
||||
<link rel="shortcut icon" href="{{{ output.favicon }}}" />
|
||||
{{{ output.standard_head_html }}}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
|
||||
<body {{{ bodyattributes }}}>
|
||||
|
||||
<div id="page-wrapper">
|
||||
|
||||
{{{ output.standard_top_of_body_html }}}
|
||||
|
||||
<div id="page" class="container-fluid">
|
||||
<div id="page-content" class="row">
|
||||
<div id="region-main-box" class="col-xs-12">
|
||||
<section id="region-main" aria-label="{{#str}}content{{/str}}">
|
||||
{{{ output.course_content_header }}}
|
||||
{{{ output.main_content }}}
|
||||
{{{ output.activity_navigation }}}
|
||||
{{{ output.course_content_footer }}}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{{ output.standard_end_of_body_html }}}
|
||||
</body>
|
||||
</html>
|
||||
{{#js}}
|
||||
require(['theme_boost/loader']);
|
||||
{{/js}}
|
54
theme/classic/templates/core/footer.mustache
Normal file
54
theme/classic/templates/core/footer.mustache
Normal file
@ -0,0 +1,54 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template theme_classic/footer
|
||||
|
||||
This template renders the page footer.
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"output": {
|
||||
"course_footer": "Course footer html",
|
||||
"page_doc_link": "<a href='http://localhost/help'>Moodle docs for this page</a>",
|
||||
"login_info": "You are logged in as User <a href='http://localhost'>Log out</a>",
|
||||
"standard_footer_html": "<a href='http://localhost'>Purge all caches</a>",
|
||||
"standard_end_of_body_html": "Footer Javascript"
|
||||
}
|
||||
}
|
||||
}}
|
||||
<footer id="page-footer" class="m-t-1 py-3 bg-dark text-light">
|
||||
<div class="container">
|
||||
<div id="course-footer">{{{ output.course_footer }}}</div>
|
||||
|
||||
{{# output.page_doc_link }}
|
||||
<p class="helplink">{{{ output.page_doc_link }}}</p>
|
||||
{{/ output.page_doc_link }}
|
||||
|
||||
{{{ output.login_info }}}
|
||||
<div class="tool_usertours-resettourcontainer"></div>
|
||||
{{{ output.home_link }}}
|
||||
<nav class="nav navbar-nav d-md-none">
|
||||
{{# output.custom_menu_flat }}
|
||||
<ul class="list-unstyled pt-3">
|
||||
{{> theme_boost/custom_menu_footer }}
|
||||
</ul>
|
||||
{{/ output.custom_menu_flat }}
|
||||
</nav>
|
||||
{{{ output.standard_footer_html }}}
|
||||
{{{ output.standard_end_of_body_html }}}
|
||||
</div>
|
||||
</footer>
|
55
theme/classic/templates/core/full_header.mustache
Normal file
55
theme/classic/templates/core/full_header.mustache
Normal file
@ -0,0 +1,55 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template theme_classic/header
|
||||
|
||||
This template renders the header.
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"contextheader": "context_header_html",
|
||||
"hasnavbar": false,
|
||||
"navbar": "navbar_if_available",
|
||||
"courseheader": "course_header_html"
|
||||
}
|
||||
}}
|
||||
<header id="page-header" class="row">
|
||||
<div class="col-12 pt-3 pb-3">
|
||||
<div class="card {{^contextheader}}border-0 bg-transparent{{/contextheader}}">
|
||||
<div class="card-body {{^contextheader}}p-2{{/contextheader}}">
|
||||
<div class="d-flex">
|
||||
<div class="mr-auto">
|
||||
{{{contextheader}}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-wrap">
|
||||
{{#hasnavbar}}
|
||||
<div id="page-navbar">
|
||||
{{{navbar}}}
|
||||
</div>
|
||||
{{/hasnavbar}}
|
||||
<div class="ml-auto d-flex">
|
||||
{{{pageheadingbutton}}}
|
||||
</div>
|
||||
<div id="course-header">
|
||||
{{{courseheader}}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
45
theme/classic/templates/navbar-secure.mustache
Normal file
45
theme/classic/templates/navbar-secure.mustache
Normal file
@ -0,0 +1,45 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template theme_classic/navbar-secure
|
||||
|
||||
This template renders the top navbar.
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"output": {
|
||||
"should_display_navbar_logo": "true",
|
||||
"get_compact_logo_url": "http://example.com/image.png"
|
||||
},
|
||||
"sitename": "Moodle Site",
|
||||
"secure_login_info": "Logged in as test user"
|
||||
}
|
||||
}}
|
||||
<nav class="fixed-top navbar navbar-bootswatch navbar-expand moodle-has-zindex">
|
||||
{{# output.should_display_navbar_logo }}
|
||||
<span class="logo d-none d-sm-inline">
|
||||
<img src="{{output.get_compact_logo_url}}" alt="{{sitename}}">
|
||||
</span>
|
||||
{{/ output.should_display_navbar_logo }}
|
||||
<span class="site-name d-none d-md-inline">{{{ sitename }}}</span>
|
||||
|
||||
<ul class="nav navbar-nav ml-auto">
|
||||
<li class="nav-item">
|
||||
{{{ output.secure_login_info }}}
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
75
theme/classic/templates/navbar.mustache
Normal file
75
theme/classic/templates/navbar.mustache
Normal file
@ -0,0 +1,75 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template theme_classic/navbar
|
||||
|
||||
This template renders the top navbar.
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"output": {
|
||||
"should_display_navbar_logo": true,
|
||||
"get_compact_logo_url": "http://example.com/image.png",
|
||||
"custom_menu": "<li>..</li>",
|
||||
"page_heading_menu": "<li>..</li>",
|
||||
"search_box": "<div><input type='text'></div>",
|
||||
"navbar_plugin_output": "<div class='dropdown'>Messaging</div>",
|
||||
"user_menu": "<div class='dropdown'>John Doe</div>"
|
||||
},
|
||||
"config": {
|
||||
"wwwroot": "#"
|
||||
},
|
||||
"sitename": "Moodle Site"
|
||||
}
|
||||
}}
|
||||
<nav class="fixed-top navbar navbar-bootswatch navbar-expand moodle-has-zindex">
|
||||
|
||||
<a href="{{{ config.wwwroot }}}" class="navbar-brand {{# output.should_display_navbar_logo }}has-logo{{/ output.should_display_navbar_logo }}
|
||||
{{^ output.should_display_navbar_logo }}
|
||||
d-none d-sm-inline
|
||||
{{/ output.should_display_navbar_logo }}
|
||||
">
|
||||
{{# output.should_display_navbar_logo }}
|
||||
<span class="logo d-none d-sm-inline">
|
||||
<img src="{{output.get_compact_logo_url}}" alt="{{sitename}}">
|
||||
</span>
|
||||
{{/ output.should_display_navbar_logo }}
|
||||
<span class="site-name d-none d-md-inline">{{{ sitename }}}</span>
|
||||
</a>
|
||||
|
||||
<ul class="navbar-nav d-none d-md-flex">
|
||||
<!-- custom_menu -->
|
||||
{{{ output.custom_menu }}}
|
||||
<!-- page_heading_menu -->
|
||||
{{{ output.page_heading_menu }}}
|
||||
</ul>
|
||||
<ul class="nav navbar-nav ml-auto">
|
||||
<div class="d-none d-lg-block">
|
||||
{{{ output.search_box }}}
|
||||
</div>
|
||||
<!-- navbar_plugin_output -->
|
||||
<li class="nav-item">
|
||||
{{{ output.navbar_plugin_output }}}
|
||||
</li>
|
||||
<!-- user_menu -->
|
||||
<li class="nav-item d-flex align-items-center">
|
||||
{{{ output.user_menu }}}
|
||||
</li>
|
||||
</ul>
|
||||
<!-- search_box -->
|
||||
</nav>
|
||||
|
110
theme/classic/templates/secure.mustache
Normal file
110
theme/classic/templates/secure.mustache
Normal file
@ -0,0 +1,110 @@
|
||||
{{!
|
||||
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/>.
|
||||
}}
|
||||
{{!
|
||||
@template theme_classic/secure
|
||||
|
||||
Classic secure layout template.
|
||||
|
||||
Context variables required for this template:
|
||||
* sitename - The name of the site
|
||||
* output - The core renderer for the page
|
||||
* bodyattributes - Attributes for the body tag as a string of html attributes
|
||||
* sidepreblocks - HTML for the pre blocks
|
||||
* sidepostblocks - HTML for the post blocks
|
||||
* haspreblocks - true if there are pre blocks on this page
|
||||
* haspostblocks - true if there are post blocks on this page
|
||||
* bodyattributes - attributes for the body tag as a string of html attributes
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"sitename": "Moodle",
|
||||
"output": {
|
||||
"doctype": "<!DOCTYPE html>",
|
||||
"page_title": "Test page",
|
||||
"favicon": "favicon.ico",
|
||||
"main_content": "<h1>Headings make html validators happier</h1>"
|
||||
},
|
||||
"bodyattributes":"",
|
||||
"sidepreblocks": "<h2>Pre blocks html goes here</h2>",
|
||||
"sidepostblocks": "<h2>Post blocks html goes here</h2>",
|
||||
"haspreblocks":true,
|
||||
"haspostblocks":true,
|
||||
"bodyattributes": ""
|
||||
}
|
||||
}}
|
||||
{{> theme_boost/head }}
|
||||
|
||||
<body {{{ bodyattributes }}}>
|
||||
|
||||
<div id="page-wrapper">
|
||||
|
||||
{{{ output.standard_top_of_body_html }}}
|
||||
|
||||
{{>theme_classic/navbar-secure}}
|
||||
|
||||
<div id="page" class="container-fluid">
|
||||
{{! Secured full header }}
|
||||
|
||||
<div id="page-header" class="row">
|
||||
<div class="col-12 py-3">
|
||||
<div class="page-context-header">
|
||||
<div class="page-header-headings">
|
||||
{{{ output.page_heading }}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="page-content" class="row {{#haspreblocks}} blocks-pre {{/haspreblocks}} {{#haspostblocks}} blocks-post {{/haspostblocks}}">
|
||||
<div id="region-main-box" class="region-main col-12">
|
||||
<section id="region-main" aria-label="{{#str}}content{{/str}}">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{{ output.course_content_header }}}
|
||||
{{{ output.main_content }}}
|
||||
{{{ output.course_content_footer }}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="columnleft {{#haspreblocks}} has-blocks {{/haspreblocks}}">
|
||||
<section data-region="blocks-column" class="hidden-print" aria-label="{{#str}}blocks{{/str}}">
|
||||
{{{ sidepreblocks }}}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="columnright {{#haspostblocks}} has-blocks {{/haspostblocks}}">
|
||||
<section data-region="blocks-column" class="hidden-print" aria-label="{{#str}}blocks{{/str}}">
|
||||
{{{ sidepostblocks }}}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer id="page-footer" class="py-3 bg-dark text-light">
|
||||
<div class="container">
|
||||
<div id="course-footer">{{{ output.course_footer }}}</div>
|
||||
|
||||
{{{ output.standard_end_of_body_html }}}
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{{#js}}
|
||||
require(['theme_boost/loader']);
|
||||
{{/js}}
|
33
theme/classic/version.php
Normal file
33
theme/classic/version.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Classic theme.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2018 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
// This line protects the file from being accessed by a URL directly.
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2019030100;
|
||||
$plugin->requires = 2019030100;
|
||||
$plugin->component = 'theme_classic';
|
||||
$plugin->dependencies = [
|
||||
'theme_boost' => 2019022600
|
||||
];
|
Loading…
x
Reference in New Issue
Block a user