//
// $CFG->emailconnectionerrorsto = 'your@emailaddress.com';
//
-// NOTE: if you are using custompix in your theme, see /fixpix.php.
-//
// Set the priority of themes from highest to lowest. This is useful (for
// example) in sites where the user theme should override all other theme
// settings for accessibility reasons. You can also disable types of themes
// NOTE: course, category, session, user themes still require the
// respective settings to be enabled
//
-
+// It is possible to add extra themes directory stored outside of $CFG->dirroot.
+// This local directory does not have to be accessible from internet.
+//
+// $CFG->themedir = '/location/of/extra/themes';
+//
//=========================================================================
// 8. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!
//=========================================================================
case PARAM_THEME:
$param = clean_param($param, PARAM_SAFEDIR);
- if (file_exists($CFG->dirroot.'/theme/'.$param)) {
+ if (file_exists("$CFG->dirroot/theme/$param/config.php")) {
+ return $param;
+ } else if (!empty($CFG->themedir) and file_exists("$CFG->themedir/$param/config.php")) {
return $param;
} else {
return ''; // Specified theme is not installed
$fulldirs[] = $CFG->dirroot.'/mod';
} else if ($plugintype === 'theme') {
- // themes are an exception because they may be stored also in dataroot
$fulldirs[] = $CFG->dirroot.'/theme';
+ // themes are special because they may be stored also in separate directory
+ if (!empty($CFG->themedir) and file_exists($CFG->themedir) and is_dir($CFG->themedir) ) {
+ $fulldirs[] = $CFG->themedir;
+ }
} else {
$types = get_plugin_types(true);
$result = array();
- //TODO: MDL-20799 add themedir support
-
foreach ($fulldirs as $fulldir) {
if (!is_dir($fulldir)) {
continue;
$plugins = array();
if (empty($basedir)) {
- // TODO: MDL-20799 megre theme with themedir if defined
$basedir = $CFG->dirroot .'/'. $directory;
} else {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
// we need just the values from config.php and minlib.php
define('ABORT_AFTER_CONFIG', true);
require('../config.php'); // this stops immediately at the beginning of lib/setup.php
image_not_found();
}
-if (!file_exists("$CFG->dirroot/theme/$themename/config.php") and !file_exists("$CFG->dataroot/theme/$themename/config.php")) {
+if (file_exists("$CFG->dirroot/theme/$themename/config.php")) {
+ // exists
+} else if (!empty($CFG->themedir) and file_exists("$CFG->themedir/$themename/config.php")) {
+ // exists
+} else {
image_not_found();
}
$themename = min_optional_param('theme', 'standard', 'SAFEDIR');
$rev = min_optional_param('rev', 0, 'INT');
-if (!file_exists("$CFG->dirroot/theme/$themename/config.php") and !file_exists("$CFG->dataroot/theme/$themename/config.php")) {
+if (file_exists("$CFG->dirroot/theme/$themename/config.php")) {
+ // exists
+} else if (!empty($CFG->themedir) and file_exists("$CFG->themedir/$themename/config.php")) {
+ // exists
+} else {
header('HTTP/1.0 404 not found');
die('Theme was not found, sorry.');
}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
// we need just the values from config.php and minlib.php
define('ABORT_AFTER_CONFIG', true);
require('../config.php'); // this stops immediately at the beginning of lib/setup.php
die('Theme was not found, sorry.');
}
-if (!file_exists("$CFG->dirroot/theme/$themename/config.php") and !file_exists("$CFG->dataroot/theme/$themename/config.php")) {
+if (file_exists("$CFG->dirroot/theme/$themename/config.php")) {
+ // exists
+} else if (!empty($CFG->themedir) and file_exists("$CFG->themedir/$themename/config.php")) {
+ // exists
+} else {
header('HTTP/1.0 404 not found');
die('Theme was not found, sorry.');
}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
// no chaching
define('NO_MOODLE_COOKIES', true); // Session not used here
define('NO_UPGRADE_CHECK', true); // Ignore upgrade check
$subtype = optional_param('subtype', '', PARAM_SAFEDIR);
$sheet = optional_param('sheet', '', PARAM_SAFEDIR);
-if (!file_exists("$CFG->dirroot/theme/$themename/config.php") and !file_exists("$CFG->dataroot/theme/$themename/config.php")) {
+if (file_exists("$CFG->dirroot/theme/$themename/config.php")) {
+ // exists
+} else if (!empty($CFG->themedir) and file_exists("$CFG->themedir/$themename/config.php")) {
+ // exists
+} else {
css_not_found();
}