http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89981
Revision: 89981
Author: foxtrott
Date: 2011-06-13 17:27:29 +0000 (Mon, 13 Jun 2011)
Log Message:
-----------
* new setting $wgexLingoUseNamespaces
Modified Paths:
--------------
trunk/extensions/Lingo/Lingo.php
trunk/extensions/Lingo/LingoHooks.php
Modified: trunk/extensions/Lingo/Lingo.php
===================================================================
--- trunk/extensions/Lingo/Lingo.php 2011-06-13 16:57:36 UTC (rev 89980)
+++ trunk/extensions/Lingo/Lingo.php 2011-06-13 17:27:29 UTC (rev 89981)
@@ -31,7 +31,17 @@
// set if glossary terms are to be marked up once or always
$wgexLingoDisplayOnce = false;
+// set namespaces to be marked up;
+// namespaces to be ignored have to be included in this array and set to false
+// anything not in this array (or in this array and set to true) will be
marked up
+$wgexLingoUseNamespaces = array(
+// NS_MEDIA => true,
+// NS_SPECIAL => true,
+// NS_TALK => false,
+// ...
+);
+
// set extension credits
// (no description here, will be set later)
$wgExtensionCredits['parserhook']['lingo'] = array(
Modified: trunk/extensions/Lingo/LingoHooks.php
===================================================================
--- trunk/extensions/Lingo/LingoHooks.php 2011-06-13 16:57:36 UTC (rev
89980)
+++ trunk/extensions/Lingo/LingoHooks.php 2011-06-13 17:27:29 UTC (rev
89981)
@@ -20,7 +20,18 @@
static function parse( &$parser, &$text ) {
- if ( !isset( $parser->mDoubleUnderscores['noglossary'] ) ) {
+ global $wgexLingoUseNamespaces;
+
+ $title = $parser->getTitle();
+
+ // parse if
+ if ( !isset( $parser->mDoubleUnderscores['noglossary'] ) && //
__NOGLOSSARY__ not present and
+ (
+ !$title || // title not set or
+ !isset( $wgexLingoUseNamespaces[$title->getNamespace()]
) || // namespace not explicitly forbidden or
+ $wgexLingoUseNamespaces[$title->getNamespace()] //
namespace explicitly allowed
+ )
+ ) {
LingoParser::parse( $parser, $text );
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs