From 2804d9a0a09657da67fde9f34ddea6d350e9cada Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 11 Jul 2006 12:37:43 +0000 Subject: [PATCH] Use Xml functions --- includes/SpecialWatchlist.php | 48 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index 5b1e2890d3..867d5938ed 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -235,9 +235,8 @@ function wfSpecialWatchlist( $par ) { $wgOut->addHTML( '' ); } $wgOut->addHTML( - "\n" . - "\n" + wfSubmitButton( htmlspecialchars( wfMsg('removechecked') ), array('name' => 'remove') ) . + "\n\n" ); return; @@ -313,14 +312,15 @@ function wfSpecialWatchlist( $par ) { $numRows = $dbr->numRows( $res ); /* Start bottom header */ - $wgOut->addHTML( "
\n

" ); + $wgOut->addHTML( "


\n" ); - if($days >= 1) + if($days >= 1) { $wgOut->addWikiText( wfMsg( 'rcnote', $wgLang->formatNum( $numRows ), $wgLang->formatNum( $days ), $wgLang->timeAndDate( wfTimestampNow(), true ) ) . '
' , false ); - elseif($days > 0) + } elseif($days > 0) { $wgOut->addWikiText( wfMsg( 'wlnote', $wgLang->formatNum( $numRows ), $wgLang->formatNum( round($days*24) ) ) . '
' , false ); + } $wgOut->addHTML( "\n" . wlCutoffLinks( $days, 'Watchlist', $nondefaults ) . "
\n" ); @@ -343,24 +343,27 @@ function wfSpecialWatchlist( $par ) { $wgOut->addHTML( implode( ' | ', $links ) ); # Form for namespace filtering - $thisAction = $thisTitle->escapeLocalUrl(); - $nsForm = "
\n"; - $nsForm .= " "; - $nsForm .= HTMLnamespaceselector( $nameSpace, '' ) . "\n"; - $nsForm .= ( $hideOwn ? "\n" : "" ); - $nsForm .= ( $hideBots ? "\n" : "" ); - $nsForm .= "\n"; - $nsForm .= "\n"; - $nsForm .= "
\n"; - $wgOut->addHTML( $nsForm ); + $wgOut->addHTML( + wfOpenElement( 'form', array( + 'method' => 'post', + 'action' => $thisTitle->escapeLocalUrl(), + ) ) . + wfLabel( + wfMsgExt( 'namespace', array( 'parseinline') ), + 'namespace' ) . + HTMLnamespaceselector( $nameSpace, '' ) . "\n" . + ( $hideOwn ? wfHidden('hideown', 1)."\n" : '' ) . + ( $hideBots ? wfHidden('hidebots', 1)."\n" : '' ) . + wfHidden( 'days', $days ) . "\n" . + wfSubmitButton( wfMsgExt( 'allpagessubmit', array( 'escape') ) ) . "\n" . + wfCloseElement( 'form' ) . "\n" + ); if ( $numRows == 0 ) { $wgOut->addWikitext( "
" . wfMsg( 'watchnochange' ), false ); - $wgOut->addHTML( "

\n" ); return; } - $wgOut->addHTML( "

\n" ); /* End bottom header */ $list = ChangesList::newFromUser( $wgUser ); @@ -494,9 +497,11 @@ function wlHandleClear( &$out, &$request, $par ) { $out->addHTML( wfElement( 'form', array( 'method' => 'post', 'action' => $wlTitle->getLocalUrl( 'action=clear' ) ), NULL ) ); $out->addWikiText( wfMsg( 'watchlistcount', $count ) ); $out->addWikiText( wfMsg( 'watchlistcleartext' ) ); - $out->addHTML( wfElement( 'input', array( 'type' => 'hidden', 'name' => 'token', 'value' => $wgUser->editToken( 'clearwatchlist' ) ), '' ) ); - $out->addHTML( wfElement( 'input', array( 'type' => 'submit', 'name' => 'submit', 'value' => wfMsgHtml( 'watchlistclearbutton' ) ), '' ) ); - $out->addHTML( wfCloseElement( 'form' ) ); + $out->addHTML( + wfElement( 'input', array( 'type' => 'hidden', 'name' => 'token', 'value' => $wgUser->editToken( 'clearwatchlist' ) ), '' ) . + wfElement( 'input', array( 'type' => 'submit', 'name' => 'submit', 'value' => wfMsgHtml( 'watchlistclearbutton' ) ), '' ) . + wfCloseElement( 'form' ) + ); } return( true ); } else { @@ -509,5 +514,4 @@ function wlHandleClear( &$out, &$request, $par ) { return( false ); } } - ?> -- 2.20.1