Index: trunk/extensions/Lingo/LingoHooks.php |
— | — | @@ -20,7 +20,18 @@ |
21 | 21 | |
22 | 22 | static function parse( &$parser, &$text ) { |
23 | 23 | |
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 | + ) { |
25 | 36 | LingoParser::parse( $parser, $text ); |
26 | 37 | } |
27 | 38 | |
Index: trunk/extensions/Lingo/Lingo.php |
— | — | @@ -31,7 +31,17 @@ |
32 | 32 | // set if glossary terms are to be marked up once or always |
33 | 33 | $wgexLingoDisplayOnce = false; |
34 | 34 | |
| 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 | +); |
35 | 44 | |
| 45 | + |
36 | 46 | // set extension credits |
37 | 47 | // (no description here, will be set later) |
38 | 48 | $wgExtensionCredits['parserhook']['lingo'] = array( |