Issue Details (XML | Word | Printable)

Key: MDL-19097
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Tim Hunt
Reporter: Tim Hunt
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

moodle_page::set_course should not initialise theme, etc. unless it is $PAGE

Created: 07/May/09 02:20 PM   Updated: 01/Jul/09 01:46 PM
Return to search
Component/s: Blocks
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Tim Hunt
Security Level: None
Resolved date: 01/Jul/09
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
However, there was a good reason for doing it as soon as possible, rather than waiting for starting_output.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Tim Hunt added a comment - 01/Jul/09 01:46 PM
Done.

Tim Hunt made changes - 01/Jul/09 01:46 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
tjhunt committed 37 files to 'Moodle CVS' - 01/Jul/09 01:54 PM
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.
MODIFY theme/oceanblue/styles.php   Rev. 1.36    (+27 -19 lines)
MODIFY lib/weblib.php   Rev. 1.1283    (+5 -821 lines)
MODIFY theme/wood/styles.php   Rev. 1.8    (+27 -19 lines)
MODIFY lib/setuplib.php   Rev. 1.65    (+51 -18 lines)
MODIFY theme/custom_corners/styles.php   Rev. 1.5    (+26 -18 lines)
MODIFY theme/index.php   Rev. 1.46    (+135 -135 lines)
MODIFY theme/orangewhitepda/styles.php   Rev. 1.8    (+27 -19 lines)
MODIFY lib/blocklib.php   Rev. 1.186    (+4 -0 lines)
MODIFY theme/standardwhite/styles.php   Rev. 1.42    (+27 -19 lines)
MODIFY theme/metal/styles.php   Rev. 1.15    (+27 -19 lines)
MODIFY theme/standard/styles.php   Rev. 1.68    (+27 -19 lines)
MODIFY theme/standardred/styles.php   Rev. 1.46    (+27 -19 lines)
MODIFY lib/outputlib.php   Rev. 1.12    (+457 -48 lines)
MODIFY login/index.php   Rev. 1.152    (+2 -2 lines)
MODIFY theme/cornflower/styles.php   Rev. 1.18    (+27 -18 lines)
MODIFY lang/en_utf8/admin.php   Rev. 1.295    (+2 -0 lines)
MODIFY theme/standard/styles_color.css   Rev. 1.204    (+12 -0 lines)
MODIFY theme/anomaly/styles.php   Rev. 1.2    (+26 -16 lines)
MODIFY theme/lines/styles.php   Rev. 1.3    (+27 -19 lines)
MODIFY theme/orangewhite/styles.php   Rev. 1.11    (+27 -19 lines)
DEL lib/Attic/cssconstants.php   Rev. 1.4    (+0 -0 lines)
MODIFY theme/preview.php   Rev. 1.11    (+47 -39 lines)
MODIFY theme/colors/styles.php   Rev. 1.3    (+27 -19 lines)
MODIFY course/category.php   Rev. 1.144    (+1 -6 lines)
MODIFY theme/standardblue/styles.php   Rev. 1.46    (+27 -19 lines)
MODIFY lib/pagelib.php   Rev. 1.128    (+200 -11 lines)
MODIFY admin/settings/appearance.php   Rev. 1.46    (+2 -1 lines)
MODIFY lib/moodlelib.php   Rev. 1.1224    (+2 -18 lines)
MODIFY lib/setup.php   Rev. 1.278    (+22 -22 lines)
MODIFY theme/standardgreen/styles.php   Rev. 1.46    (+27 -19 lines)
MODIFY lib/adminlib.php   Rev. 1.372    (+7 -7 lines)
MODIFY theme/chameleon/styles.php   Rev. 1.7    (+27 -19 lines)
MODIFY lib/deprecatedlib.php   Rev. 1.119    (+49 -0 lines)
ADD theme/styles.php   Rev. 1.1    (+0 -0 lines)
MODIFY config-dist.php   Rev. 1.118    (+3 -3 lines)
MODIFY theme/formal_white/styles.php   Rev. 1.23    (+27 -19 lines)
MODIFY theme/standardlogo/styles.php   Rev. 1.47    (+27 -19 lines)