Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -267,6 +267,7 @@ |
268 | 268 | * Make Special:Listusers caseinsensitive for first letter |
269 | 269 | * Default tidy.conf has been moved from extensions module into includes. |
270 | 270 | * Ignore lonely ''''' |
| 271 | +* (bug 3984) Searching in logs by title% |
271 | 272 | |
272 | 273 | |
273 | 274 | == Languages updated == |
Index: trunk/phase3/languages/messages/MessagesDe.php |
— | — | @@ -880,7 +880,7 @@ |
881 | 881 | 'grouppage-bureaucrat' => '{{ns:project}}:Bürokraten', |
882 | 882 | |
883 | 883 | # User rights log |
884 | | -'rightslog' => 'Benutzerrechte-Logbuch', |
| 884 | +'rightslog' => 'Rechte-Logbuch', |
885 | 885 | 'rightslogtext' => 'Dies ist das Logbuch der Änderungen der Benutzerrechte.', |
886 | 886 | 'rightslogentry' => 'änderte die Gruppenzugehörigkeit für „[[$1]]“ von „$2“ auf „$3“.', |
887 | 887 | 'rightsnone' => '(-)', |
— | — | @@ -1178,10 +1178,18 @@ |
1179 | 1179 | 'isbn' => 'ISBN', |
1180 | 1180 | 'alphaindexline' => '$1 bis $2', |
1181 | 1181 | 'version' => 'Version', |
1182 | | -'log' => 'Logbücher', |
1183 | | -'alllogstext' => 'Kombinierte Anzeige der Datei-, Lösch-, Seitenschutz-, Benutzersperr- und Rechte-Logbücher.<br />Sie können die Anzeige durch die Auswahl des Logbuchtyps, des Benutzers oder des Seitentitels einschränken.', |
1184 | | -'logempty' => 'Keine passenden Einträge.', |
1185 | 1182 | |
| 1183 | +# Special:Logs |
| 1184 | +'specialloguserlabel' => 'Benutzer:', |
| 1185 | +'speciallogtitlelabel' => 'Titel:', |
| 1186 | +'log' => 'Logbücher', |
| 1187 | +'alllogstext' => "Dies ist die kombinierte Anzeige aller in {{SITENAME}} geführten Logbücher. |
| 1188 | +Die Ausgabe kann durch die Auswahl des Logbuchtyps, des Benutzers oder des Seitentitels eingeschränkt werden. |
| 1189 | + |
| 1190 | +Durch Markieren von „{{int:title-pattern}}“ wird nach Titeln gesucht, die mit diesem Begriff anfangen und beliebig enden. Es können keine Platzhalter ''(Wildcards)'' benutzt werden", |
| 1191 | +'logempty' => 'Keine passenden Einträge.', |
| 1192 | +'title-pattern' => 'Titel beginnt mit …', |
| 1193 | + |
1186 | 1194 | # Special:Allpages |
1187 | 1195 | 'nextpage' => 'Nächste Seite ($1)', |
1188 | 1196 | 'prevpage' => 'Vorherige Seite ($1)', |
— | — | @@ -1809,10 +1817,6 @@ |
1810 | 1818 | 'variantname-kk-cn' => 'kk-cn', |
1811 | 1819 | 'variantname-kk' => 'kk', |
1812 | 1820 | |
1813 | | -# Labels for User: and Title: on Special:Log pages |
1814 | | -'specialloguserlabel' => 'Benutzer:', |
1815 | | -'speciallogtitlelabel' => 'Titel:', |
1816 | | - |
1817 | 1821 | 'passwordtooshort' => 'Das Passwort ist zu kurz. Es muss mindestens $1 Zeichen lang sein.', |
1818 | 1822 | |
1819 | 1823 | # Metadata |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1575,12 +1575,16 @@ |
1576 | 1576 | 'pubmedurl' => 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=$1', |
1577 | 1577 | 'alphaindexline' => "$1 to $2", |
1578 | 1578 | 'version' => 'Version', |
1579 | | -'log' => 'Logs', |
1580 | | -'alllogstext' => 'Combined display of upload, deletion, protection, blocking, and sysop logs. |
| 1579 | + |
| 1580 | +# Special:Logs |
| 1581 | +'specialloguserlabel' => 'Benutzer:', |
| 1582 | +'speciallogtitlelabel' => 'Titel:', |
| 1583 | +'log' => 'Logs', |
| 1584 | +'alllogstext' => 'Combined display of all available logs of {{SITENAME}}. |
1581 | 1585 | You can narrow down the view by selecting a log type, the user name, or the affected page.', |
1582 | | -'logempty' => 'No matching items in log.', |
| 1586 | +'logempty' => 'No matching items in log.', |
| 1587 | +'title-pattern' => 'Title starts with �', |
1583 | 1588 | |
1584 | | - |
1585 | 1589 | # Special:Allpages |
1586 | 1590 | 'nextpage' => 'Next page ($1)', |
1587 | 1591 | 'prevpage' => 'Previous page ($1)', |
— | — | @@ -2327,10 +2331,6 @@ |
2328 | 2332 | 'variantname-kk-cn' => 'kk-cn', |
2329 | 2333 | 'variantname-kk' => 'kk', |
2330 | 2334 | |
2331 | | -# labels for User: and Title: on Special:Log pages |
2332 | | -'specialloguserlabel' => 'User:', |
2333 | | -'speciallogtitlelabel' => 'Title:', |
2334 | | - |
2335 | 2335 | 'passwordtooshort' => 'Your password is too short. It must have at least $1 characters.', |
2336 | 2336 | |
2337 | 2337 | # Metadata |
Index: trunk/phase3/includes/SpecialLog.php |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | |
68 | 68 | $this->limitType( $request->getVal( 'type' ) ); |
69 | 69 | $this->limitUser( $request->getText( 'user' ) ); |
70 | | - $this->limitTitle( $request->getText( 'page' ) ); |
| 70 | + $this->limitTitle( $request->getText( 'page' ) , $request->getBool( 'pattern' ) ); |
71 | 71 | $this->limitTime( $request->getVal( 'from' ), '>=' ); |
72 | 72 | $this->limitTime( $request->getVal( 'until' ), '<=' ); |
73 | 73 | |
— | — | @@ -116,15 +116,21 @@ |
117 | 117 | * @param string $page Title name as text |
118 | 118 | * @private |
119 | 119 | */ |
120 | | - function limitTitle( $page ) { |
| 120 | + function limitTitle( $page , $pattern ) { |
121 | 121 | $title = Title::newFromText( $page ); |
122 | 122 | if( empty( $page ) || is_null( $title ) ) { |
123 | 123 | return false; |
124 | 124 | } |
125 | 125 | $this->title =& $title; |
126 | | - $safetitle = $this->db->strencode( $title->getDBkey() ); |
| 126 | + $this->pattern = $pattern; |
127 | 127 | $ns = $title->getNamespace(); |
128 | | - $this->whereClauses[] = "log_namespace=$ns AND log_title='$safetitle'"; |
| 128 | + if ( $pattern ) { |
| 129 | + $safetitle = $this->db->escapeLike( $title->getDBkey() ); // use escapeLike to avoid expensive search patterns like 't%st%' |
| 130 | + $this->whereClauses[] = "log_namespace=$ns AND log_title LIKE '$safetitle%'"; |
| 131 | + } else { |
| 132 | + $safetitle = $this->db->strencode( $title->getDBkey() ); |
| 133 | + $this->whereClauses[] = "log_namespace=$ns AND log_title = '$safetitle'"; |
| 134 | + } |
129 | 135 | } |
130 | 136 | |
131 | 137 | /** |
— | — | @@ -188,6 +194,13 @@ |
189 | 195 | } |
190 | 196 | |
191 | 197 | /** |
| 198 | + * @return boolean The checkbox, if titles should be searched by a pattern too |
| 199 | + */ |
| 200 | + function queryPattern() { |
| 201 | + return $this->pattern; |
| 202 | + } |
| 203 | + |
| 204 | + /** |
192 | 205 | * @return string The text of the title that this LogReader has been limited to. |
193 | 206 | */ |
194 | 207 | function queryTitle() { |
— | — | @@ -227,9 +240,13 @@ |
228 | 241 | $this->showHeader( $wgOut ); |
229 | 242 | $this->showOptions( $wgOut ); |
230 | 243 | $result = $this->getLogRows(); |
231 | | - $this->showPrevNext( $wgOut ); |
232 | | - $this->doShowList( $wgOut, $result ); |
233 | | - $this->showPrevNext( $wgOut ); |
| 244 | + if ( $this->numResults > 0 ) { |
| 245 | + $this->showPrevNext( $wgOut ); |
| 246 | + $this->doShowList( $wgOut, $result ); |
| 247 | + $this->showPrevNext( $wgOut ); |
| 248 | + } else { |
| 249 | + $this->showError( $wgOut ); |
| 250 | + } |
234 | 251 | } |
235 | 252 | |
236 | 253 | /** |
— | — | @@ -278,20 +295,20 @@ |
279 | 296 | |
280 | 297 | function doShowList( &$out, $result ) { |
281 | 298 | // Rewind result pointer and go through it again, making the HTML |
282 | | - if ($this->numResults > 0) { |
283 | | - $html = "\n<ul>\n"; |
284 | | - $result->seek( 0 ); |
285 | | - while( $s = $result->fetchObject() ) { |
286 | | - $html .= $this->logLine( $s ); |
287 | | - } |
288 | | - $html .= "\n</ul>\n"; |
289 | | - $out->addHTML( $html ); |
290 | | - } else { |
291 | | - $out->addWikiText( wfMsg( 'logempty' ) ); |
| 299 | + $html = "\n<ul>\n"; |
| 300 | + $result->seek( 0 ); |
| 301 | + while( $s = $result->fetchObject() ) { |
| 302 | + $html .= $this->logLine( $s ); |
292 | 303 | } |
| 304 | + $html .= "\n</ul>\n"; |
| 305 | + $out->addHTML( $html ); |
293 | 306 | $result->free(); |
294 | 307 | } |
295 | 308 | |
| 309 | + function showError( &$out ) { |
| 310 | + $out->addWikiText( wfMsg( 'logempty' ) ); |
| 311 | + } |
| 312 | + |
296 | 313 | /** |
297 | 314 | * @param Object $s a single row from the result set |
298 | 315 | * @return string Formatted HTML list item |
— | — | @@ -372,12 +389,15 @@ |
373 | 390 | $title = SpecialPage::getTitleFor( 'Log' ); |
374 | 391 | $special = htmlspecialchars( $title->getPrefixedDBkey() ); |
375 | 392 | $out->addHTML( "<form action=\"$action\" method=\"get\">\n" . |
| 393 | + '<fieldset>' . |
| 394 | + Xml::element( 'legend', array(), wfMsg( 'log' ) ) . |
376 | 395 | Xml::hidden( 'title', $special ) . "\n" . |
377 | 396 | $this->getTypeMenu() . "\n" . |
378 | 397 | $this->getUserInput() . "\n" . |
379 | 398 | $this->getTitleInput() . "\n" . |
| 399 | + $this->getTitlePattern() . "\n" . |
380 | 400 | Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . |
381 | | - "</form>" ); |
| 401 | + "</fieldset></form>" ); |
382 | 402 | } |
383 | 403 | |
384 | 404 | /** |
— | — | @@ -428,6 +448,15 @@ |
429 | 449 | } |
430 | 450 | |
431 | 451 | /** |
| 452 | + * @return boolean Checkbox |
| 453 | + * @private |
| 454 | + */ |
| 455 | + function getTitlePattern() { |
| 456 | + $pattern = $this->reader->queryPattern(); |
| 457 | + return Xml::checkLabel( wfMsg( 'title-pattern' ), 'pattern', 'pattern', $pattern ); |
| 458 | + } |
| 459 | + |
| 460 | + /** |
432 | 461 | * @param OutputPage &$out where to send output |
433 | 462 | * @private |
434 | 463 | */ |
— | — | @@ -437,6 +466,7 @@ |
438 | 467 | $pieces[] = 'type=' . urlencode( $this->reader->queryType() ); |
439 | 468 | $pieces[] = 'user=' . urlencode( $this->reader->queryUser() ); |
440 | 469 | $pieces[] = 'page=' . urlencode( $this->reader->queryTitle() ); |
| 470 | + $pieces[] = 'pattern=' . urlencode( $this->reader->queryPattern() ); |
441 | 471 | $bits = implode( '&', $pieces ); |
442 | 472 | list( $limit, $offset ) = $wgRequest->getLimitOffset(); |
443 | 473 | |
Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -976,9 +976,14 @@ |
977 | 977 | 'pubmedurl', |
978 | 978 | 'alphaindexline', |
979 | 979 | 'version', |
| 980 | + ), |
| 981 | + 'logpages' => array( |
980 | 982 | 'log', |
981 | 983 | 'alllogstext', |
982 | 984 | 'logempty', |
| 985 | + 'specialloguserlabel', |
| 986 | + 'speciallogtitlelabel', |
| 987 | + 'title-pattern', |
983 | 988 | ), |
984 | 989 | 'allpages' => array( |
985 | 990 | 'nextpage', |
— | — | @@ -1597,10 +1602,6 @@ |
1598 | 1603 | 'variantname-kk-cn', |
1599 | 1604 | 'variantname-kk', |
1600 | 1605 | ), |
1601 | | - 'specialloglabels' => array( |
1602 | | - 'specialloguserlabel', |
1603 | | - 'speciallogtitlelabel', |
1604 | | - ), |
1605 | 1606 | 'passwordtooshort' => array( |
1606 | 1607 | 'passwordtooshort', |
1607 | 1608 | ), |
— | — | @@ -2099,6 +2100,7 @@ |
2100 | 2101 | 'specialpages' => 'Miscellaneous special pages', |
2101 | 2102 | 'booksources' => 'Book sources', |
2102 | 2103 | 'specialpages2' => '', |
| 2104 | + 'logpages' => 'Special:Logs', |
2103 | 2105 | 'allpages' => 'Special:Allpages', |
2104 | 2106 | 'listusers' => 'Special:Listusers', |
2105 | 2107 | 'emailuser' => 'E-mail user', |
— | — | @@ -2142,7 +2144,6 @@ |
2143 | 2145 | Variants for Chinese language", |
2144 | 2146 | 'variantname-sr' => 'Variants for Serbian language', |
2145 | 2147 | 'variantname-kk' => 'Variants for Kazakh language', |
2146 | | - 'specialloglabels' => 'Labels for User: and Title: on Special:Log pages', |
2147 | 2148 | 'passwordtooshort' => '', |
2148 | 2149 | 'media-info' => 'Media information', |
2149 | 2150 | 'metadata' => 'Metadata', |