Index: branches/pageoutput/includes/view/ArticlePageView.php |
— | — | @@ -30,6 +30,42 @@ |
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
| 34 | + * Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect |
| 35 | + * |
| 36 | + * @return int The old id for the request |
| 37 | + */ |
| 38 | + public function getOldIDFromRequest() { |
| 39 | + $this->mRedirectUrl = false; |
| 40 | + |
| 41 | + $request = $this->getRequest(); |
| 42 | + |
| 43 | + $oldid = $request->getVal( 'oldid' ); |
| 44 | + |
| 45 | + if ( isset( $oldid ) ) { |
| 46 | + $oldid = intval( $oldid ); |
| 47 | + if ( $rRequest->getVal( 'direction' ) == 'next' ) { |
| 48 | + $nextid = $this->getTitle()->getNextRevisionID( $oldid ); |
| 49 | + if ( $nextid ) { |
| 50 | + $oldid = $nextid; |
| 51 | + } else { |
| 52 | + $this->mRedirectUrl = $this->getTitle()->getFullURL( 'redirect=no' ); |
| 53 | + } |
| 54 | + } elseif ( $request->getVal( 'direction' ) == 'prev' ) { |
| 55 | + $previd = $this->getTitle()->getPreviousRevisionID( $oldid ); |
| 56 | + if ( $previd ) { |
| 57 | + $oldid = $previd; |
| 58 | + } |
| 59 | + } |
| 60 | + } |
| 61 | + |
| 62 | + if ( !$oldid ) { |
| 63 | + $oldid = 0; |
| 64 | + } |
| 65 | + |
| 66 | + return $oldid; |
| 67 | + } |
| 68 | + |
| 69 | + /** |
34 | 70 | * Get the robot policy to be used for the current view |
35 | 71 | * @return Array the policy that should be set |
36 | 72 | */ |
— | — | @@ -130,42 +166,6 @@ |
131 | 167 | return $arr; |
132 | 168 | } |
133 | 169 | |
134 | | - /** |
135 | | - * Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect |
136 | | - * |
137 | | - * @return int The old id for the request |
138 | | - */ |
139 | | - public function getOldIDFromRequest() { |
140 | | - $this->mRedirectUrl = false; |
141 | | - |
142 | | - $request = $this->getRequest(); |
143 | | - |
144 | | - $oldid = $request->getVal( 'oldid' ); |
145 | | - |
146 | | - if ( isset( $oldid ) ) { |
147 | | - $oldid = intval( $oldid ); |
148 | | - if ( $rRequest->getVal( 'direction' ) == 'next' ) { |
149 | | - $nextid = $this->getTitle()->getNextRevisionID( $oldid ); |
150 | | - if ( $nextid ) { |
151 | | - $oldid = $nextid; |
152 | | - } else { |
153 | | - $this->mRedirectUrl = $this->getTitle()->getFullURL( 'redirect=no' ); |
154 | | - } |
155 | | - } elseif ( $request->getVal( 'direction' ) == 'prev' ) { |
156 | | - $previd = $this->getTitle()->getPreviousRevisionID( $oldid ); |
157 | | - if ( $previd ) { |
158 | | - $oldid = $previd; |
159 | | - } |
160 | | - } |
161 | | - } |
162 | | - |
163 | | - if ( !$oldid ) { |
164 | | - $oldid = 0; |
165 | | - } |
166 | | - |
167 | | - return $oldid; |
168 | | - } |
169 | | - |
170 | 170 | /** PageView render and sub-areas of the rendering process **/ |
171 | 171 | |
172 | 172 | function render() { |