/**
 * Parses CSS before it is cached.
 *
 * This function can make alterations and replace patterns within the CSS.
 *
 * @param string $css The CSS
 * @param theme_config $theme The theme config object.
 * @return string The parsed CSS The parsed CSS.
 */
function theme_eduhub_process_css($css, $theme)
{
    global $OUTPUT;
    // Set the background image for the logo.
    $logo = $theme->setting_file_url('logo', 'logo');
    $css = theme_eduhub_set_logo($css, $logo);
    // Set the background image for the headerimg.
    $headerimg = $theme->setting_file_url('headerimg', 'headerimg');
    if (!isset($headerimg)) {
        $headerimg = $OUTPUT->pix_url('headerimg', 'theme');
    }
    $css = theme_eduhub_set_headerimg($css, $headerimg);
    // Set the background image for the footerimg.
    $footerimg = $theme->setting_file_url('footerimg', 'footerimg');
    if (!isset($footerimg)) {
        $footerimg = $OUTPUT->pix_url('footerimg', 'theme');
    }
    $css = theme_eduhub_set_footerimg($css, $footerimg);
    // Set the Site color.
    if (empty($theme->settings->sitecolor)) {
        $sitecolor = '#3e65a0';
        // Default.
    } else {
        $sitecolor = $theme->settings->sitecolor;
    }
    $css = eduhub_set_sitecolor($css, $sitecolor);
    // Set custom CSS.
    if (!empty($theme->settings->customcss)) {
        $customcss = $theme->settings->customcss;
    } else {
        $customcss = null;
    }
    $css = theme_eduhub_set_customcss($css, $customcss);
    return $css;
}
Beispiel #2
0
/**
 * Parses CSS before it is cached.
 *
 * This function can make alterations and replace patterns within the CSS.
 *
 * @param string $css The CSS
 * @param theme_config $theme The theme config object.
 * @return string The parsed CSS The parsed CSS.
 */
function theme_roshnilite_process_css($css, $theme) {

    // Set the background image for the logo.
    $logo = $theme->setting_file_url('logo', 'logo');
    $css = theme_roshnilite_set_logo($css, $logo);
    if (!empty($theme->settings->fontnamebody)) {
        $font = $theme->settings->fontnamebody;
    } else {
        $font = 'Raleway';
    }
    $headingfont = theme_roshnilite_get_setting('fontnameheading');
    $bodyfont = theme_roshnilite_get_setting('fontnamebody');

    $css = theme_roshnilite_set_headingfont($css, $headingfont);
    $css = theme_roshnilite_set_bodyfont($css, $bodyfont);
    $css = theme_roshnilite_set_fontfiles($css, 'heading', $headingfont);
    $css = theme_roshnilite_set_fontfiles($css, 'body', $bodyfont);
    // Set custom CSS.
    if (!empty($theme->settings->customcss)) {
        $customcss = $theme->settings->customcss;
    } else {
        $customcss = null;
    }
    $css = theme_roshnilite_set_customcss($css, $customcss);
    $thememaincolor = theme_roshnilite_get_setting('maincolor');
    $css = theme_roshnilite_set_maincolor($css, $thememaincolor);
    return $css;
}
Beispiel #3
0
/**
 * Extra LESS code to inject.
 *
 * This will generate some LESS code from the settings used by the user. We cannot use
 * the {@link theme_more_less_variables()} here because we need to create selectors or
 * alter existing ones.
 *
 * @param theme_config $theme The theme config object.
 * @return string Raw LESS code.
 */
function theme_more_extra_less($theme)
{
    $content = '';
    $imageurl = $theme->setting_file_url('backgroundimage', 'backgroundimage');
    // Sets the background image, and its settings.
    if (!empty($imageurl)) {
        $content .= 'body { ';
        $content .= "background-image: url('{$imageurl}');";
        if (!empty($theme->settings->backgroundfixed)) {
            $content .= 'background-attachment: fixed;';
        }
        if (!empty($theme->settings->backgroundposition)) {
            $content .= 'background-position: ' . str_replace('_', ' ', $theme->settings->backgroundposition) . ';';
        }
        if (!empty($theme->settings->backgroundrepeat)) {
            $content .= 'background-repeat: ' . $theme->settings->backgroundrepeat . ';';
        }
        $content .= ' }';
    }
    // If there the user wants a background for the content, we need to make it look consistent,
    // therefore we need to round its borders, and adapt the border colour.
    if (!empty($theme->settings->contentbackground)) {
        $content .= '
            #region-main {
                .well;
                background-color: ' . $theme->settings->contentbackground . ';
                border-color: darken(' . $theme->settings->contentbackground . ', 7%);
            }';
    }
    return $content;
}
Beispiel #4
0
/**
 * Parses CSS before it is cached.
 *
 * This function can make alterations and replace patterns within the CSS.
 *
 * @param string $css The CSS
 * @param theme_config $theme The theme config object.
 * @return string The parsed CSS The parsed CSS.
 */
