summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialWatchlist.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/specials/SpecialWatchlist.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/specials/SpecialWatchlist.php')
-rw-r--r--includes/specials/SpecialWatchlist.php93
1 files changed, 36 insertions, 57 deletions
diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php
index fd562be4..fef54911 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -40,6 +40,20 @@ class SpecialWatchlist extends SpecialPage {
$user = $this->getUser();
$output = $this->getOutput();
+ # Anons don't get a watchlist
+ if( $user->isAnon() ) {
+ $output->setPageTitle( $this->msg( 'watchnologin' ) );
+ $output->setRobotPolicy( 'noindex,nofollow' );
+ $llink = Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Userlogin' ),
+ $this->msg( 'loginreqlink' )->escaped(),
+ array(),
+ array( 'returnto' => $this->getTitle()->getPrefixedText() )
+ );
+ $output->addHTML( $this->msg( 'watchlistanontext' )->rawParams( $llink )->parse() );
+ return;
+ }
+
// Add feed links
$wlToken = $user->getOption( 'watchlisttoken' );
if ( !$wlToken ) {
@@ -51,31 +65,11 @@ class SpecialWatchlist extends SpecialPage {
$this->addFeedLinks( array( 'action' => 'feedwatchlist', 'allrev' => 'allrev',
'wlowner' => $user->getName(), 'wltoken' => $wlToken ) );
- $output->setRobotPolicy( 'noindex,nofollow' );
-
- # Anons don't get a watchlist
- if( $user->isAnon() ) {
- $output->setPageTitle( wfMsg( 'watchnologin' ) );
- $llink = Linker::linkKnown(
- SpecialPage::getTitleFor( 'Userlogin' ),
- wfMsgHtml( 'loginreqlink' ),
- array(),
- array( 'returnto' => $this->getTitle()->getPrefixedText() )
- );
- $output->addHTML( wfMessage( 'watchlistanontext' )->rawParams( $llink )->parse() );
- return;
- }
-
$this->setHeaders();
$this->outputHeader();
- $sub = wfMsgExt(
- 'watchlistfor2',
- array( 'parseinline', 'replaceafter' ),
- $user->getName(),
- SpecialEditWatchlist::buildTools( $this->getSkin() )
- );
- $output->setSubtitle( $sub );
+ $output->addSubtitle( $this->msg( 'watchlistfor2', $user->getName()
+ )->rawParams( SpecialEditWatchlist::buildTools( null ) ) );
$request = $this->getRequest();
@@ -245,23 +239,21 @@ class SpecialWatchlist extends SpecialPage {
$output->showLagWarning( $lag );
}
- $lang = $this->getLang();
-
# Create output form
- $form = Xml::fieldset( wfMsg( 'watchlist-options' ), false, array( 'id' => 'mw-watchlist-options' ) );
+ $form = Xml::fieldset( $this->msg( 'watchlist-options' )->text(), false, array( 'id' => 'mw-watchlist-options' ) );
# Show watchlist header
- $form .= wfMsgExt( 'watchlist-details', array( 'parseinline' ), $lang->formatNum( $nitems ) );
+ $form .= $this->msg( 'watchlist-details' )->numParams( $nitems )->parse();
if( $user->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist) {
- $form .= wfMsgExt( 'wlheader-enotif', 'parse' ) . "\n";
+ $form .= $this->msg( 'wlheader-enotif' )->parseAsBlock() . "\n";
}
if( $wgShowUpdatedMarker ) {
$form .= Xml::openElement( 'form', array( 'method' => 'post',
'action' => $this->getTitle()->getLocalUrl(),
'id' => 'mw-watchlist-resetbutton' ) ) .
- wfMsgExt( 'wlheader-showupdated', array( 'parseinline' ) ) . ' ' .
- Xml::submitButton( wfMsg( 'enotif_reset' ), array( 'name' => 'dummy' ) ) .
+ $this->msg( 'wlheader-showupdated' )->parse() . ' ' .
+ Xml::submitButton( $this->msg( 'enotif_reset' )->text(), array( 'name' => 'dummy' ) ) .
Html::hidden( 'reset', 'all' ) .
Xml::closeElement( 'form' );
}
@@ -297,21 +289,12 @@ class SpecialWatchlist extends SpecialPage {
/* Start bottom header */
+ $lang = $this->getLanguage();
$wlInfo = '';
- if( $values['days'] >= 1 ) {
+ if( $values['days'] > 0 ) {
$timestamp = wfTimestampNow();
- $wlInfo = wfMsgExt( 'rcnote', 'parseinline',
- $lang->formatNum( $numRows ),
- $lang->formatNum( $values['days'] ),
- $lang->timeAndDate( $timestamp, true ),
- $lang->date( $timestamp, true ),
- $lang->time( $timestamp, true )
- ) . '<br />';
- } elseif( $values['days'] > 0 ) {
- $wlInfo = wfMsgExt( 'wlnote', 'parseinline',
- $lang->formatNum( $numRows ),
- $lang->formatNum( round( $values['days'] * 24 ) )
- ) . '<br />';
+ $wlInfo = $this->msg( 'wlnote' )->numParams( $numRows, round( $values['days'] * 24 ) )->params(
+ $lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user ) )->parse() . '<br />';
}
$cutofflinks = "\n" . $this->cutoffLinks( $values['days'], $nondefaults ) . "<br />\n";
@@ -344,10 +327,10 @@ class SpecialWatchlist extends SpecialPage {
$form .= $lang->pipeList( $links );
$form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'mw-watchlist-form-namespaceselector' ) );
$form .= '<hr /><p>';
- $form .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '&#160;';
+ $form .= Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . '&#160;';
$form .= Xml::namespaceSelector( $nameSpace, '' ) . '&#160;';
- $form .= Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $invert ) . '&#160;';
- $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '</p>';
+ $form .= Xml::checkLabel( $this->msg( 'invert' )->text(), 'invert', 'nsinvert', $invert ) . '&#160;';
+ $form .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . '</p>';
$form .= Html::hidden( 'days', $values['days'] );
foreach ( $filters as $key => $msg ) {
if ( $values[$key] ) {
@@ -416,13 +399,10 @@ class SpecialWatchlist extends SpecialPage {
}
protected function showHideLink( $options, $message, $name, $value ) {
- $showLinktext = wfMsgHtml( 'show' );
- $hideLinktext = wfMsgHtml( 'hide' );
-
- $label = $value ? $showLinktext : $hideLinktext;
+ $label = $this->msg( $value ? 'show' : 'hide' )->escaped();
$options[$name] = 1 - (int) $value;
- return wfMsgHtml( $message, Linker::linkKnown( $this->getTitle(), $label, array(), $options ) );
+ return $this->msg( $message )->rawParams( Linker::linkKnown( $this->getTitle(), $label, array(), $options ) )->escaped();
}
protected function hoursLink( $h, $options = array() ) {
@@ -430,7 +410,7 @@ class SpecialWatchlist extends SpecialPage {
return Linker::linkKnown(
$this->getTitle(),
- $this->getLang()->formatNum( $h ),
+ $this->getLanguage()->formatNum( $h ),
array(),
$options
);
@@ -438,7 +418,7 @@ class SpecialWatchlist extends SpecialPage {
protected function daysLink( $d, $options = array() ) {
$options['days'] = $d;
- $message = ( $d ? $this->getLang()->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) );
+ $message = ( $d ? $this->getLanguage()->formatNum( $d ) : $this->msg( 'watchlistall2' )->escaped() );
return Linker::linkKnown(
$this->getTitle(),
@@ -464,11 +444,10 @@ class SpecialWatchlist extends SpecialPage {
foreach( $days as $d ) {
$days[$i++] = $this->daysLink( $d, $options );
}
- return wfMsgExt('wlshowlast',
- array('parseinline', 'replaceafter'),
- $this->getLang()->pipeList( $hours ),
- $this->getLang()->pipeList( $days ),
- $this->daysLink( 0, $options ) );
+ return $this->msg( 'wlshowlast' )->rawParams(
+ $this->getLanguage()->pipeList( $hours ),
+ $this->getLanguage()->pipeList( $days ),
+ $this->daysLink( 0, $options ) )->parse();
}
/**