MDL-64506 theme_clean: Remove Clean from core

This commit is contained in:
Mathew May 2019-02-28 12:02:50 +08:00
parent 7204a990e5
commit cc1e1d8ffc
17 changed files with 0 additions and 1256 deletions

View File

@ -1,106 +0,0 @@
/* How to copy and customise this theme.
----------------------------------------*/
This document describes how to copy and customise the Clean (bootstrapbase) theme so that
you can build on this to create a theme of your own. It assumes you have some
understanding of how themes work within Moodle 2.5, as well as a basic understanding
of HTML and CSS.
Getting started
---------------
From your Moodle theme directory right click on clean and then copy and paste back
into your Moodle theme directory. You should now have a folder called Copy of clean.
If you right click this folder you are given the option to Rename it. So rename this
folder to your chosen theme name, using only lower case letters, and if needed,
underscores. For the purpose of this tutorial we will call the theme 'cleantheme'.
On opening 'cleantheme' your you will find several files and sub-directories which have
files within them.
These are:
config.php
Where all the theme configurations are made.
(Contains some elements that require renaming).
lib.php
Where all the functions for the themes settings are found.
(Contains some elements that require renaming).
settings.php
Where all the setting for this theme are created.
(Contains some elements that require renaming).
version.php
Where the version number and plugin component information is kept.
(Contains some elements that require renaming).
/lang/
This directory contains all language sub-directories for other languages
if and when you want to add them.
/lang/en/
This sub-directory contains your language files, in this case English.
/lang/en/theme_clean.php
This file contains all the language strings for your theme.
(Contains some elements that require renaming as well as the filename itself).
/layout/
This directory contains all the layout files for this theme.
/layout/columns1.php
Layout file for a one column layout (content only).
(Contains some elements that require renaming).
/layout/columns2.php
Layout file for a two column layout (side-pre and content).
(Contains some elements that require renaming).
/layout/columns3.php
Layout file for a three column layout (side-pre, content and side-post) and the front page.
(Contains some elements that require renaming).
/layout/embedded.php
Embedded layout file for embeded pages, like iframe/object embeded in moodleform.
(Contains some elements that require renaming).
/layout/maintenance.php
Maintenance layout file which does not have any blocks, links, or API calls that would lead to database or cache interaction.
(Contains some elements that require renaming).
/layout/secure.php
Secure layout file for safebrowser and securewindow.
(Contains some elements that require renaming).
/style/
This directory contains all the CSS files for this theme.
/style/custom.css
This is where all the settings CSS is generated.
/pix/
This directory contains a screen shot of this theme as well as a favicon
and any images used in the theme.
Renaming elements
-----------------
The problem when copying a theme is that you need to rename all those instances
where the old theme name occurs, in this case clean. So using the above list as
a guide, search through and change all the instances of the theme name
'clean' to 'cleantheme'. This includes the filename of the lang/en/theme_clean.php.
You need to change this to 'theme_cleantheme.php'.
Installing your theme
---------------------
Once all the changes to the name have been made, you can safely install the theme.
If you are already logged in just refreshing the browser should trigger your Moodle
site to begin the install 'Plugins Check'.
If not then navigate to Administration > Notifications.
Once your theme is successfully installed you can select it and begin to modify
it using the custom settings page found by navigating to...
Administration > Site Administration > Appearance > Themes >>
and then click on (Cleantheme) or whatever you renamed your theme to,
from the list of theme names that appear at this point in the side block.
Customisation using custom theme settings
-----------------------------------------
The settings page for the Clean theme can be located by navigating to:
Administration > Site Administration > Appearance > Themes > Clean
Moodle documentation
--------------------
Further information can be found on Moodle Docs: http://docs.moodle.org/dev/Clean_theme

View File

