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.
samhemelryk [Tue, 30 Jun 2009 08:33:29 +0000 (08:33 +0000)]
messages MDL-19664 Clean up the messages javascript code
I have cleaned up the message Javascript code, implementing the new PAGE methods
and at the same time implemented the new OUTPUT methods
samhemelryk [Tue, 30 Jun 2009 07:57:41 +0000 (07:57 +0000)]
output MDL-19077 Implemented periodic refresh to meta refresh by delay
Also created layout-popup.php for standardwhite theme to provide a simpler template
tjhunt [Tue, 30 Jun 2009 01:59:48 +0000 (01:59 +0000)]
debug / lang string: MDL-19467 Debugging option to show where each lang string came from.
New option on Administration -> Server -> Debugging called
'Show origin of languages strings' ($CFG->debugstringids).
If this is set, get_string will add the name of the lang file and the id of the string
to each string it gets, so instead of returning 'No', it will return '{No admin/checkboxno}'.
tjhunt [Mon, 29 Jun 2009 08:17:31 +0000 (08:17 +0000)]
MDL-19077 - Finish eliminating customcorners-specific code in core.
The custom-corners-specific code now in theme/customcornser/renderers.php
and lib/deprecatedlib.php.
Also, $CFG->pixpath is now causing more problems than ever. If it is
giving your problems, please call $OUTPUT->initialise_deprecated_cfg_pixpath()
as a temporary fix. As you can imagine, we are thinking about a better
long-term fix, which is why that method as a silly, and easy to grep name.
samhemelryk [Mon, 29 Jun 2009 07:19:05 +0000 (07:19 +0000)]
lib MDL-19077 Created output redirect method and implemented against weblib redirect method
This resolves the meta bug that was used when redirecting with a delay
Thanks Tim for the help with this one
samhemelryk [Mon, 29 Jun 2009 01:58:11 +0000 (01:58 +0000)]
formslib MDL-19626 Fixed broken show/hide advanced button
Updated formslib showadvanced inline JS to use new $PAGE methods
and replaced inline noscript with css handled display
poltawski [Sat, 27 Jun 2009 21:22:50 +0000 (21:22 +0000)]
dml/sqllite MDL-19643 Throw exceptions to make things more robust
Various functions were catching the pdo error and returning
false, but this isn't enough. I have modified the functions to
throw a dml exception like other drivers do.
poltawski [Sat, 27 Jun 2009 21:22:27 +0000 (21:22 +0000)]
dml/sqllite MDL-19642 - Make connections more robust
- Include 'pdo' as an extension to be checked for
- Bail out of a connect and throw an exception if the required
extensions aren't loaded
- Don't ignore pdo exceptions on connect error - throw our
own exception
tjhunt [Fri, 26 Jun 2009 09:06:16 +0000 (09:06 +0000)]
themes: MDL-19077 new $OUTPUT->header/footer to replace print_header/footer.
Also, part of the change from weblib.php functions to $OUTPUT-> methods.
This is part of http://docs.moodle.org/en/Development:Theme_engines_for_Moodle%3F
This is a big change, and the result is not perfect yet. Expect some debugging output
on some pages.
The main part of these changes are that $OUTPUT->header now looks for a file
in the theme called layout.php, rather than header.html and footer.html. Also
you can have special templates for certain pages like layout-home.php. There is
fallback code for Moodle 1.9 themes, so they still work.
A few of the old arguments to print_header are no longer supported. (You get an
exception if you try to use them.) Sam H will be cleaning those up.
All the weblib functions that have been replaced with $OUTPUT-> have version in
deprecatedlib, so existing code will go on working for the foreseeable future.