function theme_htwchur_process_css($css, $theme)
{
    // Set the background image for the logo.
    $logo = $theme->setting_file_url('logo', 'logo');
    $css = theme_htwchur_set_logo($css, $logo);
    // Set custom CSS.
    if (!empty($theme->settings->customcss)) {
        $customcss = $theme->settings->customcss;
    } else {
        $customcss = null;
    }
    $css = theme_htwchur_set_customcss($css, $customcss);
    return $css;
}
Beispiel #5
0
/**
 * CSS Processor
 *
 * @param string $css
 * @param theme_config $theme
 * @return string
 */
function theme_snap_process_css($css, theme_config $theme)
{
    // Set the background image for the logo.
    $logo = $theme->setting_file_url('logo', 'logo');
    $css = theme_snap_set_logo($css, $logo);
    // Set the custom css.
    if (!empty($theme->settings->customcss)) {
        $customcss = $theme->settings->customcss;
    } else {
        $customcss = null;
    }
    $css = theme_snap_set_customcss($css, $customcss);
    // Set bootswatch.
    $css = theme_snap_set_bootswatch($css, theme_snap_get_bootswatch_variables($theme));
    return $css;
}
/**
 * Parses CSS before it is cached.
 *
 * This function can make alterations and replace patterns within the CSS.
 *
 * @param string $css The CSS
 * @param theme_config $theme The theme config object.
 * @return string The parsed CSS The parsed CSS.
 */
function theme_learnmoodle_process_css($css, $theme)
{
    global $CFG;
    // Set the background image for the logo.
    $logo = $theme->setting_file_url('logo', 'logo');
    $css = theme_learnmoodle_set_logo($css, $logo);
    // Set custom CSS.
    if (!empty($theme->settings->customcss)) {
        $customcss = $theme->settings->customcss;
    } else {
        $customcss = null;
    }
    $css = theme_learnmoodle_set_customcss($css, $customcss);
    // Hack to avoid the use of relative URLs for fonts in CSS files.
    $css = str_replace('[[fontsfolder]]', $CFG->httpswwwroot . '/theme/learnmoodle/fonts', $css);
    return $css;
}
Beispiel #7
0
/**
 * Returns variables for LESS.
 *
 * We will inject some LESS variables from the settings that the user has defined
 * for the theme. No need to write some custom LESS for this.
 *
 * @param theme_config $theme The theme config object.
 * @return array of LESS variables without the @.
 */
function theme_elegance_less_variables($theme)
{
    $variables = array();
    $settings = $theme->settings;
    $images = array('headerbg', 'bodybg', 'logo');
    foreach ($images as $image) {
        if (!empty($settings->{$image})) {
            $imagefile = $theme->setting_file_url($image, $image);
            $variables[$image] = "'" . $imagefile . "'";
        }
    }
    $textvars = array('themecolor', 'fontcolor', 'headingcolor', 'videowidth', 'transparency');
    foreach ($textvars as $textvar) {
        if (!empty($settings->{$textvar})) {
            $variables[$textvar] = $settings->{$textvar};
        }
    }
    if (!empty($settings->maxwidth)) {
        $variables['maxwidth'] = $settings->maxwidth . 'px';
    }
    if (!empty($settings->fixednavbar)) {
        $variables['navbarpadding'] = '50px';
    }
    foreach (range(1, 12) as $i) {
        $textvar = "quicklinkiconcolor" . $i;
        if (!empty($settings->{$textvar})) {
            $variables[$textvar] = $settings->{$textvar};
        }
        $textvar = "quicklinkbuttoncolor" . $i;
        if (!empty($settings->{$textvar})) {
            $variables[$textvar] = $settings->{$textvar};
        }
    }
    return $variables;
}
Beispiel #8
0
/**
 * Returns variables for LESS.
 *
 * We will inject some LESS variables from the settings that the user has defined
 * for the theme. No need to write some custom LESS for this.
 *
 * @param theme_config $theme The theme config object.
 * @return array of LESS variables without the @.
 */
