Adding params to getArrow()
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Wed, 16 May 2012 22:55:08 +0000 (01:55 +0300)
committerAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Mon, 21 May 2012 13:22:57 +0000 (16:22 +0300)
Adding params to getArrow, backwards, left, right, up, down.

Change-Id: Ifbcffca71c495a627d69edd36fec389ceb68bb80

languages/Language.php

index ec20383..9f00d04 100644 (file)
@@ -2718,12 +2718,26 @@ class Language {
        }
 
        /**
-        * An arrow, depending on the language direction
+        * An arrow, depending on the language direction.
         *
+        * @param $direction String: the direction of the arrow: forwards (default), backwards, left, right, up, down.
         * @return string
         */
-       function getArrow() {
-               return $this->isRTL() ? '←' : '→';
+       function getArrow( $direction = 'forwards' ) {
+               switch ( $direction ) {
+               case 'forwards':
+                       return $this->isRTL() ? '←' : '→';
+               case 'backwards':
+                       return $this->isRTL() ? '→' : '←';
+               case 'left':
+                       return '←';
+               case 'right':
+                       return '→';
+               case 'up':
+                       return '↑';
+               case 'down':
+                       return '↓';
+               }
        }
 
        /**