X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=8f2f86b92a3753c70404a298cb23f21eb1a02114;hb=1aad5d4bf7c0bb72fc59de00a6c8998f37abde4b;hp=b1fbdea98e7fc242858d556fcdedbd927e7094b5;hpb=825f0701d8096bbc926ec6c2d0027f0100a398e9;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php
index b1fbdea98e..8f2f86b92a 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -38,8 +38,6 @@ class SpecialWatchlist extends ChangesListSpecialPage {
* @param string $subpage
*/
function execute( $subpage ) {
- global $wgEnotifWatchlist, $wgShowUpdatedMarker;
-
// Anons don't get a watchlist
$this->requireLogin( 'watchlistanontext' );
@@ -66,7 +64,8 @@ class SpecialWatchlist extends ChangesListSpecialPage {
$user = $this->getUser();
$opts = $this->getOptions();
- if ( ( $wgEnotifWatchlist || $wgShowUpdatedMarker )
+ $config = $this->getConfig();
+ if ( ( $config->get( 'EnotifWatchlist' ) || $config->get( 'ShowUpdatedMarker' ) )
&& $request->getVal( 'reset' )
&& $request->wasPosted()
) {
@@ -198,8 +197,6 @@ class SpecialWatchlist extends ChangesListSpecialPage {
* @return bool|ResultWrapper Result or false (for Recentchangeslinked only)
*/
public function doMainQuery( $conds, $opts ) {
- global $wgShowUpdatedMarker;
-
$dbr = $this->getDB();
$user = $this->getUser();
@@ -238,7 +235,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
),
);
- if ( $wgShowUpdatedMarker ) {
+ if ( $this->getConfig()->get( 'ShowUpdatedMarker' ) ) {
$fields[] = 'wl_notificationtimestamp';
}
if ( $limitWatchlist ) {
@@ -279,9 +276,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
''
);
- wfRunHooks( 'SpecialWatchlistQuery',
- array( &$conds, &$tables, &$join_conds, &$fields, $opts ),
- '1.23' );
+ $this->runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts );
return $dbr->select(
$tables,
@@ -293,6 +288,15 @@ class SpecialWatchlist extends ChangesListSpecialPage {
);
}
+ protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) {
+ return parent::runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts )
+ && wfRunHooks(
+ 'SpecialWatchlistQuery',
+ array( &$conds, &$tables, &$join_conds, &$fields, $opts ),
+ '1.23'
+ );
+ }
+
/**
* Return a DatabaseBase object for reading
*
@@ -325,8 +329,6 @@ class SpecialWatchlist extends ChangesListSpecialPage {
* @param FormOptions $opts
*/
public function outputChangesList( $rows, $opts ) {
- global $wgShowUpdatedMarker, $wgRCShowWatchingUsers;
-
$dbr = $this->getDB();
$user = $this->getUser();
$output = $this->getOutput();
@@ -359,13 +361,13 @@ class SpecialWatchlist extends ChangesListSpecialPage {
$rc = RecentChange::newFromRow( $obj );
$rc->counter = $counter++;
- if ( $wgShowUpdatedMarker ) {
+ if ( $this->getConfig()->get( 'ShowUpdatedMarker' ) ) {
$updated = $obj->wl_notificationtimestamp;
} else {
$updated = false;
}
- if ( $wgRCShowWatchingUsers && $user->getOption( 'shownumberswatching' ) ) {
+ if ( $this->getConfig()->get( 'RCShowWatchingUsers' ) && $user->getOption( 'shownumberswatching' ) ) {
$rc->numberofWatchingusers = $dbr->selectField( 'watchlist',
'COUNT(*)',
array(
@@ -407,7 +409,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
$wlInfo = '';
if ( $opts['days'] > 0 ) {
$timestamp = wfTimestampNow();
- $wlInfo = $this->msg( 'wlnote2' )->numParams( round( $opts['days'] * 24 ) )->params(
+ $wlInfo = $this->msg( 'wlnote' )->numParams( $numRows, round( $opts['days'] * 24 ) )->params(
$lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user )
)->parse() . "
\n";
}
@@ -487,14 +489,13 @@ class SpecialWatchlist extends ChangesListSpecialPage {
}
function setTopText( FormOptions $opts ) {
- global $wgEnotifWatchlist, $wgShowUpdatedMarker;
-
$nondefaults = $opts->getChangedValues();
$form = "";
$user = $this->getUser();
$dbr = $this->getDB();
$numItems = $this->countItems( $dbr );
+ $showUpdatedMarker = $this->getConfig()->get( 'ShowUpdatedMarker' );
// Show watchlist header
$form .= "
"; @@ -502,16 +503,16 @@ class SpecialWatchlist extends ChangesListSpecialPage { $form .= $this->msg( 'nowatchlist' )->parse() . "\n"; } else { $form .= $this->msg( 'watchlist-details' )->numParams( $numItems )->parse() . "\n"; - if ( $wgEnotifWatchlist && $user->getOption( 'enotifwatchlistpages' ) ) { + if ( $this->getConfig()->get( 'EnotifWatchlist' ) && $user->getOption( 'enotifwatchlistpages' ) ) { $form .= $this->msg( 'wlheader-enotif' )->parse() . "\n"; } - if ( $wgShowUpdatedMarker ) { + if ( $showUpdatedMarker ) { $form .= $this->msg( 'wlheader-showupdated' )->parse() . "\n"; } } $form .= "
"; - if ( $numItems > 0 && $wgShowUpdatedMarker ) { + if ( $numItems > 0 && $showUpdatedMarker ) { $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL(), 'id' => 'mw-watchlist-resetbutton' ) ) . "\n" .