Merge "Revert "Remove old compat methods/functions for mb_ functions""
[lhc/web/wiklou.git] / languages / Language.php
index 240b0d3..9f00d04 100644 (file)
@@ -250,6 +250,8 @@ class Language {
                        $type = gettype( $code );
                        if( $type === 'object' ) {
                                $addmsg = " of class " . get_class( $code );
+                       } else {
+                               $addmsg = '';
                        }
                        throw new MWException( __METHOD__ . " must be passed a string, $type given$addmsg" );
                }
@@ -2716,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 '↓';
+               }
        }
 
        /**