r89981 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89980‎ | r89981 | r89982 >
Date:17:27, 13 June 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
* new setting $wgexLingoUseNamespaces
Modified paths:
  • /trunk/extensions/Lingo/Lingo.php (modified) (history)
  • /trunk/extensions/Lingo/LingoHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Lingo/LingoHooks.php
@@ -20,7 +20,18 @@
2121
2222 static function parse( &$parser, &$text ) {
2323
24 - if ( !isset( $parser->mDoubleUnderscores['noglossary'] ) ) {
 24+ global $wgexLingoUseNamespaces;
 25+
 26+ $title = $parser->getTitle();
 27+
 28+ // parse if
 29+ if ( !isset( $parser->mDoubleUnderscores['noglossary'] ) && // __NOGLOSSARY__ not present and
 30+ (
 31+ !$title || // title not set or
 32+ !isset( $wgexLingoUseNamespaces[$title->getNamespace()] ) || // namespace not explicitly forbidden or
 33+ $wgexLingoUseNamespaces[$title->getNamespace()] // namespace explicitly allowed
 34+ )
 35+ ) {
2536 LingoParser::parse( $parser, $text );
2637 }
2738
Index: trunk/extensions/Lingo/Lingo.php
@@ -31,7 +31,17 @@
3232 // set if glossary terms are to be marked up once or always
3333 $wgexLingoDisplayOnce = false;
3434
 35+// set namespaces to be marked up;
 36+// namespaces to be ignored have to be included in this array and set to false
 37+// anything not in this array (or in this array and set to true) will be marked up
 38+$wgexLingoUseNamespaces = array(
 39+// NS_MEDIA => true,
 40+// NS_SPECIAL => true,
 41+// NS_TALK => false,
 42+// ...
 43+);
3544
 45+
3646 // set extension credits
3747 // (no description here, will be set later)
3848 $wgExtensionCredits['parserhook']['lingo'] = array(

Status & tagging log