• tjhunt's avatar
    themes: MDL-19077 change how the theme is initialised and CSS is served. · b7009474
    tjhunt authored
    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
    * Fi...