http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95775
Revision: 95775
Author: nikerabbit
Date: 2011-08-30 13:24:27 +0000 (Tue, 30 Aug 2011)
Log Message:
-----------
New hook to replace live hack on translatewiki.net. Allows reordering namespaces
Modified Paths:
--------------
trunk/phase3/docs/hooks.txt
trunk/phase3/languages/Language.php
Modified: trunk/phase3/docs/hooks.txt
===================================================================
--- trunk/phase3/docs/hooks.txt 2011-08-30 13:21:26 UTC (rev 95774)
+++ trunk/phase3/docs/hooks.txt 2011-08-30 13:24:27 UTC (rev 95775)
@@ -1089,6 +1089,10 @@
&$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
Modified: trunk/phase3/languages/Language.php
===================================================================
--- trunk/phase3/languages/Language.php 2011-08-30 13:21:26 UTC (rev 95774)
+++ trunk/phase3/languages/Language.php 2011-08-30 13:24:27 UTC (rev 95775)
@@ -341,6 +341,8 @@
# 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 @@
}
/**
- * Get the first fallback for a given language
+ * Get the first fallback for a given language.
*
* @param $code string
*
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs