<?php
/**
+ * Implements Special:Watchlist
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
* @file
* @ingroup SpecialPage Watchlist
*/
$wgUser->saveSettings();
}
- global $wgServer, $wgScriptPath, $wgFeedClasses;
+ global $wgFeedClasses;
$apiParams = array( 'action' => 'feedwatchlist', 'allrev' => 'allrev',
'wlowner' => $wgUser->getName(), 'wltoken' => $wlToken );
$feedTemplate = wfScript('api').'?';
$wgOut->setPageTitle( wfMsg( 'watchlist' ) );
- $sub = wfMsgExt( 'watchlistfor', 'parseinline', $wgUser->getName() );
- $sub .= '<br />' . WatchlistEditor::buildTools( $wgUser->getSkin() );
+ $sub = wfMsgExt( 'watchlistfor2', array( 'parseinline', 'replaceafter' ), $wgUser->getName(), WatchlistEditor::buildTools( $wgUser->getSkin() ) );
$wgOut->setSubtitle( $sub );
if( ( $mode = WatchlistEditor::getMode( $wgRequest, $par ) ) !== false ) {
if ( $wgUser->useRCPatrol() && $hidePatrolled ) {
$conds[] = 'rc_patrolled != 1';
}
+ if( $nameSpaceClause ) {
+ $conds[] = $nameSpaceClause;
+ }
# Toggle watchlist content (all recent edits or just the latest)
if( $wgUser->getOption( 'extendwatchlist' )) {
$form .= $wgLang->pipeList( $links );
$form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $thisTitle->getLocalUrl(), 'id' => 'mw-watchlist-form-namespaceselector' ) );
$form .= '<hr /><p>';
- $form .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ';
- $form .= Xml::namespaceSelector( $nameSpace, '' ) . ' ';
- $form .= Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $invert ) . ' ';
+ $form .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ';
+ $form .= Xml::namespaceSelector( $nameSpace, '' ) . ' ';
+ $form .= Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $invert ) . ' ';
$form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '</p>';
$form .= Xml::hidden( 'days', $days );
if( $hideMinor )
$form .= Xml::closeElement( 'fieldset' );
$wgOut->addHTML( $form );
- $wgOut->addHTML( ChangesList::flagLegend() );
-
# If there's nothing to show, stop here
if( $numRows == 0 ) {
$wgOut->addWikiMsg( 'watchnochange' );
}
$s .= $list->endRecentChangesList();
- $dbr->freeResult( $res );
$wgOut->addHTML( $s );
}
/**
* Count the number of items on a user's watchlist
*
- * @param $talk Include talk pages
- * @return integer
+ * @param $user User object
+ * @param $talk Boolean: include talk pages
+ * @return Integer
*/
function wlCountItems( &$user, $talk = true ) {
$dbr = wfGetDB( DB_SLAVE, 'watchlist' );
array( 'wl_user' => $user->mId ), 'wlCountItems' );
$row = $dbr->fetchObject( $res );
$count = $row->count;
- $dbr->freeResult( $res );
# Halve to remove talk pages if needed
if( !$talk )