@ -1,167 +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/>.
require_once($CFG->dirroot . '/theme/bootstrapbase/renderers.php');
/**
* Clean core renderers.
*
* @package theme_clean
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class theme_clean_core_renderer extends theme_bootstrapbase_core_renderer {
/**
* Either returns the parent version of the header bar, or a version with the logo replacing the header.
*
* @since Moodle 2.9
* @param array $headerinfo An array of header information, dependant on what type of header is being displayed. The following
* array example is user specific.
* heading => Override the page heading.
* user => User object.
* usercontext => user context.
* @param int $headinglevel What level the 'h' tag will be.
* @return string HTML for the header bar.
*/
public function context_header($headerinfo = null, $headinglevel = 1) {
if ($this->should_render_logo($headinglevel)) {
return html_writer::tag('div', '', array('class' => 'logo'));
}
return parent::context_header($headerinfo, $headinglevel);
}
/**
* Determines if we should render the logo.
*
* @param int $headinglevel What level the 'h' tag will be.
* @return bool Should the logo be rendered.
*/
protected function should_render_logo($headinglevel = 1) {
global $PAGE;
// Only render the logo if we're on the front page or login page
// and the theme has a logo.
$logo = $this->get_logo_url();
if ($headinglevel == 1 && !empty($logo)) {
if ($PAGE->pagelayout == 'frontpage' || $PAGE->pagelayout == 'login') {
return true;
}
}
return false;
}
/**
* Returns the navigation bar home reference.
*
* The small logo is only rendered on pages where the logo is not displayed.
*
* @param bool $returnlink Whether to wrap the icon and the site name in links or not
* @return string The site name, the small logo or both depending on the theme settings.
*/
public function navbar_home($returnlink = true) {
global $CFG;
$imageurl = $this->get_compact_logo_url(null, 35);
if ($this->should_render_logo() || empty($imageurl)) {
// If there is no small logo we always show the site name.
return $this->get_home_ref($returnlink);
}
$image = html_writer::img($imageurl, get_string('sitelogo', 'theme_' . $this->page->theme->name),
array('class' => 'small-logo'));
if ($returnlink) {
$logocontainer = html_writer::link(new moodle_url('/'), $image,
array('class' => 'small-logo-container', 'title' => get_string('home')));
} else {
$logocontainer = html_writer::tag('span', $image, array('class' => 'small-logo-container'));
}
// Sitename setting defaults to true.
if (!isset($this->page->theme->settings->sitename) || !empty($this->page->theme->settings->sitename)) {
return $logocontainer . $this->get_home_ref($returnlink);
}
return $logocontainer;
}
/**
* Returns a reference to the site home.
*
* It can be either a link or a span.
*
* @param bool $returnlink
* @return string
*/
protected function get_home_ref($returnlink = true) {
global $CFG, $SITE;
$sitename = format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID)));
if ($returnlink) {
return html_writer::link(new moodle_url('/'), $sitename, array('class' => 'brand', 'title' => get_string('home')));
}
return html_writer::tag('span', $sitename, array('class' => 'brand'));
}
/**
* Return the theme logo URL, else the site's logo URL, if any.
*
* Note that maximum sizes are not applied to the theme logo.
*
* @param int $maxwidth The maximum width, or null when the maximum width does not matter.
* @param int $maxheight The maximum height, or null when the maximum height does not matter.
* @return moodle_url|false
*/
public function get_logo_url($maxwidth = null, $maxheight = 100) {
global $CFG;
if (!empty($this->page->theme->settings->logo)) {
$url = $this->page->theme->setting_file_url('logo', 'logo');
// Get a URL suitable for moodle_url.
$relativebaseurl = preg_replace('|^https?://|i', '//', $CFG->wwwroot);
$url = str_replace($relativebaseurl, '', $url);
return new moodle_url($url);
}
return parent::get_logo_url($maxwidth, $maxheight);
}
/**
* Return the theme's compact logo URL, else the site's compact logo URL, if any.
*
* Note that maximum sizes are not applied to the theme logo.
*
* @param int $maxwidth The maximum width, or null when the maximum width does not matter.
* @param int $maxheight The maximum height, or null when the maximum height does not matter.
* @return moodle_url|false
*/
public function get_compact_logo_url($maxwidth = 100, $maxheight = 100) {
global $CFG;
if (!empty($this->page->theme->settings->smalllogo)) {
$url = $this->page->theme->setting_file_url('smalllogo', 'smalllogo');
// Get a URL suitable for moodle_url.
$relativebaseurl = preg_replace('|^https?://|i', '//', $CFG->wwwroot);
$url = str_replace($relativebaseurl, '', $url);
return new moodle_url($url);
}
return parent::get_compact_logo_url($maxwidth, $maxheight);
}
}

