Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -73,9 +73,7 @@ |
74 | 74 | public function setup( $parameters ) { |
75 | 75 | $opts = $this->getDefaultOptions(); |
76 | 76 | |
77 | | - $this->customFilters = array(); |
78 | | - wfRunHooks( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters ) ); |
79 | | - foreach( $this->customFilters as $key => $params ) { |
| 77 | + foreach( $this->getCustomFilters() as $key => $params ) { |
80 | 78 | $opts->add( $key, $params['default'] ); |
81 | 79 | } |
82 | 80 | |
— | — | @@ -91,6 +89,19 @@ |
92 | 90 | } |
93 | 91 | |
94 | 92 | /** |
| 93 | + * Get custom show/hide filters |
| 94 | + * |
| 95 | + * @return Array Map of filter URL param names to properties (msg/default) |
| 96 | + */ |
| 97 | + protected function getCustomFilters() { |
| 98 | + if ( $this->customFilters === null ) { |
| 99 | + $this->customFilters = array(); |
| 100 | + wfRunHooks( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters ) ); |
| 101 | + } |
| 102 | + return $this->customFilters; |
| 103 | + } |
| 104 | + |
| 105 | + /** |
95 | 106 | * Create a FormOptions object specific for feed requests and return it |
96 | 107 | * |
97 | 108 | * @return FormOptions |
— | — | @@ -806,14 +817,14 @@ |
807 | 818 | // show/hide links |
808 | 819 | $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) ); |
809 | 820 | $filters = array( |
810 | | - 'hideminor' => 'rcshowhideminor', |
811 | | - 'hidebots' => 'rcshowhidebots', |
812 | | - 'hideanons' => 'rcshowhideanons', |
813 | | - 'hideliu' => 'rcshowhideliu', |
| 821 | + 'hideminor' => 'rcshowhideminor', |
| 822 | + 'hidebots' => 'rcshowhidebots', |
| 823 | + 'hideanons' => 'rcshowhideanons', |
| 824 | + 'hideliu' => 'rcshowhideliu', |
814 | 825 | 'hidepatrolled' => 'rcshowhidepatr', |
815 | | - 'hidemyself' => 'rcshowhidemine' |
| 826 | + 'hidemyself' => 'rcshowhidemine' |
816 | 827 | ); |
817 | | - foreach ( $this->customFilters as $key => $params ) { |
| 828 | + foreach ( $this->getCustomFilters() as $key => $params ) { |
818 | 829 | $filters[$key] = $params['msg']; |
819 | 830 | } |
820 | 831 | // Disable some if needed |