]> git.mjollnir.org Git - moodle.git/commitdiff
Switch arrows in blocks when in RTL mode MDL-10768
authormoodler <moodler>
Thu, 9 Aug 2007 08:47:09 +0000 (08:47 +0000)
committermoodler <moodler>
Thu, 9 Aug 2007 08:47:09 +0000 (08:47 +0000)
blocks/moodleblock.class.php

index a9a32b946ad1117b0cbc38875d55325bf69b1139..3b34d4f7f2151928c8a8720a557482c9809a5a6f 100644 (file)
@@ -324,6 +324,15 @@ class block_base {
             $this->str->assignroles = get_string('assignroles', 'role');
         }
 
+        // RTL support - exchange right and left arrows
+        if (right_to_left()) {
+            $rightarrow = 'left.gif';
+            $leftarrow  = 'right.gif';
+        } else {
+            $rightarrow = 'right.gif';
+            $leftarrow  = 'left.gif';
+        }
+
         $movebuttons = '<div class="commands">';
 
         if ($this->instance->visible) {
@@ -361,7 +370,7 @@ class block_base {
 
         if ($options & BLOCK_MOVE_LEFT) {
             $movebuttons .= '<a class="icon left" title="'. $this->str->moveleft .'" href="'.$script.'&amp;blockaction=moveleft">' .
-                            '<img src="'. $CFG->pixpath .'/t/left.gif" alt="'. $this->str->moveleft .'" /></a>';
+                            '<img src="'. $CFG->pixpath .'/t/'.$leftarrow.'" alt="'. $this->str->moveleft .'" /></a>';
         }
         if ($options & BLOCK_MOVE_UP) {
             $movebuttons .= '<a class="icon up" title="'. $this->str->moveup .'" href="'.$script.'&amp;blockaction=moveup">' .
@@ -373,7 +382,7 @@ class block_base {
         }
         if ($options & BLOCK_MOVE_RIGHT) {
             $movebuttons .= '<a class="icon right" title="'. $this->str->moveright .'" href="'.$script.'&amp;blockaction=moveright">' .
-                            '<img src="'. $CFG->pixpath .'/t/right.gif" alt="'. $this->str->moveright .'" /></a>';
+                            '<img src="'. $CFG->pixpath .'/t/'.$rightarrow.'" alt="'. $this->str->moveright .'" /></a>';
         }
 
         $movebuttons .= '</div>';