--- color.min.module 2007-10-02 17:31:44.898188800 +0200 +++ color.module 2007-10-03 11:46:01.390253500 +0200 @@ -46,12 +46,18 @@ 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 stylesheet $path = variable_get('color_'. $theme_key .'_stylesheet', NULL); if ($path) { $vars['css']['all']['theme'][$path] = TRUE; + if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { + $rtl_path = str_replace('.css', '-rtl.css', $path); + if (file_exists($rtl_path)) { + $vars['css']['all']['theme'][$rtl_path] = TRUE; + } + } $vars['styles'] = drupal_get_css($vars['css']); } @@ -271,6 +277,13 @@ function color_scheme_form_submit($form, $style = _color_rewrite_stylesheet($theme, $info, $paths, $palette, $style); _color_save_stylesheet($paths['target'] .'style.css', $style, $paths); + // Rewrite RTL stylesheet + if (file_exists($paths['source'] .'style-rtl.css')) { + $style = _color_rewrite_load_stylesheet($paths['source'] .'style-rtl.css'); + $style = _color_rewrite_stylesheet($theme, $info, $paths, $palette, $style); + _color_save_stylesheet($paths['target'] .'style-rtl.css', $style, $paths); + } + // Maintain list of files variable_set('color_'. $theme .'_files', $paths['files']); }