mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-64506 theme_more: Remove More from core
This commit is contained in:
parent
280cfdf05c
commit
7204a990e5
@ -1,46 +0,0 @@
|
||||
<?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_more.
|
||||
*
|
||||
* @package theme_more
|
||||
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace theme_more\privacy;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* The more theme does not store any data.
|
||||
*
|
||||
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
|
||||
* @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';
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?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 More config file.
|
||||
*
|
||||
* @package theme_more
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$THEME->name = 'more';
|
||||
$THEME->parents = array('clean', 'bootstrapbase');
|
||||
|
||||
$THEME->doctype = 'html5';
|
||||
$THEME->sheets = array('custom');
|
||||
$THEME->lessfile = 'moodle';
|
||||
$THEME->usefallback = true;
|
||||
$THEME->parents_exclude_sheets = array('bootstrapbase' => array('moodle'), 'clean' => array('custom'));
|
||||
$THEME->lessvariablescallback = 'theme_more_less_variables';
|
||||
$THEME->extralesscallback = 'theme_more_extra_less';
|
||||
$THEME->yuicssmodules = array();
|
||||
$THEME->enable_dock = true;
|
||||
$THEME->editor_sheets = array();
|
||||
|
||||
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
|
||||
$THEME->csspostprocess = 'theme_more_process_css';
|
@ -1,47 +0,0 @@
|
||||
<?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 More install.
|
||||
*
|
||||
* @package theme_more
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Theme_more install function.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function xmldb_theme_more_install() {
|
||||
global $CFG;
|
||||
|
||||
// Set the default background.
|
||||
$fs = get_file_storage();
|
||||
|
||||
$filerecord = new stdClass();
|
||||
$filerecord->component = 'theme_more';
|
||||
$filerecord->contextid = context_system::instance()->id;
|
||||
$filerecord->userid = get_admin()->id;
|
||||
$filerecord->filearea = 'backgroundimage';
|
||||
$filerecord->filepath = '/';
|
||||
$filerecord->itemid = 0;
|
||||
$filerecord->filename = 'background.jpg';
|
||||
$fs->create_file_from_pathname($filerecord, $CFG->dirroot . '/theme/more/pix/background.jpg');
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
<?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 More upgrade.
|
||||
*
|
||||
* @package theme_more
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Theme_more upgrade function.
|
||||
*
|
||||
* @param int $oldversion The version we upgrade from.
|
||||
* @return bool
|
||||
*/
|
||||
function xmldb_theme_more_upgrade($oldversion) {
|
||||
global $CFG;
|
||||
|
||||
// Automatically generated Moodle v3.3.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.4.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.6.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
<?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 More lang file.
|
||||
*
|
||||
* @package theme_more
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['backgroundfixed'] = 'Background fixed';
|
||||
$string['backgroundfixed_desc'] = 'Use this setting to fix the background image to the page.';
|
||||
$string['backgroundimage'] = 'Background image';
|
||||
$string['backgroundimage_desc'] = 'The image to display as a background of the site.';
|
||||
$string['backgroundposition'] = 'Background position';
|
||||
$string['backgroundposition_desc'] = 'The position of the background image.';
|
||||
$string['backgroundpositioncenterbottom'] = 'Center bottom';
|
||||
$string['backgroundpositioncentercenter'] = 'Center center';
|
||||
$string['backgroundpositioncentertop'] = 'Center top';
|
||||
$string['backgroundpositionleftbottom'] = 'Left bottom';
|
||||
$string['backgroundpositionleftcenter'] = 'Left center';
|
||||
$string['backgroundpositionlefttop'] = 'Left top';
|
||||
$string['backgroundpositionrightbottom'] = 'Right bottom';
|
||||
$string['backgroundpositionrightcenter'] = 'Right center';
|
||||
$string['backgroundpositionrighttop'] = 'Right top';
|
||||
$string['backgroundrepeat'] = 'Background repeat';
|
||||
$string['backgroundrepeat_desc'] = 'Defines the way the background image will be repeated.';
|
||||
$string['backgroundrepeatnorepeat'] = 'No repeat';
|
||||
$string['backgroundrepeatrepeat'] = 'Repeat';
|
||||
$string['backgroundrepeatrepeatx'] = 'Repeat horizontally';
|
||||
$string['backgroundrepeatrepeaty'] = 'Repeat vertically';
|
||||
$string['bodybackground'] = 'Background colour';
|
||||
$string['bodybackground_desc'] = 'The main colour to use for the background.';
|
||||
$string['choosereadme'] = '<p>More is a theme that allows you to easily customise Moodle\'s look and feel directly from the web interface.</p>
|
||||
<p>Visit the admin settings to change colours, add an image as a background, add your logo and more.</p>';
|
||||
|
||||
$string['configtitle'] = 'More';
|
||||
$string['contentbackground'] = 'Main content background colour';
|
||||
$string['contentbackground_desc'] = 'The background colour of the main content of the site, leave empty for none.';
|
||||
|
||||
$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['footnote'] = 'Footnote';
|
||||
$string['footnotedesc'] = 'Whatever you add to this textarea will be displayed in the footer throughout your Moodle site.';
|
||||
|
||||
$string['invert'] = 'Invert navbar';
|
||||
$string['invertdesc'] = 'Swaps text and background for the navbar at the top of the page between black and white.';
|
||||
|
||||
$string['linkcolor'] = 'Link colour';
|
||||
$string['linkcolor_desc'] = 'The colour of the links.';
|
||||
$string['logo'] = 'Logo';
|
||||
$string['logodesc'] = 'The logo is only displayed in the header of the front page and login page.<br /> If the height of your logo is more than 75px add div.logo {height: 100px;} to the Custom CSS box below, amending accordingly if the height is other than 100px. If a logo is not added here, the logo in Appearance > Logos will be used.';
|
||||
|
||||
$string['pluginname'] = 'More';
|
||||
$string['privacy:metadata'] = 'The More theme does not store any personal data about any user.';
|
||||
$string['region-side-post'] = 'Right';
|
||||
$string['region-side-pre'] = 'Left';
|
||||
$string['secondarybackground'] = 'Secondary background colour';
|
||||
$string['secondarybackground_desc'] = 'The background colour of any secondary content, such as blocks.';
|
||||
$string['sitelogo'] = 'Site logo';
|
||||
$string['sitename'] = 'Display site name along with small logo';
|
||||
$string['sitenamedesc'] = 'If there is no small logo, the site name is always displayed in the navigation bar. If a small logo is set, it may be displayed with or without the site name.';
|
||||
$string['smalllogo'] = 'Small logo';
|
||||
$string['smalllogodesc'] = 'The small logo is displayed in the navigation bar. If there is a header logo for the front page and login page, the small logo is not displayed on these pages. If a logo is not added here, the compact logo in Appearance > Logos will be used.';
|
||||
$string['textcolor'] = 'Text colour';
|
||||
$string['textcolor_desc'] = 'The colour of the text.';
|
||||
|
@ -1,19 +0,0 @@
|
||||
/**
|
||||
* Import all the rules from the parent.
|
||||
*/
|
||||
@import "../../bootstrapbase/less/moodle.less";
|
||||
|
||||
// Set the secondary background.
|
||||
@tableBackgroundAccent: darken(@wellBackground, 5%);
|
||||
@tableBackgroundHover: darken(@wellBackground, 10%);
|
||||
@tableBorder: @wellBorder;
|
||||
@navbarBackground: @wellBackground;
|
||||
@formActionsBackground: @wellBackground;
|
||||
@paginationActiveBackground: @wellBackground;
|
||||
@hrBorder: darken(@wellBackground, 5%);
|
||||
|
||||
// Remove unwanted text shadow, this can look odd with random colours.
|
||||
.breadcrumb li,
|
||||
.nav-header {
|
||||
text-shadow: none;
|
||||
}
|
@ -1,181 +0,0 @@
|
||||
<?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 More lib.
|
||||
*
|
||||
* @package theme_more
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Extra LESS code to inject.
|
||||
*
|
||||
* This will generate some LESS code from the settings used by the user. We cannot use
|
||||
* the {@link theme_more_less_variables()} here because we need to create selectors or
|
||||
* alter existing ones.
|
||||
*
|
||||
* @param theme_config $theme The theme config object.
|
||||
* @return string Raw LESS code.
|
||||
*/
|
||||
function theme_more_extra_less($theme) {
|
||||
$content = '';
|
||||
$imageurl = $theme->setting_file_url('backgroundimage', 'backgroundimage');
|
||||
// Sets the background image, and its settings.
|
||||
if (!empty($imageurl)) {
|
||||
$content .= 'body { ';
|
||||
$content .= "background-image: url('$imageurl');";
|
||||
if (!empty($theme->settings->backgroundfixed)) {
|
||||
$content .= 'background-attachment: fixed;';
|
||||
}
|
||||
if (!empty($theme->settings->backgroundposition)) {
|
||||
$content .= 'background-position: ' . str_replace('_', ' ', $theme->settings->backgroundposition) . ';';
|
||||
}
|
||||
if (!empty($theme->settings->backgroundrepeat)) {
|
||||
$content .= 'background-repeat: ' . $theme->settings->backgroundrepeat . ';';
|
||||
}
|
||||
$content .= ' }';
|
||||
}
|
||||
// If there the user wants a background for the content, we need to make it look consistent,
|
||||
// therefore we need to round its borders, and adapt the border colour.
|
||||
if (!empty($theme->settings->contentbackground)) {
|
||||
$content .= '
|
||||
#region-main {
|
||||
.well;
|
||||
background-color: ' . $theme->settings->contentbackground . ';
|
||||
border-color: darken(' . $theme->settings->contentbackground . ', 7%);
|
||||
}';
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns variables for LESS.
|
||||
*
|
||||
* We will inject some LESS variables from the settings that the user has defined
|
||||
* for the theme. No need to write some custom LESS for this.
|
||||
*
|
||||
* @param theme_config $theme The theme config object.
|
||||
* @return array of LESS variables without the @.
|
||||
*/
|
||||
function theme_more_less_variables($theme) {
|
||||
$variables = array();
|
||||
if (!empty($theme->settings->bodybackground)) {
|
||||
$variables['bodyBackground'] = $theme->settings->bodybackground;
|
||||
}
|
||||
if (!empty($theme->settings->textcolor)) {
|
||||
$variables['textColor'] = $theme->settings->textcolor;
|
||||
}
|
||||
if (!empty($theme->settings->linkcolor)) {
|
||||
$variables['linkColor'] = $theme->settings->linkcolor;
|
||||
}
|
||||
if (!empty($theme->settings->secondarybackground)) {
|
||||
$variables['wellBackground'] = $theme->settings->secondarybackground;
|
||||
}
|
||||
return $variables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses CSS before it is cached.
|
||||
*
|
||||
* This function can make alterations and replace patterns within the CSS.
|
||||
*
|
||||
* @param string $css The CSS
|
||||
* @param theme_config $theme The theme config object.
|
||||
* @return string The parsed CSS The parsed CSS.
|
||||
*/
|
||||
function theme_more_process_css($css, $theme) {
|
||||
global $OUTPUT;
|
||||
|
||||
// Set the background image for the logo.
|
||||
$logo = $OUTPUT->get_logo_url(null, 100);
|
||||
$css = theme_more_set_logo($css, $logo);
|
||||
|
||||
// Set custom CSS.
|
||||
if (!empty($theme->settings->customcss)) {
|
||||
$customcss = $theme->settings->customcss;
|
||||
} else {
|
||||
$customcss = null;
|
||||
}
|
||||
$css = theme_more_set_customcss($css, $customcss);
|
||||
|
||||
return $css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the logo to CSS.
|
||||
*
|
||||
* @param string $css The CSS.
|
||||
* @param string $logo The URL of the logo.
|
||||
* @return string The parsed CSS
|
||||
*/
|
||||
function theme_more_set_logo($css, $logo) {
|
||||
$tag = '[[setting:logo]]';
|
||||
$replacement = $logo;
|
||||
if (is_null($replacement)) {
|
||||
$replacement = '';
|
||||
}
|
||||
|
||||
$css = str_replace($tag, $replacement, $css);
|
||||
|
||||
return $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_more_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
|
||||
if ($context->contextlevel == CONTEXT_SYSTEM &&
|
||||
($filearea === 'logo' || $filearea === 'smalllogo' || $filearea === 'backgroundimage')) {
|
||||
$theme = theme_config::load('more');
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds any custom CSS to the CSS before it is cached.
|
||||
*
|
||||
* @param string $css The original CSS.
|
||||
* @param string $customcss The custom CSS to add.
|
||||
* @return string The CSS which now contains our custom CSS.
|
||||
*/
|
||||
function theme_more_set_customcss($css, $customcss) {
|
||||
$tag = '[[setting:customcss]]';
|
||||
$replacement = $customcss;
|
||||
if (is_null($replacement)) {
|
||||
$replacement = '';
|
||||
}
|
||||
|
||||
$css = str_replace($tag, $replacement, $css);
|
||||
|
||||
return $css;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 50 KiB |
@ -1,185 +0,0 @@
|
||||
<?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 More settings.
|
||||
*
|
||||
* Each setting that is defined in the parent theme Clean should be
|
||||
* defined here too, and use the exact same config name. The reason
|
||||
* is that theme_more does not define any layout files to re-use the
|
||||
* ones from theme_clean. But as those layout files use the function
|
||||
* {@link theme_clean_get_html_for_settings} that belong to Clean,
|
||||
* we have to make sure it works as expected by having the same settings
|
||||
* in our theme.
|
||||
*
|
||||
* @see theme_clean_get_html_for_settings
|
||||
* @package theme_more
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
if ($ADMIN->fulltree) {
|
||||
|
||||
// @textColor setting.
|
||||
$name = 'theme_more/textcolor';
|
||||
$title = get_string('textcolor', 'theme_more');
|
||||
$description = get_string('textcolor_desc', 'theme_more');
|
||||
$default = '#333366';
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, null, false);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// @linkColor setting.
|
||||
$name = 'theme_more/linkcolor';
|
||||
$title = get_string('linkcolor', 'theme_more');
|
||||
$description = get_string('linkcolor_desc', 'theme_more');
|
||||
$default = '#FF6500';
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, null, false);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// @bodyBackground setting.
|
||||
$name = 'theme_more/bodybackground';
|
||||
$title = get_string('bodybackground', 'theme_more');
|
||||
$description = get_string('bodybackground_desc', 'theme_more');
|
||||
$default = '';
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, null, false);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Background image setting.
|
||||
$name = 'theme_more/backgroundimage';
|
||||
$title = get_string('backgroundimage', 'theme_more');
|
||||
$description = get_string('backgroundimage_desc', 'theme_more');
|
||||
$setting = new admin_setting_configstoredfile($name, $title, $description, 'backgroundimage');
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Background repeat setting.
|
||||
$name = 'theme_more/backgroundrepeat';
|
||||
$title = get_string('backgroundrepeat', 'theme_more');
|
||||
$description = get_string('backgroundrepeat_desc', 'theme_more');;
|
||||
$default = 'repeat';
|
||||
$choices = array(
|
||||
'0' => get_string('default'),
|
||||
'repeat' => get_string('backgroundrepeatrepeat', 'theme_more'),
|
||||
'repeat-x' => get_string('backgroundrepeatrepeatx', 'theme_more'),
|
||||
'repeat-y' => get_string('backgroundrepeatrepeaty', 'theme_more'),
|
||||
'no-repeat' => get_string('backgroundrepeatnorepeat', 'theme_more'),
|
||||
);
|
||||
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Background position setting.
|
||||
$name = 'theme_more/backgroundposition';
|
||||
$title = get_string('backgroundposition', 'theme_more');
|
||||
$description = get_string('backgroundposition_desc', 'theme_more');
|
||||
$default = '0';
|
||||
$choices = array(
|
||||
'0' => get_string('default'),
|
||||
'left_top' => get_string('backgroundpositionlefttop', 'theme_more'),
|
||||
'left_center' => get_string('backgroundpositionleftcenter', 'theme_more'),
|
||||
'left_bottom' => get_string('backgroundpositionleftbottom', 'theme_more'),
|
||||
'right_top' => get_string('backgroundpositionrighttop', 'theme_more'),
|
||||
'right_center' => get_string('backgroundpositionrightcenter', 'theme_more'),
|
||||
'right_bottom' => get_string('backgroundpositionrightbottom', 'theme_more'),
|
||||
'center_top' => get_string('backgroundpositioncentertop', 'theme_more'),
|
||||
'center_center' => get_string('backgroundpositioncentercenter', 'theme_more'),
|
||||
'center_bottom' => get_string('backgroundpositioncenterbottom', 'theme_more'),
|
||||
);
|
||||
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Background fixed setting.
|
||||
$name = 'theme_more/backgroundfixed';
|
||||
$title = get_string('backgroundfixed', 'theme_more');
|
||||
$description = get_string('backgroundfixed_desc', 'theme_more');
|
||||
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Main content background color.
|
||||
$name = 'theme_more/contentbackground';
|
||||
$title = get_string('contentbackground', 'theme_more');
|
||||
$description = get_string('contentbackground_desc', 'theme_more');
|
||||
$default = '#FFFFFF';
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, null, false);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Secondary background color.
|
||||
$name = 'theme_more/secondarybackground';
|
||||
$title = get_string('secondarybackground', 'theme_more');
|
||||
$description = get_string('secondarybackground_desc', 'theme_more');
|
||||
$default = '#FFFFFF';
|
||||
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, null, false);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Invert Navbar to dark background.
|
||||
$name = 'theme_more/invert';
|
||||
$title = get_string('invert', 'theme_more');
|
||||
$description = get_string('invertdesc', 'theme_more');
|
||||
$setting = new admin_setting_configcheckbox($name, $title, $description, 1);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Logo file setting.
|
||||
$name = 'theme_more/logo';
|
||||
$title = get_string('logo','theme_more');
|
||||
$description = get_string('logodesc', 'theme_more');
|
||||
$setting = new admin_setting_configstoredfile($name, $title, $description, 'logo');
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Small logo file setting.
|
||||
$name = 'theme_more/smalllogo';
|
||||
$title = get_string('smalllogo', 'theme_more');
|
||||
$description = get_string('smalllogodesc', 'theme_more');
|
||||
$setting = new admin_setting_configstoredfile($name, $title, $description, 'smalllogo');
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Show site name along with small logo.
|
||||
$name = 'theme_more/sitename';
|
||||
$title = get_string('sitename', 'theme_more');
|
||||
$description = get_string('sitenamedesc', 'theme_more');
|
||||
$setting = new admin_setting_configcheckbox($name, $title, $description, 1);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Custom CSS file.
|
||||
$name = 'theme_more/customcss';
|
||||
$title = get_string('customcss', 'theme_more');
|
||||
$description = get_string('customcssdesc', 'theme_more');
|
||||
$default = '';
|
||||
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
|
||||
// Footnote setting.
|
||||
$name = 'theme_more/footnote';
|
||||
$title = get_string('footnote', 'theme_more');
|
||||
$description = get_string('footnotedesc', 'theme_more');
|
||||
$default = '';
|
||||
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
|
||||
$setting->set_updatedcallback('theme_reset_all_caches');
|
||||
$settings->add($setting);
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/* Custom CSS
|
||||
-------------------------*/
|
||||
div.logo {
|
||||
background: url([[setting:logo]]) 0 0 no-repeat;
|
||||
display: block;
|
||||
float: left;
|
||||
height: 75px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
img.small-logo {
|
||||
float: left;
|
||||
height: 35px;
|
||||
margin: 3px 10px 3px 0;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
img.small-logo {
|
||||
margin: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.navbar img.small-logo {
|
||||
max-width: 150px;
|
||||
}
|
||||
/* Applying accesshide styles */
|
||||
.navbar .small-logo-container + .brand {
|
||||
position: absolute;
|
||||
left: -10000px;
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
/* Custom CSS Settings
|
||||
-------------------------*/
|
||||
[[setting:customcss]]
|
@ -1,33 +0,0 @@
|
||||
<?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 More version file.
|
||||
*
|
||||
* @package theme_more
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2018120300;
|
||||
$plugin->requires = 2018112800;
|
||||
$plugin->component = 'theme_more';
|
||||
$plugin->dependencies = array(
|
||||
'theme_bootstrapbase' => 2018112800,
|
||||
'theme_clean' => 2018112800,
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user