Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -116,16 +116,8 @@ |
117 | 117 | } |
118 | 118 | |
119 | 119 | // Add RSS/atom links |
120 | | - global $wgFeedClasses; |
121 | | - $apiParams = array( 'action' => 'feedcontributions', 'user' => $wgUser->getName() ); |
122 | | - $feedTemplate = wfScript( 'api' ) . '?'; |
| 120 | + $this->addFeedLinks( array( 'action' => 'feedcontributions', 'user' => $wgUser->getName() ) ); |
123 | 121 | |
124 | | - foreach( $wgFeedClasses as $format => $class ) { |
125 | | - $theseParams = $apiParams + array( 'feedformat' => $format ); |
126 | | - $url = $feedTemplate . wfArrayToCGI( $theseParams ); |
127 | | - $wgOut->addFeedLink( $format, $url ); |
128 | | - } |
129 | | - |
130 | 122 | if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( $id ) ) ) { |
131 | 123 | |
132 | 124 | $wgOut->addHTML( $this->getForm() ); |
Index: trunk/phase3/includes/specials/SpecialWatchlist.php |
— | — | @@ -46,17 +46,9 @@ |
47 | 47 | $wgUser->saveSettings(); |
48 | 48 | } |
49 | 49 | |
50 | | - global $wgFeedClasses; |
51 | | - $apiParams = array( 'action' => 'feedwatchlist', 'allrev' => 'allrev', |
52 | | - 'wlowner' => $wgUser->getName(), 'wltoken' => $wlToken ); |
53 | | - $feedTemplate = wfScript( 'api' ) . '?'; |
| 50 | + $this->addFeedLinks( array( 'action' => 'feedwatchlist', 'allrev' => 'allrev', |
| 51 | + 'wlowner' => $wgUser->getName(), 'wltoken' => $wlToken ) ); |
54 | 52 | |
55 | | - foreach( $wgFeedClasses as $format => $class ) { |
56 | | - $theseParams = $apiParams + array( 'feedformat' => $format ); |
57 | | - $url = $feedTemplate . wfArrayToCGI( $theseParams ); |
58 | | - $wgOut->addFeedLink( $format, $url ); |
59 | | - } |
60 | | - |
61 | 53 | $skin = $this->getSkin(); |
62 | 54 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
63 | 55 | |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -657,6 +657,23 @@ |
658 | 658 | public function msg( /* $args */ ) { |
659 | 659 | return call_user_func_array( 'wfMessage', func_get_args() )->title( $this->getFullTitle() ); |
660 | 660 | } |
| 661 | + |
| 662 | + /** |
| 663 | + * Adds RSS/atom links |
| 664 | + * |
| 665 | + * @param $params array |
| 666 | + */ |
| 667 | + protected function addFeedLinks( $params ) { |
| 668 | + global $wgFeedClasses, $wgOut; |
| 669 | + |
| 670 | + $feedTemplate = wfScript( 'api' ) . '?'; |
| 671 | + |
| 672 | + foreach( $wgFeedClasses as $format => $class ) { |
| 673 | + $theseParams = $params + array( 'feedformat' => $format ); |
| 674 | + $url = $feedTemplate . wfArrayToCGI( $theseParams ); |
| 675 | + $wgOut->addFeedLink( $format, $url ); |
| 676 | + } |
| 677 | + } |
661 | 678 | } |
662 | 679 | |
663 | 680 | /** |