]> git.mjollnir.org Git - moodle.git/commit
themes: MDL-19077 change how the theme is initialised and CSS is served.
authortjhunt <tjhunt>
Wed, 1 Jul 2009 05:54:26 +0000 (05:54 +0000)
committertjhunt <tjhunt>
Wed, 1 Jul 2009 05:54:26 +0000 (05:54 +0000)
commitb70094743a9c2e71a1844f23d0bd71a0b49644ab
treec571fa3410fba314375e8c581bf0be45f68e9917
parent0456fc1ac42d72fee68de6b200afa3f2d11ae54b
themes: MDL-19077 change how the theme is initialised and CSS is served.

This is part of http://docs.moodle.org/en/Development:Theme_engines_for_Moodle%3F

$THEME is now initialised at the same time as $OUTPUT. Old functions like
theme_setup are deprecated in favour of methods on $PAGE. There is a new
theme_config class in outputlib.php that deals with loading the theme config.php file.

CSS used to be served by themes styles.php files calling a function in weblib.php.
Now it works by each theme's styles.php file doing
$themename = basename(dirname(__FILE__));
require_once(dirname(__FILE__) . '/../../theme/styles.php');
which is less code to be copied into each theme. (Old-style styles.php files still
work thanks to some code in deprecatedlib.php.)

Admin UI for choosing a theme cleaned up.

A couple of theme-specific hard-coded hacks like $THEME->cssconstants and
$THEME->CSSEdit have been replaced by a more generic $THEME->customcssoutputfunction
hook. See examples at the end of outputlib.php

Also:
* Fix setting the theme in the URL, which seems to have been broken since 1.9.
* Fix up errors on a few pages caused by the new initialisation order.
* MDL-19097 moodle_page::set_course should not set $COURSE unless it is $PAGE.
* httpsrequired() from moodlelib.php moved to $PAGE->https_required().
* Move has_started() method to the renderer base class.
* Further fixes to display of early errors.
* Remove print_header/footer_old from weblib. I did not mean to commit them before.
37 files changed:
admin/settings/appearance.php
config-dist.php
course/category.php
lang/en_utf8/admin.php
lib/adminlib.php
lib/blocklib.php
lib/cssconstants.php [deleted file]
lib/deprecatedlib.php
lib/moodlelib.php
lib/outputlib.php
lib/pagelib.php
lib/setup.php
lib/setuplib.php
lib/weblib.php
login/index.php
theme/anomaly/styles.php
theme/chameleon/styles.php
theme/colors/styles.php
theme/cornflower/styles.php
theme/custom_corners/styles.php
theme/formal_white/styles.php
theme/index.php
theme/lines/styles.php
theme/metal/styles.php
theme/oceanblue/styles.php
theme/orangewhite/styles.php
theme/orangewhitepda/styles.php
theme/preview.php
theme/standard/styles.php
theme/standard/styles_color.css
theme/standardblue/styles.php
theme/standardgreen/styles.php
theme/standardlogo/styles.php
theme/standardred/styles.php
theme/standardwhite/styles.php
theme/styles.php [new file with mode: 0644]
theme/wood/styles.php