Index: trunk/phase3/includes/SpecialLog.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | | - * @todo document (needs one-sentence top-level class description) |
| 40 | + * |
41 | 41 | * @addtogroup SpecialPage |
42 | 42 | */ |
43 | 43 | class LogReader { |
— | — | @@ -128,7 +128,7 @@ |
129 | 129 | } |
130 | 130 | $this->title =& $title; |
131 | 131 | $this->pattern = $pattern; |
132 | | - $ns = intval( $title->getNamespace() ); |
| 132 | + $ns = $title->getNamespace(); |
133 | 133 | if ( $pattern && !$wgMiserMode ) { |
134 | 134 | $safetitle = $this->db->escapeLike( $title->getDBkey() ); // use escapeLike to avoid expensive search patterns like 't%st%' |
135 | 135 | $this->whereClauses[] = "log_namespace=$ns AND log_title LIKE '$safetitle%'"; |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |
222 | | - * @todo document (needs one-sentence top-level class description) |
| 222 | + * |
223 | 223 | * @addtogroup SpecialPage |
224 | 224 | */ |
225 | 225 | class LogViewer { |
— | — | @@ -347,12 +347,12 @@ |
348 | 348 | if ( $s->log_type == 'move' && isset( $paramArray[0] ) ) { |
349 | 349 | $destTitle = Title::newFromText( $paramArray[0] ); |
350 | 350 | if ( $destTitle ) { |
351 | | - $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ), |
| 351 | + $reviewlink = $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ), |
352 | 352 | wfMsg( 'revertmove' ), |
353 | 353 | 'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) . |
354 | 354 | '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) . |
355 | 355 | '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) . |
356 | | - '&wpMovetalk=0' ) . ')'; |
| 356 | + '&wpMovetalk=0' ); |
357 | 357 | } |
358 | 358 | // show undelete link |
359 | 359 | } elseif ( $s->log_action == 'delete' && $wgUser->isAllowed( 'delete' ) ) { |
— | — | @@ -401,28 +401,19 @@ |
402 | 402 | */ |
403 | 403 | function showOptions( &$out ) { |
404 | 404 | global $wgScript, $wgMiserMode; |
| 405 | + $action = htmlspecialchars( $wgScript ); |
405 | 406 | $title = SpecialPage::getTitleFor( 'Log' ); |
406 | | - $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
407 | | - $form .= Xml::hidden( 'title', $title->getPrefixedDBkey() ); |
408 | | - $form .= '<fieldset><legend>' . wfMsgHtml( 'log-search-legend' ) . '</legend>'; |
409 | | - $form .= '<table>'; |
410 | | - # Log selection |
411 | | - $form .= '<tr><td> </td><td>' . $this->getTypeMenu() . '</td></tr>'; |
412 | | - $form .= '<tr><td>' . Xml::label( wfMsg( 'specialloguserlabel' ), 'user' ) . '</td>'; |
413 | | - # User filter |
414 | | - $form .= '<td>' . Xml::input( 'user', 30, $this->reader->queryUser(), array( 'id' => 'user' ) ) . '</td></tr>'; |
415 | | - # Title filter |
416 | | - $form .= '<tr><td>' . Xml::label( wfMsg( 'speciallogtitlelabel' ), 'page' ) . '</td>'; |
417 | | - $form .= '<td>' . Xml::input( 'page', 30, $this->reader->queryTitle(), array( 'id' => 'page' ) ) . '</td></tr>'; |
418 | | - # Title "wildcard" checkbox (if enabled) |
419 | | - if( !$wgMiserMode ) { |
420 | | - $form .= '<tr><td> </td><td>' . Xml::checkLabel( wfMsg( 'log-title-wildcard' ), 'pattern', 'pattern', $this->reader->queryPattern() ) . '</td></tr>'; |
421 | | - } |
422 | | - $form .= '<tr><td> </td><td>' . Xml::submitButton( wfMsg( 'log-search-submit' ) ) . '</td></tr>'; |
423 | | - $form .= '</table>'; |
424 | | - $form .= '</fieldset>'; |
425 | | - $form .= '</form>'; |
426 | | - $out->addHtml( $form ); |
| 407 | + $special = htmlspecialchars( $title->getPrefixedDBkey() ); |
| 408 | + $out->addHTML( "<form action=\"$action\" method=\"get\">\n" . |
| 409 | + '<fieldset>' . |
| 410 | + Xml::element( 'legend', array(), wfMsg( 'log' ) ) . |
| 411 | + Xml::hidden( 'title', $special ) . "\n" . |
| 412 | + $this->getTypeMenu() . "\n" . |
| 413 | + $this->getUserInput() . "\n" . |
| 414 | + $this->getTitleInput() . "\n" . |
| 415 | + (!$wgMiserMode?($this->getTitlePattern()."\n"):"") . |
| 416 | + Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . |
| 417 | + "</fieldset></form>" ); |
427 | 418 | } |
428 | 419 | |
429 | 420 | /** |
— | — | @@ -455,6 +446,33 @@ |
456 | 447 | } |
457 | 448 | |
458 | 449 | /** |
| 450 | + * @return string Formatted HTML |
| 451 | + * @private |
| 452 | + */ |
| 453 | + function getUserInput() { |
| 454 | + $user = $this->reader->queryUser(); |
| 455 | + return Xml::inputLabel( wfMsg( 'specialloguserlabel' ), 'user', 'user', 12, $user ); |
| 456 | + } |
| 457 | + |
| 458 | + /** |
| 459 | + * @return string Formatted HTML |
| 460 | + * @private |
| 461 | + */ |
| 462 | + function getTitleInput() { |
| 463 | + $title = $this->reader->queryTitle(); |
| 464 | + return Xml::inputLabel( wfMsg( 'speciallogtitlelabel' ), 'page', 'page', 20, $title ); |
| 465 | + } |
| 466 | + |
| 467 | + /** |
| 468 | + * @return boolean Checkbox |
| 469 | + * @private |
| 470 | + */ |
| 471 | + function getTitlePattern() { |
| 472 | + $pattern = $this->reader->queryPattern(); |
| 473 | + return Xml::checkLabel( wfMsg( 'title-pattern' ), 'pattern', 'pattern', $pattern ); |
| 474 | + } |
| 475 | + |
| 476 | + /** |
459 | 477 | * @param OutputPage &$out where to send output |
460 | 478 | * @private |
461 | 479 | */ |