Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -587,41 +587,70 @@ |
588 | 588 | for( $i=1; $i<$count+1 ; $i++) { |
589 | 589 | |
590 | 590 | $pdbk = "$page_namespace:$name" . '/'. $i ; |
| 591 | + //default |
| 592 | + $single=false; |
| 593 | + $mode = 'normal'; |
| 594 | + $links = true; |
591 | 595 | |
592 | | - $single=false; |
593 | 596 | foreach ( $args as $num => $param ) { |
594 | | - if($i == $num) { |
595 | | - $param = explode(";",$param); |
596 | | - if(isset($param[1])) $mode = $param[1]; else $mode='normal'; |
597 | | - if(is_numeric($param[0])) $offset = $i - $param[0]; |
598 | | - else $single=$param[0]; |
| 597 | + |
| 598 | + if( ( preg_match( "/^([0-9]*)to([0-9]*)$/", $num, $m ) && ( $i>=$m[1] && $i<=$m[2] ) ) |
| 599 | + || ( is_numeric($num) && ($i == $num) ) ) { |
| 600 | + $params = explode(";",$param); |
| 601 | + foreach ( $params as $iparam ) { |
| 602 | + switch($iparam){ |
| 603 | + case 'roman': |
| 604 | + $mode = 'roman'; |
| 605 | + break; |
| 606 | + case 'highroman': |
| 607 | + $mode = 'highroman'; |
| 608 | + break; |
| 609 | + case 'empty': |
| 610 | + $links = false; |
| 611 | + break; |
| 612 | + default: |
| 613 | + if(is_numeric($iparam)) |
| 614 | + $offset = $i - $iparam[0]; |
| 615 | + else |
| 616 | + $single = $iparam[0]; |
| 617 | + |
| 618 | + } |
| 619 | + } |
599 | 620 | } |
600 | | - } |
| 621 | + } |
601 | 622 | |
602 | | - if( $single ) { $view = $single; $single=false; $offset=$offset+1;} |
| 623 | + if( $single ) { |
| 624 | + $view = $single; |
| 625 | + $offset=$offset+1; |
| 626 | + } |
603 | 627 | else { |
604 | | - $view = ($i - $offset); |
605 | | - if($mode == 'highroman') $view = ' '.toRoman($view); |
606 | | - elseif($mode == 'roman') $view = ' '.strtolower(toRoman($view)); |
607 | | - elseif($mode == 'normal') $view = ''.$view; |
608 | | - else $view = $mode.$view; |
| 628 | + $view = ($i - $offset); |
| 629 | + if($mode == 'highroman') $view = ' '.toRoman($view); |
| 630 | + elseif($mode == 'roman') $view = ' '.strtolower(toRoman($view)); |
| 631 | + elseif($mode == 'normal') $view = ''.$view; |
| 632 | + elseif($mode == 'empty') $view = ''.$view; |
| 633 | + else $view = $mode.$view; |
609 | 634 | } |
610 | 635 | |
611 | 636 | $n = strlen($count) - strlen($view); |
612 | | - if( $n && ($mode == 'normal') ){ |
| 637 | + if( $n && ($mode == 'normal' || $mode == 'empty') ){ |
613 | 638 | $txt = '<span style="visibility:hidden;">'; |
614 | 639 | for( $j=0; $j<$n; $j++) $txt = $txt.'0'; |
615 | 640 | $view = $txt.'</span>'.$view; |
616 | 641 | } |
617 | 642 | $title = Title::newFromText( $pdbk ); |
618 | | - if ( !isset( $colours[$pdbk] ) ) { |
619 | | - $link = $sk->makeBrokenLinkObj( $title, $view ); |
620 | | - } else { |
621 | | - $link = $sk->makeColouredLinkObj( $title, $colours[$pdbk], $view ); |
| 643 | + |
| 644 | + if($links==false) $return.= $view." "; |
| 645 | + else{ |
| 646 | + if ( !isset( $colours[$pdbk] ) ) { |
| 647 | + $link = $sk->makeBrokenLinkObj( $title, $view ); |
| 648 | + } |
| 649 | + else { |
| 650 | + $link = $sk->makeColouredLinkObj( $title, $colours[$pdbk], $view ); |
| 651 | + } |
| 652 | + $return .= "{$link} "; |
622 | 653 | } |
623 | | - $return .= "{$link} "; |
624 | 654 | } |
625 | | - |
626 | 655 | } |
627 | 656 | return $return; |
628 | 657 | } |