Index: lib/weblib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v
retrieving revision 1.911
diff -u -r1.911 weblib.php
--- lib/weblib.php	22 Jul 2007 17:34:41 -0000	1.911
+++ lib/weblib.php	23 Jul 2007 17:06:48 -0000
@@ -2790,7 +2790,7 @@
  * @param int $lifetime ?
  * @param string $thename ?
  */
-function style_sheet_setup($lastmodified=0, $lifetime=300, $themename='', $forceconfig='', $lang='') {
+function style_sheet_setup($lastmodified=0, $lifetime=300, $themename='', $forceconfig='', $lang='', $langdir='') {
 
     global $CFG, $THEME;
 
@@ -2898,13 +2898,15 @@
         }
     }
 
-
+    $oppositlangdir = ($langdir == 'rtl') ? '_ltr' : '_rtl';
+    
     if ($files) {
     /// Produce a list of all the files first
         echo '/**************************************'."\n";
         echo ' * THEME NAME: '.$themename."\n *\n";
         echo ' * Files included in this sheet:'."\n *\n";
         foreach ($files as $file) {
+            if (strstr($file[1], $oppositlangdir)) continue;
             echo ' *   '.$file[1]."\n";
         }
         echo ' **************************************/'."\n\n";
@@ -2916,6 +2918,7 @@
             /// Actually collect all the files in order.
             $css = '';
             foreach ($files as $file) {
+                if (strstr($file[1], $oppositlangdir)) continue;
                 $css .= '/***** '.$file[1].' start *****/'."\n\n";
                 $css .= file_get_contents($file[0].'/'.$file[1]);
                 $ccs .= '/***** '.$file[1].' end *****/'."\n\n";
@@ -2926,12 +2929,14 @@
         /// Actually output all the files in order.
             if (empty($CFG->CSSEdit) && empty($THEME->CSSEdit)) {
                 foreach ($files as $file) {
+                    if (strstr($file[1], $oppositlangdir)) continue;
                     echo '/***** '.$file[1].' start *****/'."\n\n";
                     @include_once($file[0].'/'.$file[1]);
                     echo '/***** '.$file[1].' end *****/'."\n\n";
                 }
             } else {
                 foreach ($files as $file) {
+                    if (strstr($file[1], $oppositlangdir)) continue;
                     echo '/* @group '.$file[1].' */'."\n\n";
                     if (strstr($file[1], '.css') !== FALSE) {
                         echo '@import url("'.$CFG->themewww.'/'.$file[1].'");'."\n\n";
@@ -2970,6 +2975,10 @@
     if (!$params) {
         $params = array();
     }
+
+/// Add parameter for the language direction
+    $params[] = 'langdir='.get_string('thisdirection');
+    
     if ($theme != $CFG->theme) {
         $params[] = 'forceconfig='.$theme;
     }
@@ -2979,6 +2988,7 @@
         $params[] = 'lang='.current_language();
     }
 
+
 /// Convert params to string
     if ($params) {
         $paramstring = '?'.implode('&', $params);
Index: theme/custom_corners/styles.php
===================================================================
RCS file: /cvsroot/moodle/moodle/theme/custom_corners/styles.php,v
retrieving revision 1.1
diff -u -r1.1 styles.php
--- theme/custom_corners/styles.php	9 May 2007 14:27:05 -0000	1.1
+++ theme/custom_corners/styles.php	23 Jul 2007 17:06:48 -0000
@@ -13,7 +13,8 @@
     $themename = basename(dirname(__FILE__));           // Name of the folder we are in
     $forceconfig = optional_param('forceconfig', '', PARAM_FILE);   // Get config from this theme
     $lang        = optional_param('lang', '', PARAM_FILE);          // Look for styles in this language
-
-    style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang);
+    $langdir     = optional_param('langdir', '', PARAM_FILE);       // Add Langdirection
+    
+    style_sheet_setup(time(), $lifetime, $themename, $forceconfig, $lang, $langdir);
    
 ?>