View File

@ -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_clean.
*
* @package theme_clean
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace theme_clean\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* The clean 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';
}
}

View File

@ -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/>.
/**
* Moodle's Clean theme, an example of how to make a Bootstrap theme
*
* DO NOT MODIFY THIS THEME!
* COPY IT FIRST, THEN RENAME THE COPY AND MODIFY IT INSTEAD.
*
* For full information about creating Moodle themes, see:
* http://docs.moodle.org/dev/Themes_2.0
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$THEME->name = 'clean';
/////////////////////////////////
// The only thing you need to change in this file when copying it to
// create a new theme is the name above. You also need to change the name
// in version.php and lang/en/theme_clean.php as well.
//////////////////////////////////
//
$THEME->doctype = 'html5';
$THEME->parents = array('bootstrapbase');
$THEME->sheets = array('custom');
$THEME->yuicssmodules = array();
$THEME->enable_dock = true;
$THEME->editor_sheets = array();
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->csspostprocess = 'theme_clean_process_css';

View File

@ -1,70 +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/>.
/**
* Strings for component 'theme_clean', language 'en'
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['choosereadme'] = '<div class="clearfix">
<div class="well">
<h2>Clean</h2>
<p><img class="img-polaroid "src="clean/pix/screenshot.jpg" /></p>
</div>
<div class="well">
<h3>About</h3>
<p>Clean is a modified Moodle bootstrap theme which inherits styles and renderers from its parent theme.</p>
<h3>Parents</h3>
<p>This theme is based upon the Bootstrap theme, which was created for Moodle 2.5, with the help of:<br>
Stuart Lamour, Mark Aberdour, Paul Hibbitts, Mary Evans.</p>
<h3>Theme Credits</h3>
<p>Authors: Bas Brands, David Scotson, Mary Evans<br>
Contact: bas@sonsbeekmedia.nl<br>
Website: <a href="http://www.basbrands.nl">www.basbrands.nl</a>
</p>
<h3>Report a bug:</h3>
<p><a href="http://tracker.moodle.org">http://tracker.moodle.org</a></p>
<h3>More information</h3>
<p><a href="clean/README.txt">How to copy and customise this theme.</a></p>
</div></div>';
$string['configtitle'] = 'Clean';
$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['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'] = 'Clean';
$string['privacy:metadata'] = 'The Clean theme does not store any personal data about any user.';
$string['region-side-post'] = 'Right';
$string['region-side-pre'] = 'Left';
$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.';

View File

@ -1,90 +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/>.
/**
* The one column layout.
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Get the HTML for the settings bits.
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
<?php echo $OUTPUT->standard_head_html() ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body <?php echo $OUTPUT->body_attributes(); ?>>
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<header role="banner" class="navbar navbar-fixed-top<?php echo $html->navbarclass ?> moodle-has-zindex">
<nav role="navigation" class="navbar-inner">
<div class="container-fluid">
<?php echo $OUTPUT->navbar_home(); ?>
<?php echo $OUTPUT->navbar_button(); ?>
<?php echo $OUTPUT->user_menu(); ?>
<?php echo $OUTPUT->navbar_plugin_output(); ?>
<?php echo $OUTPUT->search_box(); ?>
<div class="nav-collapse collapse">
<?php echo $OUTPUT->custom_menu(); ?>
<ul class="nav pull-right">
<li><?php echo $OUTPUT->page_heading_menu(); ?></li>
</ul>
</div>
</div>
</nav>
</header>
<div id="page" class="container-fluid">
<?php echo $OUTPUT->full_header(); ?>
<div id="page-content" class="row-fluid">
<section id="region-main" class="span12">
<?php
echo $OUTPUT->course_content_header();
echo $OUTPUT->main_content();
echo $OUTPUT->activity_navigation();
echo $OUTPUT->course_content_footer();
?>
</section>
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>
<footer id="page-footer">
<div id="course-footer"><?php echo $OUTPUT->course_footer(); ?></div>
<p class="helplink"><?php echo $OUTPUT->page_doc_link(); ?></p>
<?php
echo $html->footnote;
echo $OUTPUT->login_info();
echo $OUTPUT->home_link();
echo $OUTPUT->standard_footer_html();
?>
</footer>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</div>
</body>
</html>

View File

@ -1,92 +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/>.
/**
* The two column layout.
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Get the HTML for the settings bits.
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
$regionmain = 'span9 pull-right';
$sidepre = 'span3 desktop-first-column';
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
<?php echo $OUTPUT->standard_head_html() ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body <?php echo $OUTPUT->body_attributes('two-column'); ?>>
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<header role="banner" class="navbar navbar-fixed-top<?php echo $html->navbarclass ?> moodle-has-zindex">
<nav role="navigation" class="navbar-inner">
<div class="container-fluid">
<?php echo $OUTPUT->navbar_home(); ?>
<?php echo $OUTPUT->navbar_button(); ?>
<?php echo $OUTPUT->user_menu(); ?>
<?php echo $OUTPUT->navbar_plugin_output(); ?>
<?php echo $OUTPUT->search_box(); ?>
<div class="nav-collapse collapse">
<?php echo $OUTPUT->custom_menu(); ?>
<ul class="nav pull-right">
<li><?php echo $OUTPUT->page_heading_menu(); ?></li>
</ul>
</div>
</div>
</nav>
</header>
<div id="page" class="container-fluid">
<?php echo $OUTPUT->full_header(); ?>
<div id="page-content" class="row-fluid">
<section id="region-main" class="<?php echo $regionmain; ?>">
<?php
echo $OUTPUT->course_content_header();
echo $OUTPUT->main_content();
echo $OUTPUT->course_content_footer();
?>
</section>
<?php echo $OUTPUT->blocks('side-pre', $sidepre);
?>
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>
<footer id="page-footer">
<div id="course-footer"><?php echo $OUTPUT->course_footer(); ?></div>
<p class="helplink"><?php echo $OUTPUT->page_doc_link(); ?></p>
<?php
echo $html->footnote;
echo $OUTPUT->login_info();
echo $OUTPUT->home_link();
echo $OUTPUT->standard_footer_html();
?>
</footer>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</div>
</body>
</html>

View File

@ -1,105 +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/>.
/**
* Moodle's Clean theme, an example of how to make a Bootstrap theme
*
* DO NOT MODIFY THIS THEME!
* COPY IT FIRST, THEN RENAME THE COPY AND MODIFY IT INSTEAD.
*
* For full information about creating Moodle themes, see:
* http://docs.moodle.org/dev/Themes_2.0
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Get the HTML for the settings bits.
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
$regionmainbox = 'span9 desktop-first-column';
$regionmain = 'span8 pull-right';
$sidepre = 'span4 desktop-first-column';
$sidepost = 'span3 pull-right';
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
<?php echo $OUTPUT->standard_head_html() ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body <?php echo $OUTPUT->body_attributes(); ?>>
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<header role="banner" class="navbar navbar-fixed-top<?php echo $html->navbarclass ?> moodle-has-zindex">
<nav role="navigation" class="navbar-inner">
<div class="container-fluid">
<?php echo $OUTPUT->navbar_home(); ?>
<?php echo $OUTPUT->navbar_button(); ?>
<?php echo $OUTPUT->user_menu(); ?>
<?php echo $OUTPUT->navbar_plugin_output(); ?>
<?php echo $OUTPUT->search_box(); ?>
<div class="nav-collapse collapse">
<?php echo $OUTPUT->custom_menu(); ?>
<ul class="nav pull-right">
<li><?php echo $OUTPUT->page_heading_menu(); ?></li>
</ul>
</div>
</div>
</nav>
</header>
<div id="page" class="container-fluid">
<?php echo $OUTPUT->full_header(); ?>
<div id="page-content" class="row-fluid">
<div id="region-main-box" class="<?php echo $regionmainbox; ?>">
<div class="row-fluid">
<section id="region-main" class="<?php echo $regionmain; ?>">
<?php
echo $OUTPUT->course_content_header();
echo $OUTPUT->main_content();
echo $OUTPUT->activity_navigation();
echo $OUTPUT->course_content_footer();
?>
</section>
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
</div>
</div>
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>
<footer id="page-footer">
<div id="course-footer"><?php echo $OUTPUT->course_footer(); ?></div>
<p class="helplink"><?php echo $OUTPUT->page_doc_link(); ?></p>
<?php
echo $html->footnote;
echo $OUTPUT->login_info();
echo $OUTPUT->home_link();
echo $OUTPUT->standard_footer_html();
?>
</footer>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</div>
</body>
</html>

View File

@ -1,43 +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/>.
/**
* The embedded layout.
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
<?php echo $OUTPUT->standard_head_html() ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body <?php echo $OUTPUT->body_attributes(); ?>>
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<div id="page">
<div id="page-content" class="clearfix">
<?php echo $OUTPUT->main_content(); ?>
</div>
</div>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</body>
</html>

View File

@ -1,63 +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/>.
/**
* The maintenance layout.
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Get the HTML for the settings bits.
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
<?php echo $OUTPUT->standard_head_html() ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body <?php echo $OUTPUT->body_attributes(); ?>>
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<div id="page" class="container-fluid">
<header id="page-header" class="clearfix">
<?php echo $html->heading; ?>
</header>
<div id="page-content" class="row-fluid">
<section id="region-main" class="span12">
<?php echo $OUTPUT->main_content(); ?>
</section>
</div>
<footer id="page-footer">
<?php
echo $OUTPUT->standard_footer_html();
?>
</footer>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</div>
</body>
</html>

View File

@ -1,83 +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/>.
/**
* The secure layout.
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Get the HTML for the settings bits.
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);
$regionmainbox = 'span9 desktop-first-column';
$regionmain = 'span8 pull-right';
$sidepre = 'span4 desktop-first-column';
$sidepost = 'span3 pull-right';
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes(); ?>>
<head>
<title><?php echo $OUTPUT->page_title(); ?></title>
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" />
<?php echo $OUTPUT->standard_head_html() ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body <?php echo $OUTPUT->body_attributes(); ?>>
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<header role="banner" class="navbar navbar-fixed-top moodle-has-zindex">
<nav role="navigation" class="navbar-inner">
<div class="container-fluid">
<?php echo $OUTPUT->navbar_home(false); ?>
<?php echo $OUTPUT->navbar_button(); ?>
<div class="nav-collapse collapse">
<ul class="nav pull-right">
<li><?php echo $OUTPUT->page_heading_menu(); ?></li>
<li class="navbar-text"><?php echo $OUTPUT->login_info(false) ?></li>
</ul>
</div>
</div>
</nav>
</header>
<div id="page" class="container-fluid">
<header id="page-header" class="clearfix">
<?php echo $html->heading; ?>
</header>
<div id="page-content" class="row-fluid">
<div id="region-main-box" class="<?php echo $regionmainbox; ?>">
<div class="row-fluid">
<section id="region-main" class="<?php echo $regionmain; ?>">
<?php echo $OUTPUT->main_content(); ?>
</section>
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
</div>
</div>
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
</div>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</div>
</body>
</html>

View File

@ -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/>.
/**
* Moodle's Clean theme, an example of how to make a Bootstrap theme
*
* DO NOT MODIFY THIS THEME!
* COPY IT FIRST, THEN RENAME THE COPY AND MODIFY IT INSTEAD.
*
* For full information about creating Moodle themes, see:
* http://docs.moodle.org/dev/Themes_2.0
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* 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_clean_process_css($css, $theme) {
global $OUTPUT;
// Set the background image for the logo.
$logo = $OUTPUT->get_logo_url(null, 75);
$css = theme_clean_set_logo($css, $logo);
// Set custom CSS.
if (!empty($theme->settings->customcss)) {
$customcss = $theme->settings->customcss;
} else {
$customcss = null;
}
$css = theme_clean_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_clean_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_clean_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
if ($context->contextlevel == CONTEXT_SYSTEM and ($filearea === 'logo' || $filearea === 'smalllogo')) {
$theme = theme_config::load('clean');
// 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_clean_set_customcss($css, $customcss) {
$tag = '[[setting:customcss]]';
$replacement = $customcss;
if (is_null($replacement)) {
$replacement = '';
}
$css = str_replace($tag, $replacement, $css);
return $css;
}
/**
* Returns an object containing HTML for the areas affected by settings.
*
* Do not add Clean specific logic in here, child themes should be able to
* rely on that function just by declaring settings with similar names.
*
* @param renderer_base $output Pass in $OUTPUT.
* @param moodle_page $page Pass in $PAGE.
* @return stdClass An object with the following properties:
* - navbarclass A CSS class to use on the navbar. By default ''.
* - heading HTML to use for the heading. A logo if one is selected or the default heading.
* - footnote HTML to use as a footnote. By default ''.
*/
function theme_clean_get_html_for_settings(renderer_base $output, moodle_page $page) {
global $CFG;
$return = new stdClass;
$return->navbarclass = '';
if (!empty($page->theme->settings->invert)) {
$return->navbarclass .= ' navbar-inverse';
}
// Only display the logo on the front page and login page, if one is defined.
if (!empty($page->theme->settings->logo) &&
($page->pagelayout == 'frontpage' || $page->pagelayout == 'login')) {
$return->heading = html_writer::tag('div', '', array('class' => 'logo'));
} else {
$return->heading = $output->page_heading();
}
$return->footnote = '';
if (!empty($page->theme->settings->footnote)) {
$return->footnote = '<div class="footnote text-center">'.format_text($page->theme->settings->footnote).'</div>';
}
return $return;
}
/**
* All theme functions should start with theme_clean_
* @deprecated since 2.5.1
*/
function clean_process_css() {
throw new coding_exception('Please call theme_'.__FUNCTION__.' instead of '.__FUNCTION__);
}
/**
* All theme functions should start with theme_clean_
* @deprecated since 2.5.1
*/
function clean_set_logo() {
throw new coding_exception('Please call theme_'.__FUNCTION__.' instead of '.__FUNCTION__);
}
/**
* All theme functions should start with theme_clean_
* @deprecated since 2.5.1
*/
function clean_set_customcss() {
throw new coding_exception('Please call theme_'.__FUNCTION__.' instead of '.__FUNCTION__);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

@ -1,84 +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/>.
/**
* Moodle's Clean theme, an example of how to make a Bootstrap theme
*
* DO NOT MODIFY THIS THEME!
* COPY IT FIRST, THEN RENAME THE COPY AND MODIFY IT INSTEAD.
*
* For full information about creating Moodle themes, see:
* http://docs.moodle.org/dev/Themes_2.0
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
// Invert Navbar to dark background.
$name = 'theme_clean/invert';
$title = get_string('invert', 'theme_clean');
$description = get_string('invertdesc', 'theme_clean');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Logo file setting.
$name = 'theme_clean/logo';
$title = get_string('logo','theme_clean');
$description = get_string('logodesc', 'theme_clean');
$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_clean/smalllogo';
$title = get_string('smalllogo', 'theme_clean');
$description = get_string('smalllogodesc', 'theme_clean');
$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_clean/sitename';
$title = get_string('sitename', 'theme_clean');
$description = get_string('sitenamedesc', 'theme_clean');
$setting = new admin_setting_configcheckbox($name, $title, $description, 1);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Custom CSS file.
$name = 'theme_clean/customcss';
$title = get_string('customcss', 'theme_clean');
$description = get_string('customcssdesc', 'theme_clean');
$default = '';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Footnote setting.
$name = 'theme_clean/footnote';
$title = get_string('footnote', 'theme_clean');
$description = get_string('footnotedesc', 'theme_clean');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
}

View File

@ -1,41 +0,0 @@
/* Custom CSS
-------------------------*/
div.logo {
background: url([[setting:logo]]) 0 0 no-repeat;
background-size: contain;
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]]

View File

@ -1,38 +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/>.
/**
* Moodle's Clean theme, an example of how to make a Bootstrap theme
*
* DO NOT MODIFY THIS THEME!
* COPY IT FIRST, THEN RENAME THE COPY AND MODIFY IT INSTEAD.
*
* For full information about creating Moodle themes, see:
* http://docs.moodle.org/dev/Themes_2.0
*
* @package theme_clean
* @copyright 2013 Moodle, moodle.org
* @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_clean';
$plugin->dependencies = array(
'theme_bootstrapbase' => 2018112800,
);