Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -108,11 +108,22 @@ |
109 | 109 | $links = array(); |
110 | 110 | $hiddens = ''; // keep track for "go" button |
111 | 111 | foreach( $filter as $type => $val ) { |
| 112 | + // Should the below assignment be outside the foreach? |
| 113 | + // Then it would have to be copied. Not certain what is more expensive. |
| 114 | + $query = $this->getDefaultQuery(); |
| 115 | + $queryKey = "hide_{$type}_log"; |
| 116 | + $query[$queryKey] = $hideVal; |
| 117 | + |
112 | 118 | $hideVal = 1 - intval($val); |
113 | | - // FIXME: use link() here. Needs changes in getDefaultQuery() |
114 | | - $link = $this->skin->makeKnownLinkObj( $wgTitle, $messages[$hideVal], |
115 | | - wfArrayToCGI( array( "hide_{$type}_log" => $hideVal ), $this->getDefaultQuery() ) |
| 119 | + |
| 120 | + $link = $this->skin->link( |
| 121 | + $wgTitle, |
| 122 | + $messages[$hideVal], |
| 123 | + array(), |
| 124 | + $query, |
| 125 | + array( 'known', 'noclasses' ) |
116 | 126 | ); |
| 127 | + |
117 | 128 | $links[$type] = wfMsgHtml( "log-show-hide-{$type}", $link ); |
118 | 129 | $hiddens .= Xml::hidden( "hide_{$type}_log", $val ) . "\n"; |
119 | 130 | } |
Index: trunk/phase3/includes/specials/SpecialNewimages.php |
— | — | @@ -65,13 +65,13 @@ |
66 | 66 | } |
67 | 67 | |
68 | 68 | $where = array(); |
69 | | - $searchpar = ''; |
| 69 | + $searchpar = array(); |
70 | 70 | if ( $wpIlMatch != '' && !$wgMiserMode) { |
71 | 71 | $nt = Title::newFromUrl( $wpIlMatch ); |
72 | 72 | if( $nt ) { |
73 | 73 | $m = $dbr->escapeLike( strtolower( $nt->getDBkey() ) ); |
74 | 74 | $where[] = "LOWER(img_name) LIKE '%{$m}%'"; |
75 | | - $searchpar = '&wpIlMatch=' . urlencode( $wpIlMatch ); |
| 75 | + $searchpar['wpIlMatch'] = $wpIlMatch; |
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
— | — | @@ -163,29 +163,75 @@ |
164 | 164 | |
165 | 165 | # If we change bot visibility, this needs to be carried along. |
166 | 166 | if( !$hidebots ) { |
167 | | - $botpar = '&hidebots=0'; |
| 167 | + $botpar = array( 'hidebots' => 0 ); |
168 | 168 | } else { |
169 | | - $botpar = ''; |
| 169 | + $botpar = array(); |
170 | 170 | } |
171 | 171 | $now = wfTimestampNow(); |
172 | 172 | $d = $wgLang->date( $now, true ); |
173 | 173 | $t = $wgLang->time( $now, true ); |
174 | | - $dateLink = $sk->makeKnownLinkObj( $titleObj, htmlspecialchars( wfMsg( 'sp-newimages-showfrom', $d, $t ) ), |
175 | | - 'from='.$now.$botpar.$searchpar ); |
| 174 | + $query = array_merge( |
| 175 | + array( 'from' => $now ), |
| 176 | + $botpar, |
| 177 | + $searchpar |
| 178 | + ); |
176 | 179 | |
177 | | - $botLink = $sk->makeKnownLinkObj($titleObj, wfMsgHtml( 'showhidebots', |
178 | | - ($hidebots ? wfMsgHtml('show') : wfMsgHtml('hide'))),'hidebots='.($hidebots ? '0' : '1').$searchpar); |
| 180 | + $dateLink = $sk->linkKnown( |
| 181 | + $titleObj, |
| 182 | + htmlspecialchars( wfMsg( 'sp-newimages-showfrom', $d, $t ) ), |
| 183 | + array(), |
| 184 | + $query |
| 185 | + ); |
179 | 186 | |
| 187 | + $query = array_merge( |
| 188 | + array( 'hidebots' => ( $hidebots ? 0 : 1 ) ), |
| 189 | + $searchpar |
| 190 | + ); |
180 | 191 | |
| 192 | + $message = wfMsgHtml( |
| 193 | + 'showhidebots', |
| 194 | + ( $hidebots ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' ) ) |
| 195 | + ); |
| 196 | + |
| 197 | + $botLink = $sk->linkKnown( |
| 198 | + $titleObj, |
| 199 | + $message, |
| 200 | + array(), |
| 201 | + $query |
| 202 | + ); |
| 203 | + |
181 | 204 | $opts = array( 'parsemag', 'escapenoentities' ); |
182 | 205 | $prevLink = wfMsgExt( 'pager-newer-n', $opts, $wgLang->formatNum( $limit ) ); |
183 | 206 | if( $firstTimestamp && $firstTimestamp != $latestTimestamp ) { |
184 | | - $prevLink = $sk->makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar . $searchpar ); |
| 207 | + $query = array_merge( |
| 208 | + array( 'from' => $firstTimestamp ), |
| 209 | + $botpar, |
| 210 | + $searchpar |
| 211 | + ); |
| 212 | + |
| 213 | + $prevLink = $sk->linkKnown( |
| 214 | + $titleObj, |
| 215 | + $prevLink, |
| 216 | + array(), |
| 217 | + $query |
| 218 | + ); |
185 | 219 | } |
186 | 220 | |
187 | 221 | $nextLink = wfMsgExt( 'pager-older-n', $opts, $wgLang->formatNum( $limit ) ); |
188 | 222 | if( $shownImages > $limit && $lastTimestamp ) { |
189 | | - $nextLink = $sk->makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar.$searchpar ); |
| 223 | + $query = array_merge( |
| 224 | + array( 'until' => $lastTimestamp ), |
| 225 | + $botpar, |
| 226 | + $searchpar |
| 227 | + ); |
| 228 | + |
| 229 | + $nextLink = $sk->linkKnown( |
| 230 | + $titleObj, |
| 231 | + $nextLink, |
| 232 | + array(), |
| 233 | + $query |
| 234 | + ); |
| 235 | + |
190 | 236 | } |
191 | 237 | |
192 | 238 | $prevnext = '<p>' . $botLink . ' '. wfMsgHtml( 'viewprevnext', $prevLink, $nextLink, $dateLink ) .'</p>'; |