--- color.base.module 2007-10-03 16:10:39.934568300 +0200 +++ color.module 2007-10-03 16:13:30.807381100 +0200 @@ -46,7 +46,7 @@ function color_form_alter(&$form, $form_ * Callback for the theme to alter the resources used. */ function _color_page_alter(&$vars) { - global $theme_key; + global $language, $theme_key; // Override stylesheets $files = variable_get('color_'. $theme_key .'_stylesheets', array()); @@ -60,6 +60,12 @@ function _color_page_alter(&$vars) { if ($theme_base == $color_base) { // Add rewritten stylesheet for color overwrite $vars['css']['all']['theme'][$color_file] = TRUE; + if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { + $rtl_color_file = str_replace('.css', '-rtl.css', $color_file); + if (file_exists($rtl_color_file)) { + $vars['css']['all']['theme'][$rtl_color_file] = TRUE; + } + } } } } @@ -284,6 +290,15 @@ function color_scheme_form_submit($form, $base = basename($file); $css[] = $paths['target'] . $base; _color_save_stylesheet($paths['target'] . $base, $style, $paths); + + $rtl_file = str_replace('.css', '-rtl.css', $file); + if (file_exists($paths['source'] . $rtl_file)) { + $style = _color_rewrite_load_stylesheet($paths['source'] . $rtl_file); + $style = _color_rewrite_stylesheet($theme, $info, $paths, $palette, $style); + $base = basename($rtl_file); + $css[] = $paths['target'] . $base; + _color_save_stylesheet($paths['target'] . $base, $style, $paths); + } } }