Index: trunk/phase3/includes/SpecialNewimages.php |
— | — | @@ -11,13 +11,14 @@ |
12 | 12 | /** |
13 | 13 | * |
14 | 14 | */ |
15 | | -function wfSpecialNewimages() { |
| 15 | +function wfSpecialNewimages( $par, $specialPage ) { |
16 | 16 | global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, |
17 | 17 | $wgGroupPermissions; |
18 | 18 | |
19 | 19 | $wpIlMatch = $wgRequest->getText( 'wpIlMatch' ); |
20 | 20 | $dbr =& wfGetDB( DB_SLAVE ); |
21 | 21 | $sk = $wgUser->getSkin(); |
| 22 | + $shownav = !$specialPage->including(); |
22 | 23 | $hidebots = $wgRequest->getBool('hidebots',1); |
23 | 24 | |
24 | 25 | if($hidebots) { |
— | — | @@ -66,6 +67,10 @@ |
67 | 68 | /** Hardcode this for now. */ |
68 | 69 | $limit = 48; |
69 | 70 | |
| 71 | + if ( $parval = intval( $par ) ) |
| 72 | + if ( $parval <= $limit && $parval > 0 ) |
| 73 | + $limit = $parval; |
| 74 | + |
70 | 75 | $where = array(); |
71 | 76 | if ( $wpIlMatch != '' ) { |
72 | 77 | $nt = Title::newFromUrl( $wpIlMatch ); |
— | — | @@ -141,9 +146,10 @@ |
142 | 147 | |
143 | 148 | $bydate = wfMsg( 'bydate' ); |
144 | 149 | $lt = $wgLang->formatNum( min( $shownImages, $limit ) ); |
145 | | - $text = wfMsg( "imagelisttext", |
146 | | - "<strong>{$lt}</strong>", "<strong>{$bydate}</strong>" ); |
147 | | - $wgOut->addHTML( "<p>{$text}\n</p>" ); |
| 150 | + if ($shownav) { |
| 151 | + $text = wfMsg( 'imagelisttext', "<strong>{$lt}</strong>", "<strong>{$bydate}</strong>" ); |
| 152 | + $wgOut->addHTML( "<p>{$text}\n</p>" ); |
| 153 | + } |
148 | 154 | |
149 | 155 | $sub = wfMsg( 'ilsubmit' ); |
150 | 156 | $titleObj = Title::makeTitle( NS_SPECIAL, 'Newimages' ); |
— | — | @@ -151,11 +157,13 @@ |
152 | 158 | if(!$hidebots) { |
153 | 159 | $action.='&hidebots=0'; |
154 | 160 | } |
155 | | - $wgOut->addHTML( "<form id=\"imagesearch\" method=\"post\" action=\"" . |
156 | | - "{$action}\">" . |
157 | | - "<input type='text' size='20' name=\"wpIlMatch\" value=\"" . |
158 | | - htmlspecialchars( $wpIlMatch ) . "\" /> " . |
159 | | - "<input type='submit' name=\"wpIlSubmit\" value=\"{$sub}\" /></form>" ); |
| 161 | + if ($shownav) { |
| 162 | + $wgOut->addHTML( "<form id=\"imagesearch\" method=\"post\" action=\"" . |
| 163 | + "{$action}\">" . |
| 164 | + "<input type='text' size='20' name=\"wpIlMatch\" value=\"" . |
| 165 | + htmlspecialchars( $wpIlMatch ) . "\" /> " . |
| 166 | + "<input type='submit' name=\"wpIlSubmit\" value=\"{$sub}\" /></form>" ); |
| 167 | + } |
160 | 168 | $here = $wgContLang->specialPage( 'Newimages' ); |
161 | 169 | |
162 | 170 | /** |
— | — | @@ -186,11 +194,13 @@ |
187 | 195 | |
188 | 196 | $prevnext = '<p>' . $botLink . ' '. wfMsg( 'viewprevnext', $prevLink, $nextLink, $dateLink ) .'</p>'; |
189 | 197 | |
190 | | - $wgOut->addHTML( $prevnext ); |
| 198 | + if ($shownav) |
| 199 | + $wgOut->addHTML( $prevnext ); |
191 | 200 | |
192 | 201 | if( count( $images ) ) { |
193 | 202 | $wgOut->addHTML( $gallery->toHTML() ); |
194 | | - $wgOut->addHTML( $prevnext ); |
| 203 | + if ($shownav) |
| 204 | + $wgOut->addHTML( $prevnext ); |
195 | 205 | } else { |
196 | 206 | $wgOut->addWikiText( wfMsg( 'noimages' ) ); |
197 | 207 | } |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | 'Recentchanges' => new IncludableSpecialPage( 'Recentchanges' ), |
34 | 34 | 'Upload' => new SpecialPage( 'Upload' ), |
35 | 35 | 'Imagelist' => new SpecialPage( 'Imagelist' ), |
36 | | - 'Newimages' => new SpecialPage( 'Newimages' ), |
| 36 | + 'Newimages' => new IncludableSpecialPage( 'Newimages' ), |
37 | 37 | 'Listusers' => new SpecialPage( 'Listusers' ), |
38 | 38 | 'Statistics' => new SpecialPage( 'Statistics' ), |
39 | 39 | 'Random' => new SpecialPage( 'Randompage' ), |