Index: trunk/extensions/Cite/Cite_body.php |
— | — | @@ -633,45 +633,43 @@ |
634 | 634 | */ |
635 | 635 | function referencesFormatEntry( $key, $val ) { |
636 | 636 | // Anonymous reference |
637 | | - if ( ! is_array( $val ) ) |
638 | | - return |
639 | | - wfMsgForContentNoTrans( |
| 637 | + if ( !is_array( $val ) ) { |
| 638 | + return wfMsgForContentNoTrans( |
640 | 639 | 'cite_references_link_one', |
641 | 640 | $this->referencesKey( $key ), |
642 | 641 | $this->refKey( $key ), |
643 | 642 | $val |
644 | 643 | ); |
645 | | - else if ( isset( $val['follow'] ) ) |
646 | | - return |
647 | | - wfMsgForContentNoTrans( |
| 644 | + } else if ( isset( $val['follow'] ) ) { |
| 645 | + return wfMsgForContentNoTrans( |
648 | 646 | 'cite_references_no_link', |
649 | 647 | $this->referencesKey( $val['follow'] ), |
650 | 648 | $val['text'] |
651 | 649 | ); |
652 | | - else if ( $val['text'] == '' ) return |
653 | | - wfMsgForContentNoTrans( |
| 650 | + } else if ( $val['text'] == '' ) { |
| 651 | + return wfMsgForContentNoTrans( |
| 652 | + 'cite_references_link_one', |
| 653 | + $this->referencesKey( $key ), |
| 654 | + $this->refKey( $key, $val['count'] ), |
| 655 | + $this->error( 'cite_error_references_no_text', $key ) |
| 656 | + ); |
| 657 | + } |
| 658 | + |
| 659 | + if ( $val['count'] < 0 ) { |
| 660 | + return wfMsgForContentNoTrans( |
654 | 661 | 'cite_references_link_one', |
655 | | - $this->referencesKey( $key ), |
656 | | - $this->refKey( $key, $val['count'] ), |
657 | | - $this->error( 'cite_error_references_no_text', $key ) |
658 | | - ); |
659 | | - if ( $val['count'] < 0 ) |
660 | | - return |
661 | | - wfMsgForContentNoTrans( |
662 | | - 'cite_references_link_one', |
663 | 662 | $this->referencesKey( $val['key'] ), |
664 | 663 | # $this->refKey( $val['key'], $val['count'] ), |
665 | 664 | $this->refKey( $val['key'] ), |
666 | 665 | |
667 | 666 | ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) |
668 | 667 | ); |
669 | | - // Standalone named reference, I want to format this like an |
670 | | - // anonymous reference because displaying "1. 1.1 Ref text" is |
671 | | - // overkill and users frequently use named references when they |
672 | | - // don't need them for convenience |
673 | | - else if ( $val['count'] === 0 ) |
674 | | - return |
675 | | - wfMsgForContentNoTrans( |
| 668 | + // Standalone named reference, I want to format this like an |
| 669 | + // anonymous reference because displaying "1. 1.1 Ref text" is |
| 670 | + // overkill and users frequently use named references when they |
| 671 | + // don't need them for convenience |
| 672 | + } else if ( $val['count'] === 0 ) { |
| 673 | + return wfMsgForContentNoTrans( |
676 | 674 | 'cite_references_link_one', |
677 | 675 | $this->referencesKey( $key . "-" . $val['key'] ), |
678 | 676 | # $this->refKey( $key, $val['count'] ), |
— | — | @@ -679,9 +677,9 @@ |
680 | 678 | ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) |
681 | 679 | ); |
682 | 680 | // Named references with >1 occurrences |
683 | | - else { |
| 681 | + } else { |
684 | 682 | $links = array(); |
685 | | - // for group handling, we have an extra key here. |
| 683 | + // for group handling, we have an extra key here. |
686 | 684 | for ( $i = 0; $i <= $val['count']; ++$i ) { |
687 | 685 | $links[] = wfMsgForContentNoTrans( |
688 | 686 | 'cite_references_link_many_format', |
— | — | @@ -693,8 +691,7 @@ |
694 | 692 | |
695 | 693 | $list = $this->listToText( $links ); |
696 | 694 | |
697 | | - return |
698 | | - wfMsgForContentNoTrans( 'cite_references_link_many', |
| 695 | + return wfMsgForContentNoTrans( 'cite_references_link_many', |
699 | 696 | $this->referencesKey( $key . "-" . $val['key'] ), |
700 | 697 | $list, |
701 | 698 | ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) |