function theme_elegance_less_variables($theme)
{
    $variables = array();
    $settings = $theme->settings;
    $images = array('headerbg', 'bodybg', 'logo');
    foreach ($images as $image) {
        if (!empty($settings->{$image})) {
            $imagefile = $theme->setting_file_url($image, $image);
            $variables[$image] = "'" . $imagefile . "'";
        }
    }
    $textvars = array('themecolor', 'fontcolor', 'headingcolor', 'videowidth', 'transparency', 'bodycolor');
    foreach ($textvars as $textvar) {
        if (!empty($settings->{$textvar})) {
            $variables[$textvar] = $settings->{$textvar};
        }
    }
    if (!empty($settings->maxwidth)) {
        $variables['maxwidth'] = $settings->maxwidth . 'px';
    }
    if (!empty($settings->fixednavbar)) {
        $variables['navbarpadding'] = '50px';
    }
    if (!empty($settings->loginbgnumber)) {
        if ($settings->loginbgnumber > 0) {
            $variables['loginbgcolor'] = 'transparent';
            $variables['loginbg'] = 'none';
        }
    }
    if (!empty($settings->bodybgconfig)) {
        switch ($settings->bodybgconfig) {
            case 1:
                $variables['bodybgrepeat'] = 'repeat';
                $variables['bodybgposition'] = 'initial';
                $variables['bodybgsize'] = 'initial';
                $variables['bodybgattach'] = 'initial';
                break;
            case 2:
                $variables['bodybgrepeat'] = 'no-repeat';
                $variables['bodybgposition'] = 'fixed center center';
                $variables['bodybgsize'] = 'cover';
                $variables['bodybgattach'] = 'fixed';
                break;
            case 3:
                $variables['bodybgrepeat'] = 'no-repeat';
                $variables['bodybgposition'] = 'fixed center center';
                $variables['bodybgsize'] = 'cover';
                $variables['bodybgattach'] = 'scroll';
                break;
        }
    }
    foreach (range(1, 12) as $i) {
        $textvar = "quicklinkiconcolor" . $i;
        if (!empty($settings->{$textvar})) {
            $variables[$textvar] = $settings->{$textvar};
        }
        $textvar = "quicklinkbuttoncolor" . $i;
        if (!empty($settings->{$textvar})) {
            $variables[$textvar] = $settings->{$textvar};
        }
    }
    return $variables;
}
/**
 * Parses CSS before it is cached.
 *
 * This function can make alterations and replace patterns within the CSS.
 *
 * @param string $css The CSS
 * @param theme_config $theme The theme config object.
 * @return string The parsed CSS The parsed CSS.
 */
