From: Niklas Laxström Date: Tue, 30 Aug 2011 13:24:27 +0000 (+0000) Subject: New hook to replace live hack on translatewiki.net. Allows reordering namespaces X-Git-Tag: 1.31.0-rc.0~28015 X-Git-Url: http://git.cyclocoop.org/data/modifier.php?a=commitdiff_plain;h=11a50da270198fdd17ae521863e5bd289ea8606d;p=lhc%2Fweb%2Fwiklou.git New hook to replace live hack on translatewiki.net. Allows reordering namespaces --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 349a87f319..745ae73098 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1089,6 +1089,10 @@ $password: The password entered by the user &$result: Set this and return false to override the internal checks $user: User the password is being validated for +'LanguageGetNamespaces': Provide custom ordering for namespaces or +remove namespaces. Do not use this hook to add namespaces. +&$namespaces: Array of namespaces indexed by their numbers + 'LanguageGetMagic': DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language diff --git a/languages/Language.php b/languages/Language.php index 49067be2cd..308e6602d2 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -341,6 +341,8 @@ class Language { # The above mixing may leave namespaces out of canonical order. # Re-order by namespace ID number... ksort( $this->namespaceNames ); + + wfRunHooks( 'LanguageGetNamespaces', array( &$this->namespaceNames ) ); } return $this->namespaceNames; } @@ -3312,7 +3314,7 @@ class Language { } /** - * Get the first fallback for a given language + * Get the first fallback for a given language. * * @param $code string *