Index: trunk/extensions/LiquidThreads/LqtFunctions.php |
— | — | @@ -47,6 +47,11 @@ |
48 | 48 | 'useliquidthreads', |
49 | 49 | array( 'LqtParserFunctions', 'useLiquidThreads' ) |
50 | 50 | ); |
| 51 | + |
| 52 | + $parser->setFunctionHook( |
| 53 | + 'lqtpagelimit', |
| 54 | + array( 'LqtParserFunctions', 'lqtPageLimit' ) |
| 55 | + ); |
51 | 56 | |
52 | 57 | return true; |
53 | 58 | } |
Index: trunk/extensions/LiquidThreads/i18n/LiquidThreads.magic.php |
— | — | @@ -4,6 +4,7 @@ |
5 | 5 | |
6 | 6 | $magicWords['en'] = array( |
7 | 7 | 'useliquidthreads' => array( 0, 'UseLiquidThreads' ), |
| 8 | + 'lqtpagelimit' => array( 0, 'lqtpagelimit' ), |
8 | 9 | ); |
9 | 10 | |
10 | 11 | $magicWords['ar'] = array( |
Index: trunk/extensions/LiquidThreads/LiquidThreads.php |
— | — | @@ -211,3 +211,6 @@ |
212 | 212 | |
213 | 213 | /** Switch this on if you've migrated from a version before around May 2009 */ |
214 | 214 | $wgLiquidThreadsMigrate = false; |
| 215 | + |
| 216 | +/** The default number of threads per page */ |
| 217 | +$wgLiquidThreadsDefaultPageLimit = 20; |
Index: trunk/extensions/LiquidThreads/classes/ParserFunctions.php |
— | — | @@ -14,4 +14,10 @@ |
15 | 15 | |
16 | 16 | $parser->mOutput->setProperty( 'use-liquid-threads', $param ); |
17 | 17 | } |
| 18 | + |
| 19 | + static function lqtPageLimit( &$parser, $param = null ) { |
| 20 | + if ($param && $param > 0) { |
| 21 | + $parser->mOutput->setProperty( 'lqt-page-limit', $param ); |
| 22 | + } |
| 23 | + } |
18 | 24 | } |
Index: trunk/extensions/LiquidThreads/pages/TalkpageView.php |
— | — | @@ -364,9 +364,21 @@ |
365 | 365 | |
366 | 366 | parent::__construct(); |
367 | 367 | |
368 | | - $this->mLimit = 20; |
| 368 | + $this->mLimit = $this->getPageLimit(); |
369 | 369 | } |
370 | 370 | |
| 371 | + function getPageLimit() { |
| 372 | + $article = $this->article; |
| 373 | + |
| 374 | + $pout = $article->getParserOutput(); |
| 375 | + $setLimit = $pout->getProperty('lqt-page-limit'); |
| 376 | + |
| 377 | + if ($setLimit) return $setLimit; |
| 378 | + |
| 379 | + global $wgLiquidThreadsDefaultPageLimit; |
| 380 | + return $wgLiquidThreadsDefaultPageLimit; |
| 381 | + } |
| 382 | + |
371 | 383 | function getQueryInfo() { |
372 | 384 | $queryInfo = |
373 | 385 | array( |