// Check permissions
$this->checkPermissions();
+ $request = $this->getRequest();
+ $opts = $this->getOptions();
+
+ $mode = SpecialEditWatchlist::getMode( $request, $par );
+ if ( $mode !== false ) {
+ if ( $mode === SpecialEditWatchlist::EDIT_RAW ) {
+ $title = SpecialPage::getTitleFor( 'EditWatchlist', 'raw' );
+ } else {
+ $title = SpecialPage::getTitleFor( 'EditWatchlist' );
+ }
+
+ $output->redirect( $title->getLocalURL() );
+ return;
+ }
+
+ if ( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $request->getVal( 'reset' ) &&
+ $request->wasPosted() )
+ {
+ $user->clearAllNotifications();
+ $output->redirect( $this->getPageTitle()->getFullURL( $opts->getChangedValues() ) );
+ return;
+ }
+
+ $this->setHeaders();
+ $this->outputHeader();
+
// Add feed links
$wlToken = $user->getTokenFromOption( 'watchlisttoken' );
if ( $wlToken ) {
) );
}
- $opts = $this->getOptions();
- $this->setHeaders();
- $this->outputHeader();
-
$output->addSubtitle(
$this->msg( 'watchlistfor2', $user->getName() )
->rawParams( SpecialEditWatchlist::buildTools( null ) )
);
- $request = $this->getRequest();
-
- $mode = SpecialEditWatchlist::getMode( $request, $par );
- if ( $mode !== false ) {
- if ( $mode === SpecialEditWatchlist::EDIT_RAW ) {
- $title = SpecialPage::getTitleFor( 'EditWatchlist', 'raw' );
- } else {
- $title = SpecialPage::getTitleFor( 'EditWatchlist' );
- }
+ $dbr = wfGetDB( DB_SLAVE, 'watchlist' );
- $output->redirect( $title->getLocalURL() );
- return;
+ # Show a message about slave lag, if applicable
+ $lag = wfGetLB()->safeGetLag( $dbr );
+ if ( $lag > 0 ) {
+ $output->showLagWarning( $lag );
}
- $dbr = wfGetDB( DB_SLAVE, 'watchlist' );
-
$nitems = $this->countItems( $dbr );
if ( $nitems == 0 ) {
$output->addWikiMsg( 'nowatchlist' );
$nameSpaceClause = '';
}
- // Dump everything here
- $nondefaults = $opts->getChangedValues();
-
- if ( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $request->getVal( 'reset' )
- && $request->wasPosted()
- ) {
- $user->clearAllNotifications();
- $output->redirect( $this->getPageTitle()->getFullURL( $nondefaults ) );
- return;
- }
-
# Possible where conditions
$conds = array();
$usePage = true;
}
- # Show a message about slave lag, if applicable
- $lag = wfGetLB()->safeGetLag( $dbr );
- if ( $lag > 0 ) {
- $output->showLagWarning( $lag );
- }
-
- # Create output
- $form = '';
-
- # Show watchlist header
- $form .= "<p>";
- $form .= $this->msg( 'watchlist-details' )->numParams( $nitems )->parse() . "\n";
- if ( $wgEnotifWatchlist && $user->getOption( 'enotifwatchlistpages' ) ) {
- $form .= $this->msg( 'wlheader-enotif' )->parse() . "\n";
- }
- if ( $wgShowUpdatedMarker ) {
- $form .= $this->msg( 'wlheader-showupdated' )->parse() . "\n";
- }
- $form .= "</p>";
-
- if ( $wgShowUpdatedMarker ) {
- $form .= Xml::openElement( 'form', array( 'method' => 'post',
- 'action' => $this->getPageTitle()->getLocalURL(),
- 'id' => 'mw-watchlist-resetbutton' ) ) . "\n" .
- Xml::submitButton( $this->msg( 'enotif_reset' )->text(), array( 'name' => 'dummy' ) ) . "\n" .
- Html::hidden( 'reset', 'all' ) . "\n";
- foreach ( $nondefaults as $key => $value ) {
- $form .= Html::hidden( $key, $value ) . "\n";
- }
- $form .= Xml::closeElement( 'form' ) . "\n";
- }
-
- $form .= Xml::openElement( 'form', array(
- 'method' => 'post',
- 'action' => $this->getPageTitle()->getLocalURL(),
- 'id' => 'mw-watchlist-form'
- ) );
- $form .= Xml::fieldset(
- $this->msg( 'watchlist-options' )->text(),
- false,
- array( 'id' => 'mw-watchlist-options' )
- );
-
- $form .= SpecialRecentChanges::makeLegend( $this->getContext() );
-
$tables = array( 'recentchanges', 'watchlist' );
$fields = RecentChange::selectFields();
$join_conds = array(
$lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user ) )->parse() . "<br />\n";
}
+ $nondefaults = $opts->getChangedValues();
$cutofflinks = $this->cutoffLinks( $opts['days'], $nondefaults ) . "<br />\n";
# Spit out some control panel links
unset( $hiddenFields['invert'] );
unset( $hiddenFields['associated'] );
+ # Create output
+ $form = '';
+
+ # Show watchlist header
+ $form .= "<p>";
+ $form .= $this->msg( 'watchlist-details' )->numParams( $nitems )->parse() . "\n";
+ if ( $wgEnotifWatchlist && $user->getOption( 'enotifwatchlistpages' ) ) {
+ $form .= $this->msg( 'wlheader-enotif' )->parse() . "\n";
+ }
+ if ( $wgShowUpdatedMarker ) {
+ $form .= $this->msg( 'wlheader-showupdated' )->parse() . "\n";
+ }
+ $form .= "</p>";
+
+ if ( $wgShowUpdatedMarker ) {
+ $form .= Xml::openElement( 'form', array( 'method' => 'post',
+ 'action' => $this->getPageTitle()->getLocalURL(),
+ 'id' => 'mw-watchlist-resetbutton' ) ) . "\n" .
+ Xml::submitButton( $this->msg( 'enotif_reset' )->text(), array( 'name' => 'dummy' ) ) . "\n" .
+ Html::hidden( 'reset', 'all' ) . "\n";
+ foreach ( $nondefaults as $key => $value ) {
+ $form .= Html::hidden( $key, $value ) . "\n";
+ }
+ $form .= Xml::closeElement( 'form' ) . "\n";
+ }
+
+ $form .= Xml::openElement( 'form', array(
+ 'method' => 'post',
+ 'action' => $this->getPageTitle()->getLocalURL(),
+ 'id' => 'mw-watchlist-form'
+ ) );
+ $form .= Xml::fieldset(
+ $this->msg( 'watchlist-options' )->text(),
+ false,
+ array( 'id' => 'mw-watchlist-options' )
+ );
+
+ $form .= SpecialRecentChanges::makeLegend( $this->getContext() );
+
# Namespace filter and put the whole form together.
$form .= $wlInfo;
$form .= $cutofflinks;