Go to the documentation of this file.
31 public function __construct( $page =
'Watchlist', $restriction =
'viewmywatchlist' ) {
32 parent::__construct( $page, $restriction );
41 global $wgEnotifWatchlist, $wgShowUpdatedMarker;
50 if ( $mode !==
false ) {
69 if ( ( $wgEnotifWatchlist || $wgShowUpdatedMarker )
74 $user->clearAllNotifications();
89 $opts = parent::getDefaultOptions();
94 $opts->add(
'hideminor',
$user->getBoolOption(
'watchlisthideminor' ) );
95 $opts->add(
'hidebots',
$user->getBoolOption(
'watchlisthidebots' ) );
96 $opts->add(
'hideanons',
$user->getBoolOption(
'watchlisthideanons' ) );
97 $opts->add(
'hideliu',
$user->getBoolOption(
'watchlisthideliu' ) );
98 $opts->add(
'hidepatrolled',
$user->getBoolOption(
'watchlisthidepatrolled' ) );
99 $opts->add(
'hidemyself',
$user->getBoolOption(
'watchlisthideown' ) );
101 $opts->add(
'extended',
$user->getBoolOption(
'extendwatchlist' ) );
112 if ( $this->customFilters ===
null ) {
113 $this->customFilters = parent::getCustomFilters();
114 wfRunHooks(
'SpecialWatchlistFilters',
array( $this, &$this->customFilters ),
'1.23' );
130 static $compatibilityMap =
array(
131 'hideMinor' =>
'hideminor',
132 'hideBots' =>
'hidebots',
133 'hideAnons' =>
'hideanons',
134 'hideLiu' =>
'hideliu',
135 'hidePatrolled' =>
'hidepatrolled',
136 'hideOwn' =>
'hidemyself',
140 foreach ( $compatibilityMap
as $from => $to ) {
150 $opts->fetchValuesFromRequest(
$request );
163 $conds = parent::buildMainQueryConds( $opts );
166 if ( $opts[
'days'] > 0 ) {
167 $conds[] =
'rc_timestamp > ' .
168 $dbr->addQuotes(
$dbr->timestamp( time() - intval( $opts[
'days'] * 86400 ) ) );
182 global $wgShowUpdatedMarker;
187 # Toggle watchlist content (all recent edits or just the latest)
188 if ( $opts[
'extended'] ) {
189 $limitWatchlist =
$user->getIntOption(
'wllimit' );
192 # Top log Ids for a page are not stored
194 wfRunHooks(
'SpecialWatchlistGetNonRevisionTypes',
array( &$nonRevisionTypes ) );
195 if ( $nonRevisionTypes ) {
196 $conds[] =
$dbr->makeList(
198 'rc_this_oldid=page_latest',
199 'rc_type' => $nonRevisionTypes,
210 $query_options =
array(
'ORDER BY' =>
'rc_timestamp DESC' );
212 'watchlist' =>
array(
215 'wl_user' =>
$user->getId(),
216 'wl_namespace=rc_namespace',
222 if ( $wgShowUpdatedMarker ) {
223 $fields[] =
'wl_notificationtimestamp';
225 if ( $limitWatchlist ) {
226 $query_options[
'LIMIT'] = $limitWatchlist;
229 $rollbacker =
$user->isAllowed(
'rollback' );
230 if ( $usePage || $rollbacker ) {
232 $join_conds[
'page'] =
array(
'LEFT JOIN',
'rc_cur_id=page_id' );
234 $fields[] =
'page_latest';
240 if ( !
$user->isAllowed(
'deletedhistory' ) ) {
242 } elseif ( !
$user->isAllowed(
'suppressrevision' ) ) {
250 $dbr->bitAnd(
'rc_deleted', $bitmask ) .
" != $bitmask",
264 array( &$conds, &
$tables, &$join_conds, &$fields, $opts ),
291 $wlToken =
$user->getTokenFromOption(
'watchlisttoken' );
294 'action' =>
'feedwatchlist',
296 'wlowner' =>
$user->getName(),
297 'wltoken' => $wlToken,
309 global $wgShowUpdatedMarker, $wgRCShowWatchingUsers;
315 # Show a message about slave lag, if applicable
318 $output->showLagWarning( $lag );
321 # If no rows to display, show message before try to render the list
322 if ( $rows->numRows() == 0 ) {
324 "<div class='mw-changeslist-empty'>\n$1\n</div>",
'recentchanges-noresult'
329 $dbr->dataSeek( $rows, 0 );
332 $list->setWatchlistDivs();
333 $list->initChangesListRows( $rows );
334 $dbr->dataSeek( $rows, 0 );
336 $s = $list->beginRecentChangesList();
338 foreach ( $rows
as $obj ) {
341 $rc->counter = $counter++;
343 if ( $wgShowUpdatedMarker ) {
344 $updated = $obj->wl_notificationtimestamp;
349 if ( $wgRCShowWatchingUsers &&
$user->getOption(
'shownumberswatching' ) ) {
350 $rc->numberofWatchingusers =
$dbr->selectField(
'watchlist',
353 'wl_namespace' => $obj->rc_namespace,
354 'wl_title' => $obj->rc_title,
358 $rc->numberofWatchingusers = 0;
361 $changeLine = $list->recentChangesLine( $rc, $updated, $counter );
362 if ( $changeLine !==
false ) {
366 $s .= $list->endRecentChangesList();
381 $this->
msg(
'watchlistfor2',
$user->getName() )
389 if ( $opts[
'days'] > 0 ) {
391 $wlInfo = $this->
msg(
'wlnote' )->numParams( $numRows, round( $opts[
'days'] * 24 ) )->params(
393 )->parse() .
"<br />\n";
396 $nondefaults = $opts->getChangedValues();
397 $cutofflinks = $this->
cutoffLinks( $opts[
'days'], $nondefaults ) .
"<br />\n";
399 # Spit out some control panel links
401 'hideminor' =>
'rcshowhideminor',
402 'hidebots' =>
'rcshowhidebots',
403 'hideanons' =>
'rcshowhideanons',
404 'hideliu' =>
'rcshowhideliu',
405 'hidemyself' =>
'rcshowhidemine',
406 'hidepatrolled' =>
'rcshowhidepatr'
409 $filters[$key] =
$params[
'msg'];
412 if ( !
$user->useNPPatrol() ) {
413 unset( $filters[
'hidepatrolled'] );
417 foreach ( $filters
as $name => $msg ) {
421 $hiddenFields = $nondefaults;
422 unset( $hiddenFields[
'namespace'] );
423 unset( $hiddenFields[
'invert'] );
424 unset( $hiddenFields[
'associated'] );
429 # Namespace filter and put the whole form together.
431 $form .= $cutofflinks;
432 $form .= $lang->pipeList( $links ) .
"\n";
433 $form .=
"<hr />\n<p>";
436 'selected' => $opts[
'namespace'],
438 'label' => $this->
msg(
'namespace' )->
text()
440 'name' =>
'namespace',
442 'class' =>
'namespaceselector',
446 $this->
msg(
'invert' )->
text(),
450 array(
'title' => $this->
msg(
'tooltip-invert' )->
text() )
453 $this->
msg(
'namespace_association' )->
text(),
457 array(
'title' => $this->
msg(
'tooltip-namespace_association' )->
text() )
460 foreach ( $hiddenFields
as $key =>
$value ) {
471 global $wgEnotifWatchlist, $wgShowUpdatedMarker;
482 if ( $numItems == 0 ) {
483 $form .= $this->
msg(
'nowatchlist' )->parse() .
"\n";
485 $form .= $this->
msg(
'watchlist-details' )->numParams( $numItems )->parse() .
"\n";
486 if ( $wgEnotifWatchlist &&
$user->getOption(
'enotifwatchlistpages' ) ) {
487 $form .= $this->
msg(
'wlheader-enotif' )->parse() .
"\n";
489 if ( $wgShowUpdatedMarker ) {
490 $form .= $this->
msg(
'wlheader-showupdated' )->parse() .
"\n";
495 if ( $numItems > 0 && $wgShowUpdatedMarker ) {
498 'id' =>
'mw-watchlist-resetbutton' ) ) .
"\n" .
502 foreach ( $nondefaults
as $key =>
$value ) {
511 'id' =>
'mw-watchlist-form'
514 $this->
msg(
'watchlist-options' )->
text(),
516 array(
'id' =>
'mw-watchlist-options' )
525 $label = $this->
msg(
$value ?
'show' :
'hide' )->escaped();
528 return $this->
msg( $message )
546 $message = $d ? $this->
getLanguage()->formatNum( $d )
547 : $this->
msg(
'watchlistall2' )->escaped();
565 $hours =
array( 1, 2, 6, 12 );
566 $days =
array( 1, 3, 7 );
568 foreach ( $hours
as $h ) {
572 foreach ( $days
as $d ) {
576 return $this->
msg(
'wlshowlast' )->rawParams(
589 # Fetch the raw count
590 $rows =
$dbr->select(
'watchlist',
array(
'count' =>
'COUNT(*)' ),
591 array(
'wl_user' => $this->
getUser()->getId() ), __METHOD__ );
592 $row =
$dbr->fetchObject( $rows );
595 return floor(
$count / 2 );
static checkLabel( $label, $name, $id, $checked=false, $attribs=array())
Convenience function to build an HTML checkbox with a label.
Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base reque...
getPageTitle( $subpage=false)
Get a self-referential title object.
const EDIT_CLEAR
Editing modes.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled also a ContextSource error or success you ll probably need to make sure the header is varied on WebRequest $request
static newFromContext(IContextSource $context)
Fetch an appropriate changes list class for the specified context Some users might want to use an enh...
doMainQuery( $conds, $opts)
Process the query.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
namespace and then decline to actually register it RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
getOutput()
Get the OutputPage being used for this instance.
wfGetLB( $wiki=false)
Get a load balancer object.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead $form
getDB()
Return a DatabaseBase object for reading.
Special page which uses a ChangesList to show query results.
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
static buildTools( $unused)
Build a set of links for convenient navigation between watchlist viewing and editing modes.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
__construct( $page='Watchlist', $restriction='viewmywatchlist')
getDefaultOptions()
Get a FormOptions object containing the default options.
getLanguage()
Shortcut to get user's language.
requireLogin( $reasonMsg=null, $titleMsg=null)
If the user is not logged in, throws UserNotLoggedIn error.
doHeader( $opts, $numRows)
Set the text to be displayed above the changes.
static openElement( $element, $attribs=null)
This opens an XML element.
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
static makeLegend(IContextSource $context)
Return the legend displayed within the fieldset.
addFeedLinks( $params)
Adds RSS/atom links.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
getUser()
Shortcut to get the User executing this instance.
when a variable name is used in a it is silently declared as a new masking the global
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
getContext()
Gets the context this SpecialPage is executed in.
A special page that lists last changes made to the wiki, limited to user-defined list of titles.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
presenting them properly to the user as errors is done by the caller $title
execute( $subpage)
Main execution point.
Allows to change the fields on the form that will be generated $name
static getMode( $request, $par)
Determine whether we are editing the watchlist, and if so, what kind of editing operation.
msg()
Wrapper around wfMessage that sets the current context.
getRequest()
Get the WebRequest being used for this instance.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
outputFeedLinks()
Output feed links.
countItems( $dbr)
Count the number of items on a user's watchlist.
static selectFields()
Return the list of recentchanges fields that should be selected to create a new recentchanges object.
static closeElement( $element)
Shortcut to close an XML element.
outputChangesList( $rows, $opts)
Build and output the actual changes list.
hoursLink( $h, $options=array())
daysLink( $d, $options=array())
buildMainQueryConds(FormOptions $opts)
Return an array of conditions depending of options set in $opts.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static namespaceSelector(array $params=array(), array $selectAttribs=array())
Build a drop-down box for selecting a namespace.
static submitButton( $value, $attribs=array())
Convenience function to build an HTML submit button.
getCustomFilters()
Get custom show/hide filters.
setTopText(FormOptions $opts)
Send the text to be displayed before the options.
fetchOptionsFromRequest( $opts)
Fetch values for a FormOptions object from the WebRequest associated with this instance.
setBottomText(FormOptions $opts)
Send the text to be displayed after the options.
getOptions()
Get the current FormOptions for this request.
showHideLink( $options, $message, $name, $value)
static fieldset( $legend=false, $content=false, $attribs=array())
Shortcut for creating fieldsets.
cutoffLinks( $days, $options=array())
Returns html.