function theme_evolved_process_css($css, $theme)
{
    // Set the background image for the logo.
    $logo = $theme->setting_file_url('logo', 'logo');
    $css = theme_evolved_set_logo($css, $logo);
    // Set the background image for the frontpage.
    $fpbkg = $theme->setting_file_url('fpbkg', 'fpbkg');
    $css = theme_evolved_set_fpbkg($css, $fpbkg);
    // Set custom CSS.
    if (!empty($theme->settings->customcss)) {
        $customcss = $theme->settings->customcss;
    } else {
        $customcss = null;
    }
    $css = theme_evolved_set_customcss($css, $customcss);
    // Set the Fonts.
    if ($theme->settings->fontselect == 1) {
        $headingfont = 'Oswald';
        $bodyfont = 'PT Sans';
        $bodysize = '13px';
        $bodyweight = '400';
    } else {
        if ($theme->settings->fontselect == 2) {
            $headingfont = 'Lobster';
            $bodyfont = 'Cabin';
            $bodysize = '13px';
            $bodyweight = '400';
        } else {
            if ($theme->settings->fontselect == 3) {
                $headingfont = 'Raelway';
                $bodyfont = 'Goudy Bookletter 1911';
                $bodysize = '13px';
                $bodyweight = '400';
            } else {
                if ($theme->settings->fontselect == 4) {
                    $headingfont = 'Allerta';
                    $bodyfont = 'Crimson Text';
                    $bodysize = '14px';
                    $bodyweight = '400';
                } else {
                    if ($theme->settings->fontselect == 5) {
                        $headingfont = 'Arvo';
                        $bodyfont = 'PT Sans';
                        $bodysize = '14px';
                        $bodyweight = '400';
                    } else {
                        if ($theme->settings->fontselect == 6) {
                            $headingfont = 'Dancing Script';
                            $bodyfont = 'Josefin Sans';
                            $bodysize = '13px';
                            $bodyweight = '400';
                        } else {
                            if ($theme->settings->fontselect == 7) {
                                $headingfont = 'Allan';
                                $bodyfont = 'Cardo';
                                $bodysize = '14px';
                                $bodyweight = '400';
                            } else {
                                if ($theme->settings->fontselect == 8) {
                                    $headingfont = 'Molengo';
                                    $bodyfont = 'Lekton';
                                    $bodysize = '13px';
                                    $bodyweight = '400';
                                } else {
                                    if ($theme->settings->fontselect == 9) {
                                        $headingfont = 'Droid Serif';
                                        $bodyfont = 'Droid Sans';
                                        $bodysize = '13px';
                                        $bodyweight = '400';
                                    } else {
                                        if ($theme->settings->fontselect == 10) {
                                            $headingfont = 'Corben';
                                            $bodyfont = 'Nobile';
                                            $bodysize = '12px';
                                            $bodyweight = '400';
                                        } else {
                                            if ($theme->settings->fontselect == 11) {
                                                $headingfont = 'Ubuntu';
                                                $bodyfont = 'Vollkorn';
                                                $bodysize = '14px';
                                                $bodyweight = '400';
                                            } else {
                                                if ($theme->settings->fontselect == 12) {
                                                    $headingfont = 'Bree Serif';
                                                    $bodyfont = 'Open Sans';
                                                    $bodysize = '13px';
                                                    $bodyweight = '400';
                                                } else {
                                                    if ($theme->settings->fontselect == 13) {
                                                        $headingfont = 'Bevan';
                                                        $bodyfont = 'Pontano Sans';
                                                        $bodysize = '13px';
                                                        $bodyweight = '400';
                                                    } else {
                                                        if ($theme->settings->fontselect == 14) {
                                                            $headingfont = 'Abril Fatface';
                                                            $bodyfont = 'Average';
                                                            $bodysize = '13px';
                                                            $bodyweight = '400';
                                                        } else {
                                                            if ($theme->settings->fontselect == 15) {
                                                                $headingfont = 'Playfair Display';
                                                                $bodyfont = 'Multi';
                                                                $bodysize = '13px';
                                                                $bodyweight = '400';
                                                            } else {
                                                                if ($theme->settings->fontselect == 16) {
                                                                    $headingfont = 'Sansita one';
                                                                    $bodyfont = 'Kameron';
                                                                    $bodysize = '13px';
                                                                    $bodyweight = '400';
                                                                } else {
                                                                    if ($theme->settings->fontselect == 17) {
                                                                        $headingfont = 'Istok Web';
                                                                        $bodyfont = 'Lora';
                                                                        $bodysize = '13px';
                                                                        $bodyweight = '400';
                                                                    } else {
                                                                        if ($theme->settings->fontselect == 18) {
                                                                            $headingfont = 'Pacifico';
                                                                            $bodyfont = 'Arimo';
                                                                            $bodysize = '13px';
                                                                            $bodyweight = '400';
                                                                        } else {
                                                                            if ($theme->settings->fontselect == 19) {
                                                                                $headingfont = 'Nixie One';
                                                                                $bodyfont = 'Ledger';
                                                                                $bodysize = '13px';
                                                                                $bodyweight = '400';
                                                                            } else {
                                                                                if ($theme->settings->fontselect == 20) {
                                                                                    $headingfont = 'Cantata One';
                                                                                    $bodyfont = 'Imprima';
                                                                                    $bodysize = '13px';
                                                                                    $bodyweight = '400';
                                                                                } else {
                                                                                    if ($theme->settings->fontselect == 21) {
                                                                                        $headingfont = 'Rancho';
                                                                                        $bodyfont = 'Gudea';
                                                                                        $bodysize = '13px';
                                                                                        $bodyweight = '400';
                                                                                    } else {
                                                                                        if ($theme->settings->fontselect == 22) {
                                                                                            $headingfont = 'Helvetica';
                                                                                            $bodyfont = 'Georgia';
                                                                                            $bodysize = '17px';
                                                                                            $bodyweight = '400';
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    $css = theme_evolved_set_headingfont($css, $headingfont);
    $css = theme_evolved_set_bodyfont($css, $bodyfont);
    $css = theme_evolved_set_bodysize($css, $bodysize);
    $css = theme_evolved_set_bodyweight($css, $bodyweight);
    // Set marketbox CSS.
    if (!empty($theme->settings->marketboxcolor)) {
        $marketboxcolor = $theme->settings->marketboxcolor;
    } else {
        $marketboxcolor = '';
    }
    $css = theme_evolved_set_marketboxcolor($css, $marketboxcolor);
    return $css;
}
Beispiel #10
0
/**
 * Parses CSS before it is cached.
 *
 * This function can make alterations and replace patterns within the CSS.
 *
 * @param string $css The CSS
 * @param theme_config $theme The theme config object.
 * @return string The parsed CSS The parsed CSS.
 */
function theme_adaptable_process_css($css, $theme) {

    // Set custom CSS.
    if (!empty($theme->settings->customcss)) {
        $customcss = $theme->settings->customcss;
    } else {
        $customcss = null;
    }
    $css = theme_adaptable_set_customcss($css, $customcss);

    // Define the default settings for the theme incase they've not been set.
    $defaults = array(
        '[[setting:fsize]]' => '90',
        '[[setting:linkcolor]]' => '#009688',
        '[[setting:linkhover]]' => '#009688',
        '[[setting:maincolor]]' => '#009688',
        '[[setting:backcolor]]' => '#FFFFFF',
        '[[setting:regionmaincolor]]' => '#FFFFFF',
        '[[setting:rendereroverlaycolor]]' => '#009688',
        '[[setting:rendereroverlayfontcolor]]' => '#FFFFFF',
        '[[setting:buttoncolor]]' => '#009688',
        '[[setting:buttontextcolor]]' => '#ffffff',
        '[[setting:buttonhovercolor]]' => '#00695c',
        '[[setting:buttonlogincolor]]' => '#ef5350',
        '[[setting:buttonloginhovercolor]]' => '#e53935',
        '[[setting:buttonlogintextcolor]]' => '#0084c2',
        '[[setting:buttonloginpadding]]' => '0px',
        '[[setting:buttonloginheight]]' => '24px',
        '[[setting:buttonloginmargintop]]' => '2px',
        '[[setting:buttonradius]]' => '5px',
        '[[setting:dividingline]]' => '#ffffff',
        '[[setting:dividingline2]]' => '#ffffff',
        '[[setting:navbarborder]]' => '#B7B3EF',
        '[[setting:navbarhover]]' => '#3C469C',
        '[[setting:breadcrumb]]' => '#b4bbbf',
        '[[setting:breadcrumbtextcolor]]' => '#444444',
        '[[setting:activebreadcrumb]]' => '#e8eaeb',
        '[[setting:loadingcolor]]' => '#f44336',
        '[[setting:footerbkcolor]]' => '#424242',
        '[[setting:footertextcolor]]' => '#ffffff',
        '[[setting:footertextcolor2]]' => '#ffffff',
        '[[setting:footerlinkcolor]]' => '#ffffff',
        '[[setting:headerbkcolor]]' => '#00796B',
        '[[setting:headerbkcolor2]]' => '#009688',
        '[[setting:headertextcolor]]' => '#ffffff',
        '[[setting:headertextcolor2]]' => '#ffffff',
        '[[setting:blockheadercolor]]' => '#009688',
        '[[setting:blockbackgroundcolor]]' => '#FFFFFF',
        '[[setting:blockheaderbackgroundcolor]]' => '#FFFFFF',
        '[[setting:blockbordercolor]]' => '#59585D',
        '[[setting:marketblockbordercolor]]' => '#e8eaeb',
        '[[setting:marketblocksbackgroundcolor]]' => 'transparent',
        '[[setting:blocklinkcolor]]' => '#009688',
        '[[setting:blockheaderbordertop]]' => '1px',
        '[[setting:blockheaderborderleft]]' => '0px',
        '[[setting:blockheaderborderright]]' => '0px',
        '[[setting:blockheaderborderbottom]]' => '0px',
        '[[setting:blockmainbordertop]]' => '0px',
        '[[setting:blockmainborderleft]]' => '0px',
        '[[setting:blockmainborderright]]' => '0px',
        '[[setting:blockmainborderbottom]]' => '0px',
        '[[setting:blockheaderbordertopstyle]]' => 'dashed',
        '[[setting:blockmainbordertopstyle]]' => 'solid',
        '[[setting:blockheadertopradius]]' => '0px',
        '[[setting:blockheaderbottomradius]]' => '0px',
        '[[setting:blockmaintopradius]]' => '0px',
        '[[setting:blockmainbottomradius]]' => '0px',
        '[[setting:tilesbordercolor]]' => '#009688',
        '[[setting:infoboxcolor]]' => '#333333',
        '[[setting:infoboxcolor2]]' => '#f3f3f3',
        '[[setting:slidermargintop]]' => '20px',
        '[[setting:slidermarginbottom]]' => '20px',
        '[[setting:currentcolor]]' => '#d9edf7',
        '[[setting:sectionheadingcolor]]' => '#5f588a',
        '[[setting:infoboxtextcolor]]' => '#ffffff',
        '[[setting:infoboxtextcolor2]]' => '#666666',
        '[[setting:menufontsize]]' => '14px',
        '[[setting:topmenufontsize]]' => '14px',
        '[[setting:menubkcolor]]' => '#ffffff',
        '[[setting:menufontcolor]]' => '#444444',
        '[[setting:menubordercolor]]' => '#80cbc4',
        '[[setting:mobilemenubkcolor]]' => '#F9F9F9',
        '[[setting:mobilemenufontcolor]]' => '#000000',
        '[[setting:covbkcolor]]' => '#009688',
        '[[setting:covfontcolor]]' => '#ffffff',
        '[[setting:editonbk]]' => '#4caf50',
        '[[setting:editoffbk]]' => '#f44336',
        '[[setting:editverticalpadding]]' => '',
        '[[setting:edithorizontalpadding]]' => '',
        '[[setting:edittopmargin]]' => '',
        '[[setting:editfont]]' => '#ffffff',
        '[[setting:slideroption2color]]' => '#0066cc',
        '[[setting:slideroption2a]]' => '#0066cc',
        '[[setting:socialsize]]' => '32',
        '[[setting:socialsizemobile]]' => '22',
        '[[setting:mobile]]' => '22',
        '[[setting:socialpaddingtop]]' => '1.8%',
        '[[setting:fontname]]' => 'Open Sans',
        '[[setting:fontheadername]]' => 'Roboto Slab',
        '[[setting:fontcolor]]' => '#333333',
        '[[setting:fontheadercolor]]' => '#333333',
        '[[setting:fontweight]]' => '400',
        '[[setting:fontheaderweight]]' => '400',
        '[[setting:fonttitlename]]' => 'Audiowide',
        '[[setting:fonttitleweight]]' => '400',
        '[[setting:fonttitlesize]]' => '48px',
        '[[setting:fonttitlecolor]]' => '#FFFFFF',
        '[[setting:fullscreenwidth]]' => '98%',
        '[[setting:coursetitlemaxwidth]]' => '50%',
        '[[setting:coursetitlepaddingtop]]' => '0px',
        '[[setting:hidebreadcrumbmobile]]' => '',
        '[[setting:hidepagefootermobile]]' => '',
        '[[setting:hidealertsmobile]]' => '',
        '[[setting:hidesocialmobile]]' => '',
        '[[setting:socialboxpaddingtopmobile]]' => '',
        '[[setting:socialboxpaddingbottommobile]]' => '',
        '[[setting:hidecoursetitlemobile]]' => '',
        '[[setting:hidelogomobile]]' => '',
        '[[setting:hideheadermobile]]' => '',
        '[[setting:enableheading]]' => 'fullname',
        '[[setting:breadcrumbtitle]]' => 'shortname',
        '[[setting:enableavailablecourses]]' => 'display',
        '[[setting:enableticker]]' => true,
        '[[setting:enabletickermy]]' => true,
        '[[setting:tickerwidth]]' => '',
    );

    // Get all the defined settings for the theme and replace defaults.
    foreach ($theme->settings as $key => $val) {
        if (array_key_exists('[[setting:'.$key.']]', $defaults) && !empty($val)) {
            $defaults['[[setting:'.$key.']]'] = $val;
        }
    }

    $homebkg = '';
    if (!empty($theme->settings->homebk)) {
        $homebkg = $theme->setting_file_url('homebk', 'homebk');
        $homebkg = 'background-image: url("' . $homebkg . '");';
    }
    $defaults['[[setting:homebkg]]'] = $homebkg;

    // Replace the CSS with values from the $defaults array.
    $css = strtr($css, $defaults);
    if (empty($theme->settings->tilesshowallcontacts) || $theme->settings->tilesshowallcontacts == false) {
        $css = theme_adaptable_set_tilesshowallcontacts($css, false);
    } else {
        $css = theme_adaptable_set_tilesshowallcontacts($css, true);
    }
    return $css;
}
Beispiel #11
0
/**
 * Parses CSS before it is cached.
 *
 * This function can make alterations and replace patterns within the CSS.
 *
 * @param string $css The CSS
 * @param theme_config $theme The theme config object.
 * @return string The parsed CSS The parsed CSS.
 */
function theme_pioneer_process_css($css, $theme)
{
    // Set the background image for the logo.
    $logo = $theme->setting_file_url('logo', 'logo');
    $css = theme_pioneer_set_logo($css, $logo, $theme);
    $headerbackgroundimage = $theme->setting_file_url('headerbackgroundimage', 'headerbackgroundimage');
    $css = theme_pioneer_set_headerbackgroundimage($css, $headerbackgroundimage, $theme);
    $css = theme_pioneer_set_gheadingimporturl($css, $gheadingimporturl);
    $css = theme_pioneer_set_gbodyimporturl($css, $gbodyimporturl);
    // Set header font.
    if (!empty($theme->settings->headingfont)) {
        $headingfont = $theme->settings->headingfont;
    } else {
        $headingfont = '';
    }
    $css = theme_pioneer_set_headingfont($css, $headingfont);
    //Set activitybackground
    if (!empty($theme->settings->activitybackground)) {
        $activitybackground = $theme->settings->activitybackground;
    } else {
        $activitybackground = '';
    }
    $css = theme_pioneer_set_activitybackground($css, $activitybackground);
    //Set body font
    if (!empty($theme->settings->bodyfont)) {
        $bodyfont = $theme->settings->bodyfont;
    } else {
        $bodyfont = '';
    }
    $css = theme_pioneer_set_bodyfont($css, $bodyfont);
    //Set body font
    if (!empty($theme->settings->bodysize)) {
        $bodysize = $theme->settings->bodysize;
    } else {
        $bodysize = '';
    }
    $css = theme_pioneer_set_bodysize($css, $bodysize);
    $css = theme_pioneer_set_bodyweight($css, $bodyweight);
    // Set custom CSS.
    if (!empty($theme->settings->customcss)) {
        $customcss = $theme->settings->customcss;
    } else {
        $customcss = null;
    }
    $css = theme_pioneer_set_customcss($css, $customcss);
    // Set header image padding.
    if (!empty($theme->settings->fpheaderimagepadding)) {
        $fpheaderimagepadding = $theme->settings->fpheaderimagepadding;
    } else {
        $fpheaderimagepadding = null;
    }
    $css = theme_pioneer_set_fpheaderimagepadding($css, $fpheaderimagepadding);
    // Set header image padding.
    if (!empty($theme->settings->headerimagepadding)) {
        $headerimagepadding = $theme->settings->headerimagepadding;
    } else {
        $headerimagepadding = null;
    }
    $css = theme_pioneer_set_headerimagepadding($css, $headerimagepadding);
    // Set header image padding.
    if (!empty($theme->settings->headerincourseimagepadding)) {
        $headerincourseimagepadding = $theme->settings->headerincourseimagepadding;
    } else {
        $headerincourseimagepadding = null;
    }
    $css = theme_pioneer_set_headerincourseimagepadding($css, $headerincourseimagepadding);
    // Set slider image padding.
    if (!empty($theme->settings->toppromotedpadding)) {
        $toppromotedpadding = $theme->settings->toppromotedpadding;
    } else {
        $toppromotedpadding = null;
    }
    $css = theme_pioneer_set_toppromotedpadding($css, $toppromotedpadding);
    // Set topic week background CSS.
    if (!empty($theme->settings->topicweekcolor)) {
        $topicweekcolor = $theme->settings->topicweekcolor;
    } else {
        $topicweekcolor = '';
    }
    $css = theme_pioneer_set_topicweekcolor($css, $topicweekcolor);
    if (!empty($theme->settings->blocktitlecolor)) {
        $blocktitlecolor = $theme->settings->blocktitlecolor;
    } else {
        $blocktitlecolor = '';
    }
    $css = theme_pioneer_set_blocktitlecolor($css, $blocktitlecolor);
    if (!empty($theme->settings->blockbordercolor)) {
        $blockbordercolor = $theme->settings->blockbordercolor;
    } else {
        $blockbordercolor = '';
    }
    $css = theme_pioneer_set_blockbordercolor($css, $blockbordercolor);
    if (!empty($theme->settings->loginbuttoncolor)) {
        $loginbuttoncolor = $theme->settings->loginbuttoncolor;
    } else {
        $loginbuttoncolor = '';
    }
    $css = theme_pioneer_set_loginbuttoncolor($css, $loginbuttoncolor);
    if (!empty($theme->settings->recommendedbkg)) {
        $recommendedbkg = $theme->settings->recommendedbkg;
    } else {
        $recommendedbkg = '';
    }
    $css = theme_pioneer_set_recommendedbkg($css, $recommendedbkg);
    if (!empty($theme->settings->coursetitlebkg)) {
        $coursetitlebkg = $theme->settings->coursetitlebkg;
    } else {
        $coursetitlebkg = '';
    }
    $css = theme_pioneer_set_coursetitlebkg($css, $coursetitlebkg);
    if (!empty($theme->settings->coursetitletxt)) {
        $coursetitletxt = $theme->settings->coursetitletxt;
    } else {
        $coursetitletxt = '';
    }
    $css = theme_pioneer_set_coursetitletxt($css, $coursetitletxt);
    if (!empty($theme->settings->tabbuttoncolor)) {
        $tabbuttoncolor = $theme->settings->tabbuttoncolor;
    } else {
        $tabbuttoncolor = '';
    }
    $css = theme_pioneer_set_tabbuttoncolor($css, $tabbuttoncolor);
    if (!empty($theme->settings->radialboxbackground)) {
        $radialboxbackground = $theme->settings->radialboxbackground;
    } else {
        $radialboxbackground = '';
    }
    $css = theme_pioneer_set_radialboxbackground($css, $radialboxbackground);
    if (!empty($theme->settings->radialcolor)) {
        $radialcolor = $theme->settings->radialcolor;
    } else {
        $radialcolor = '';
    }
    $css = theme_pioneer_set_radialcolor($css, $radialcolor);
    if (!empty($theme->settings->tabbuttonhovercolor)) {
        $tabbuttonhovercolor = $theme->settings->tabbuttonhovercolor;
    } else {
        $tabbuttonhovercolor = '';
    }
    $css = theme_pioneer_set_tabbuttonhovercolor($css, $tabbuttonhovercolor);
    if (!empty($theme->settings->blockcolor)) {
        $blockcolor = $theme->settings->blockcolor;
    } else {
        $blockbcolor = '';
    }
    $css = theme_pioneer_set_blockcolor($css, $blockcolor);
    if (!empty($theme->settings->blockheadercolor)) {
        $blockheadercolor = $theme->settings->blockheadercolor;
    } else {
        $blockheadercolor = '';
    }
    $css = theme_pioneer_set_blockheadercolor($css, $blockheadercolor);
    if (!empty($theme->settings->contentbackgroundcolor)) {
        $contentbackgroundcolor = $theme->settings->contentbackgroundcolor;
    } else {
        $contentbackgroundcolor = '';
    }
    $css = theme_pioneer_set_contentbackgroundcolor($css, $contentbackgroundcolor);
    if (!empty($theme->settings->iconnavbackgroundcolor)) {
        $iconnavbackgroundcolor = $theme->settings->iconnavbackgroundcolor;
    } else {
        $iconnavbackgroundcolor = '';
    }
    $css = theme_pioneer_set_iconnavbackgroundcolor($css, $iconnavbackgroundcolor);
    if (!empty($theme->settings->iconnavbackgroundcolortop)) {
        $iconnavbackgroundcolortop = $theme->settings->iconnavbackgroundcolortop;
    } else {
        $iconnavbackgroundcolortop = '';
    }
    $css = theme_pioneer_set_iconnavbackgroundcolortop($css, $iconnavbackgroundcolortop);
    if (!empty($theme->settings->navbkgcolor)) {
        $navbkgcolor = $theme->settings->navbkgcolor;
    } else {
        $navbkgcolor = '';
    }
    $css = theme_pioneer_set_navbkgcolor($css, $navbkgcolor);
    // Set marketbox CSS.
    if (!empty($theme->settings->marketboxcolor)) {
        $marketboxcolor = $theme->settings->marketboxcolor;
    } else {
        $marketboxcolor = '';
    }
    $css = theme_pioneer_set_marketboxcolor($css, $marketboxcolor);
    if (!empty($theme->settings->marketboxcontentcolor)) {
        $marketboxcontentcolor = $theme->settings->marketboxcontentcolor;
    } else {
        $marketboxcontentcolor = '';
    }
    $css = theme_pioneer_set_marketboxcontentcolor($css, $marketboxcontentcolor);
    // Set Socialwall post background color CSS.
    if (!empty($theme->settings->swpost)) {
        $swpost = $theme->settings->swpost;
    } else {
        $swpost = '';
    }
    $css = theme_pioneer_set_swpost($css, $swpost);
    // Set Socialwall add post color CSS.
    if (!empty($theme->settings->swaddpost)) {
        $swaddpost = $theme->settings->swaddpost;
    } else {
        $swaddpost = '';
    }
    $css = theme_pioneer_set_swaddpost($css, $swaddpost);
    // Set Socialwall message color CSS.
    if (!empty($theme->settings->swmessage)) {
        $swmessage = $theme->settings->swmessage;
    } else {
        $swmessage = '';
    }
    $css = theme_pioneer_set_swmessage($css, $swmessage);
    // Set Socialwall attachment color CSS.
    if (!empty($theme->settings->swattach)) {
        $swattach = $theme->settings->swattach;
    } else {
        $swattach = '';
    }
    $css = theme_pioneer_set_swattach($css, $swattach);
    // Set Socialwall attachment color CSS.
    if (!empty($theme->settings->swcomment)) {
        $swcomment = $theme->settings->swcomment;
    } else {
        $swcomment = '';
    }
    $css = theme_pioneer_set_swcomment($css, $swcomment);
    // Set section/week icon
    if (!empty($theme->settings->sectionheadericon)) {
        $sectionheadericon = $theme->settings->sectionheadericon;
    } else {
        $sectionheadericon = null;
    }
    $css = theme_pioneer_set_sectionheadericon($css, $sectionheadericon);
    // breadcrumb color
    if (!empty($theme->settings->breadcrumbcolor)) {
        $breadcrumbcolor = $theme->settings->breadcrumbcolor;
    } else {
        $breadcrumbcolor = '';
    }
    $css = theme_pioneer_set_breadcrumbcolor($css, $breadcrumbcolor);
    // breadcrumb color
    if (!empty($theme->settings->breadcrumbtext)) {
        $breadcrumbtext = $theme->settings->breadcrumbtext;
    } else {
        $breadcrumbtext = '';
    }
    $css = theme_pioneer_set_breadcrumbtext($css, $breadcrumbtext);
    if (!empty($theme->settings->topichighlight)) {
        $topichighlight = $theme->settings->topichighlight;
    } else {
        $topichighlight = '';
    }
    $css = theme_pioneer_set_topichighlight($css, $topichighlight);
    // breadcrumb color hover
    if (!empty($theme->settings->breadcrumbcolorhover)) {
        $breadcrumbcolorhover = $theme->settings->breadcrumbcolorhover;
    } else {
        $breadcrumbcolorhover = '';
    }
    $css = theme_pioneer_set_breadcrumbcolorhover($css, $breadcrumbcolorhover);
    return $css;
}