/** * 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_bcu_process_css($css, $theme) { // Set custom CSS. if (!empty($theme->settings->customcss)) { $customcss = $theme->settings->customcss; } else { $customcss = null; } $css = theme_bcu_set_customcss($css, $customcss); // Define the default settings for the theme incase they've not been set. $defaults = array('[[setting:fsize]]' => '90', '[[setting:linkcolor]]' => '#001E3C', '[[setting:linkhover]]' => '#001E3C', '[[setting:maincolor]]' => '#001E3C', '[[setting:backcolor]]' => '#FFFFFF', '[[setting:rendereroverlaycolour]]' => '#001E3C', '[[setting:rendereroverlayfontcolour]]' => '#FFFFFF', '[[setting:buttoncolour]]' => '#00AEEF', '[[setting:buttonhovercolour]]' => '#0084C2', '[[setting:dividingline]]' => '#3C469C', '[[setting:navbarborder]]' => '#B7B3EF', '[[setting:navbarhover]]' => '#3C469C', '[[setting:breadcrumb]]' => '#b4bbbf', '[[setting:activebreadcrumb]]' => '#e8eaeb'); // 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; } } // Replace the CSS with values from the $defaults array. $css = strtr($css, $defaults); if (empty($theme->settings->tilesshowallcontacts) || $theme->settings->tilesshowallcontacts == false) { $css = theme_bcu_set_tilesshowallcontacts($css, false); } else { $css = theme_bcu_set_tilesshowallcontacts($css, true); } return $css; }
/** * Deprecated: Please call theme_bcu_set_customcss instead. * @deprecated since 2.5.1 */ function bcu_set_customcss($css, $customcss) { debugging('Please call theme_' . __FUNCTION__ . ' instead of ' . __FUNCTION__, DEBUG_DEVELOPER); return theme_bcu_set_customcss($css, $customcss); }