X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2FLanguage.php;h=fdea3d8e0cb963451fd1245bff4c86df82a19d99;hb=250da851d1ab6d01a7c53a6e947b699e54b4b470;hp=ec2038395f783b676478d97a98bf00070dae5b59;hpb=2f5914c2ce4c612920dd96f5ef66e3bd342d2195;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index ec2038395f..fdea3d8e0c 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -403,6 +403,16 @@ class Language { */ public function setNamespaces( array $namespaces ) { $this->namespaceNames = $namespaces; + $this->mNamespaceIds = null; + } + + /** + * Resets all of the namespace caches. Mainly used for testing + */ + public function resetNamespaces( ) { + $this->namespaceNames = null; + $this->mNamespaceIds = null; + $this->namespaceAliases = null; } /** @@ -2718,12 +2728,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 '↓'; + } } /**