Index: trunk/extensions/Cite/Cite.i18n.php |
— | — | @@ -67,7 +67,6 @@ |
68 | 68 | # Although I could just use # instead of <li> above and nothing here that |
69 | 69 | # will break on input that contains linebreaks |
70 | 70 | 'cite_references_prefix' => '<ol class="references">', |
71 | | - 'cite_references_prefix_a' => '<ol type="a" class="references">', |
72 | 71 | 'cite_references_suffix' => '</ol>', |
73 | 72 | ); |
74 | 73 | |
Index: trunk/extensions/Cite/Cite.php |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | * </code> |
69 | 69 | * |
70 | 70 | * This works because: |
71 | | - * * PHP's datastructures are guaranteed to be returned in the |
| 71 | + * * PHP's datastructures are guarenteed to be returned in the |
72 | 72 | * order that things are inserted into them (unless you mess |
73 | 73 | * with that) |
74 | 74 | * * User supplied keys can't be integers, therefore avoiding |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | * |
84 | 84 | * @var int |
85 | 85 | */ |
86 | | - static $mOutCnt = 0; |
| 86 | + var $mOutCnt = 0; |
87 | 87 | var $mGroupCnt = array(); |
88 | 88 | |
89 | 89 | /** |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | * |
94 | 94 | * @var int |
95 | 95 | */ |
96 | | - static $mInCnt = 0; |
| 96 | + var $mInCnt = 0; |
97 | 97 | |
98 | 98 | /** |
99 | 99 | * The backlinks, in order, to pass as $3 to |
— | — | @@ -282,9 +282,9 @@ |
283 | 283 | if ( $key === null ) { |
284 | 284 | // No key |
285 | 285 | //$this->mRefs[$group][] = $str; |
286 | | - $this->mRefs[$group][] = array('count'=>-1, 'text'=>$str, 'key'=>++self::$mOutCnt); |
| 286 | + $this->mRefs[$group][] = array('count'=>-1, 'text'=>$str, 'key'=>++$this->mOutCnt); |
287 | 287 | |
288 | | - return $this->linkRef( $group, self::$mInCnt++ ); |
| 288 | + return $this->linkRef( $group, $this->mInCnt++ ); |
289 | 289 | } else if ( is_string( $key ) ) { |
290 | 290 | // Valid key |
291 | 291 | if ( ! isset( $this->mRefs[$group][$key] ) || ! is_array( $this->mRefs[$group][$key] ) ) { |
— | — | @@ -292,10 +292,10 @@ |
293 | 293 | $this->mRefs[$group][$key] = array( |
294 | 294 | 'text' => $str, |
295 | 295 | 'count' => 0, |
296 | | - 'key' => ++self::$mOutCnt, |
| 296 | + 'key' => ++$this->mOutCnt, |
297 | 297 | 'number' => ++$this->mGroupCnt[$group] |
298 | 298 | ); |
299 | | - self::$mInCnt++; |
| 299 | + $this->mInCnt++; |
300 | 300 | return |
301 | 301 | $this->linkRef( |
302 | 302 | $group, |
— | — | @@ -373,7 +373,7 @@ |
374 | 374 | * |
375 | 375 | * @return string XHTML ready for output |
376 | 376 | */ |
377 | | - function referencesFormat($group, $prefix='cite_references_prefix') { |
| 377 | + function referencesFormat($group) { |
378 | 378 | if (( count( $this->mRefs ) == 0 ) or (empty( $this->mRefs[$group] ) )) |
379 | 379 | return ''; |
380 | 380 | |
— | — | @@ -383,7 +383,7 @@ |
384 | 384 | foreach ( $this->mRefs[$group] as $k => $v ) |
385 | 385 | $ent[] = $this->referencesFormatEntry( $k, $v ); |
386 | 386 | |
387 | | - $prefix = wfMsgForContentNoTrans( $prefix ); |
| 387 | + $prefix = wfMsgForContentNoTrans( 'cite_references_prefix' ); |
388 | 388 | $suffix = wfMsgForContentNoTrans( 'cite_references_suffix' ); |
389 | 389 | $content = implode( "\n", $ent ); |
390 | 390 | |
— | — | @@ -516,12 +516,6 @@ |
517 | 517 | } |
518 | 518 | } |
519 | 519 | |
520 | | - function refCounterString($counter) { |
521 | | - global $wgContLang; |
522 | | - return $wgContLang->formatNum($counter); |
523 | | - } |
524 | | - |
525 | | - |
526 | 520 | /** |
527 | 521 | * Return an id for use in wikitext output based on a key and |
528 | 522 | * optionally the number of it, used in <references>, not <ref> |
— | — | @@ -570,18 +564,19 @@ |
571 | 565 | * @param int $count The index of the key, used for distinguishing |
572 | 566 | * multiple occurances of the same key |
573 | 567 | * @param int $label The label to use for the link, I want to |
574 | | - * use the same label for all occurances of |
| 568 | + * use the same label for all occourances of |
575 | 569 | * the same named reference. |
576 | 570 | * @return string |
577 | 571 | */ |
578 | 572 | function linkRef( $group, $key, $count = null, $label = null, $subkey = '' ) { |
| 573 | + global $wgContLang; |
579 | 574 | return |
580 | 575 | $this->parse( |
581 | 576 | wfMsgForContentNoTrans( |
582 | 577 | 'cite_reference_link', |
583 | 578 | $this->refKey( $key, $count ), |
584 | 579 | $this->referencesKey( $key . $subkey ), |
585 | | - (($group == CITE_DEFAULT_GROUP)?'':"$group ").$this->refCounterString( is_null( $label ) ? ++$this->mGroupCnt[$group] : $label ) |
| 580 | + (($group == CITE_DEFAULT_GROUP)?'':"$group ").$wgContLang->formatNum( is_null( $label ) ? ++$this->mGroupCnt[$group] : $label ) |
586 | 581 | ) |
587 | 582 | ); |
588 | 583 | } |
— | — | @@ -685,8 +680,8 @@ |
686 | 681 | */ |
687 | 682 | function clearState() { |
688 | 683 | $this->mGroupCnt = array(); |
689 | | - self::$mOutCnt = -1; |
690 | | - self::$mInCnt = 0; |
| 684 | + $this->mOutCnt = -1; |
| 685 | + $this->mInCnt = 0; |
691 | 686 | $this->mRefs = array(); |
692 | 687 | |
693 | 688 | return true; |
— | — | @@ -737,51 +732,7 @@ |
738 | 733 | /**#@-*/ |
739 | 734 | } |
740 | 735 | |
741 | | - |
742 | | - |
743 | | - class Note extends Cite |
744 | | - { |
745 | | - |
746 | | - /** |
747 | | - * Constructor |
748 | | - */ |
749 | | - function Note() { |
750 | | - $this->setHooks(); |
751 | | - } |
752 | | - |
753 | | - /** |
754 | | - * Initialize the parser hooks |
755 | | - */ |
756 | | - function setHooks() { |
757 | | - global $wgParser, $wgHooks; |
758 | | - |
759 | | - $wgParser->setHook( 'note' , array( &$this, 'ref' ) ); |
760 | | - $wgParser->setHook( 'footnotes' , array( &$this, 'references' ) ); |
761 | | - |
762 | | - $wgHooks['ParserClearState'][] = array( &$this, 'clearState' ); |
763 | | - } |
764 | | - |
765 | | - function refCounterString($counter) { |
766 | | - return $this->referencesFormatEntryAlternateBacklinkLabel( $counter-1 ); |
767 | | - } |
768 | | - |
769 | | - |
770 | | - /** |
771 | | - * Make output to be returned from the references() function |
772 | | - * |
773 | | - * @return string XHTML ready for output |
774 | | - */ |
775 | | - function referencesFormat($group, $prefix='cite_references_prefix_a') { |
776 | | - return parent::referencesFormat($group, $prefix); |
777 | | -} |
778 | | - |
779 | | - } |
780 | | - |
781 | | - |
782 | | - |
783 | | - |
784 | 736 | new Cite; |
785 | | - new Note; |
786 | 737 | } |
787 | 738 | |
788 | 739 | /**#@-*/ |