Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -252,7 +252,8 @@ |
253 | 253 | |
254 | 254 | |
255 | 255 | function pr_parse_index_text( $text ){ |
256 | | - |
| 256 | + global $wgParser; |
| 257 | + |
257 | 258 | $page_namespace = pr_page_ns(); |
258 | 259 | //check if it is using pagelist |
259 | 260 | preg_match_all( "/<pagelist([^<]*?)\/>/is", $text, $m, PREG_PATTERN_ORDER ); |
— | — | @@ -269,9 +270,13 @@ |
270 | 271 | preg_match_all( $tag_pattern, $text, $links, PREG_PATTERN_ORDER ); |
271 | 272 | } |
272 | 273 | |
273 | | - //links in ns-0 |
274 | | - $text_links_pattern = "/\[\[([^:\|]*?)(\|(.*?)|)\]\]/i"; |
275 | | - preg_match_all( $text_links_pattern, $text, $text_links, PREG_PATTERN_ORDER ); |
| 274 | + //links in ns-0. Only if mOptions exist |
| 275 | + if( $wgParser->mOptions ) { |
| 276 | + $rtext = $wgParser->replaceVariables( $text ); |
| 277 | + $text_links_pattern = "/\[\[([^:\|]*?)(\|(.*?)|)\]\]/i"; |
| 278 | + preg_match_all( $text_links_pattern, $rtext, $text_links, PREG_PATTERN_ORDER ); |
| 279 | + } |
| 280 | + else $text_links = null; |
276 | 281 | |
277 | 282 | //read attributes |
278 | 283 | $attributes = array(); |
— | — | @@ -788,6 +793,7 @@ |
789 | 794 | |
790 | 795 | if( $header ) { |
791 | 796 | $h_out = '{{:MediaWiki:Proofreadpage_header_template'; |
| 797 | + $h_out .= "|value=$header"; |
792 | 798 | //find next and previous pages in list |
793 | 799 | for( $i=1; $i < count( $text_links[1] ); $i++) { |
794 | 800 | if( $text_links[1][$i] == $wgTitle->getPrefixedText() ) { |
— | — | @@ -1326,9 +1332,11 @@ |
1327 | 1333 | $row = $dbr->fetchObject( $res ); |
1328 | 1334 | $title = $row->title; |
1329 | 1335 | $dbr->freeResult( $res ); |
1330 | | - } |
1331 | | - $sk = $wgUser->getSkin(); |
1332 | | - $indexlink = $sk->makeKnownLink( "$index_namespace:$title", "[index]" ); |
| 1336 | + $sk = $wgUser->getSkin(); |
| 1337 | + $indexlink = $sk->makeKnownLink( "$index_namespace:$title", "[index]" ); |
| 1338 | + } else { |
| 1339 | + $indexlink=""; |
| 1340 | + } |
1333 | 1341 | $output = wfMsgForContent( 'proofreadpage_quality_message', $n0*100/$n, $n1*100/$n, $n2*100/$n, $n3*100/$n, $n4*100/$n, $n, $indexlink ); |
1334 | 1342 | $out->setSubtitle($output); |
1335 | 1343 | return true; |