Пример #1
0
/**
 * Essentials is a basic child theme of Essential to help you as a theme
 * developer create your own child theme of Essential.
 *
 * @package     theme_essentials
 * @copyright   2015 Gareth J Barnard
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
function theme_essentials_process_css($css, $theme)
{
    /* Change to 'false' if you don't want to use Essential's settings and remove '$THEME->parents_exclude_sheets' in config.php.
     *
     * If you want to override any Essential setting with a separate version in this child theme, then define it in 'settings.php' with the
     * same name bar the theme name prefix and 'theme_essential_process_css' will do the rest via 'toolbox.php'.  Please look at the examples
     * already coded in 'settings.php'.
     *  
     * If you want the alternative colours, then remove the overridden method 'custom_menu_themecolours' in the 'theme_essentials_core_renderer'
     * class in the 'core_renderer.php' file in the 'classes' folder. */
    $usingessentialsettings = true;
    if ($usingessentialsettings) {
        global $CFG;
        if (file_exists("{$CFG->dirroot}/theme/essential/lib.php")) {
            require_once "{$CFG->dirroot}/theme/essential/lib.php";
        } else {
            if (!empty($CFG->themedir) and file_exists("{$CFG->themedir}/essential/lib.php")) {
                require_once "{$CFG->themedir}/essential/lib.php";
            }
        }
        // else will just fail when cannot find theme_essential_process_css!
        $css = theme_essential_process_css($css, $theme);
    }
    // If you have your own additional settings, then add them here.
    $css = essentials_set_frontpagetitlestyle($css, \theme_essential\toolbox::get_setting('frontpagetitlestyle', false, $theme));
    // Finally return processed CSS
    return $css;
}
Пример #2
0
/**
 * Essentials is a basic child theme of Essential to help you as a theme
 * developer create your own child theme of Essential.
 *
 * @package     theme_essentials
 * @copyright   2015 Gareth J Barnard
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
function theme_essentials_process_css($css, $theme)
{
    /* Change to 'true' if you want to use Essential's settings after removing the '$THEME->parents_exclude_sheets' in config.php.
       Then to get the alternive colours back, renove the overridden method 'custom_menu_themecolours' in the 'theme_essentials_core_renderer'
       class in the 'core_renderer.php' file in the 'classes' folder. */
    $usingessentialsettings = false;
    if ($usingessentialsettings) {
        if (file_exists("{$CFG->dirroot}/theme/essential/lib.php")) {
            require_once "{$CFG->dirroot}/theme/essential/lib.php";
        } else {
            if (!empty($CFG->themedir) and file_exists("{$CFG->themedir}/essential/lib.php")) {
                require_once "{$CFG->themedir}/essential/lib.php";
            }
        }
        // else will just fail when cannot find theme_essential_process_css!
        static $parenttheme;
        if (empty($parenttheme)) {
            $parenttheme = theme_config::load('essential');
        }
        $css = theme_essential_process_css($css, $parenttheme);
    }
    // If you have your own settings, then add them here.
    // Finally return processed CSS
    return $css;
}
Пример #3
0
/**
 * Essentials is a basic child theme of Essential to help you as a theme
 * developer create your own child theme of Essential.
 *
 * @package     theme_essentials
 * @copyright   2015 Gareth J Barnard
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
function theme_essentials_process_css($css, $theme)
{
    // Change to 'true' if you want to use Essential's settings after removing the '$THEME->parents_exclude_sheets' in config.php.
    $usingessentialsettings = false;
    if ($usingessentialsettings) {
        require_once dirname(__FILE__) . '/../essential/lib.php';
        $css = theme_essential_process_css($css, $theme);
    }
    // If you have your own settings, then add them here.
    // Finally return processed CSS
    return $css;
}