MediaWiki  REL1_24
SpecialEditWatchlist Class Reference

Provides the UI through which users can perform editing operations on their watchlist. More...

Inheritance diagram for SpecialEditWatchlist:
Collaboration diagram for SpecialEditWatchlist:

List of all members.

Public Member Functions

 __construct ()
 execute ($mode)
 Main execution point.
 prefixSearchSubpages ($search, $limit=10)
 Return an array of subpages beginning with $search that this special page will accept.
 submitClear ($data)
 submitNormal ($data)
 submitRaw ($data)

Static Public Member Functions

static buildTools ($unused)
 Build a set of links for convenient navigation between watchlist viewing and editing modes.
static getMode ($request, $par)
 Determine whether we are editing the watchlist, and if so, what kind of editing operation.

Public Attributes

const EDIT_CLEAR = 1
 Editing modes.
const EDIT_NORMAL = 3
const EDIT_RAW = 2

Protected Member Functions

 executeViewEditWatchlist ()
 Executes an edit mode for the watchlist view, from which you can manage your watchlist.
 getClearForm ()
 Get a form for clearing the watchlist.
 getNormalForm ()
 Get the standard watchlist editing form.
 getRawForm ()
 Get a form for editing the watchlist in "raw" mode.
 getWatchlistInfo ()
 Get a list of titles on a user's watchlist, excluding talk pages, and return as a two-dimensional array with namespace and title.
 outputSubtitle ()
 Renders a subheader on the watchlist page.

Protected Attributes

 $successMessage
 $toc

Private Member Functions

 buildRemoveLine ($title)
 Build the label for a checkbox, with a link to the title, and various additional bits.
 checkTitle ($title, $namespace, $dbKey)
 Validates watchlist entry.
 cleanupWatchlist ()
 Attempts to clean up broken items.
 clearWatchlist ()
 Remove all titles from a user's watchlist.
 extractTitles ($list)
 Extract a list of titles from a blob of text, returning (prefixed) strings; unwatchable titles are ignored.
 getWatchlist ()
 Prepare a list of titles on a user's watchlist (excluding talk pages) and return an array of (prefixed) strings.
 showTitles ($titles, &$output)
 Print out a list of linked titles.
 unwatchTitles ($titles)
 Remove a list of titles from a user's watchlist.
 watchTitles ($titles)
 Add a list of titles to a user's watchlist.

Private Attributes

 $badItems = array()

Detailed Description

Provides the UI through which users can perform editing operations on their watchlist.

Author:
Rob Church <[email protected]>

Definition at line 37 of file SpecialEditWatchlist.php.


Constructor & Destructor Documentation


Member Function Documentation

SpecialEditWatchlist::buildRemoveLine ( title) [private]

Build the label for a checkbox, with a link to the title, and various additional bits.

Parameters:
Title$title
Returns:
string

Definition at line 628 of file SpecialEditWatchlist.php.

References $link, $title, array(), SpecialPage\getLanguage(), SpecialPage\getSkin(), SpecialPage\getTitleFor(), Linker\link(), Linker\linkKnown(), SpecialPage\msg(), and wfRunHooks().

Referenced by getNormalForm().

static SpecialEditWatchlist::buildTools ( unused) [static]

Build a set of links for convenient navigation between watchlist viewing and editing modes.

Parameters:
null$unused
Returns:
string

Definition at line 741 of file SpecialEditWatchlist.php.

References $wgLang, array(), as, SpecialPage\getTitleFor(), global, Linker\linkKnown(), Html\rawElement(), text, and wfMessage().

Referenced by SpecialWatchlist\doHeader(), and outputSubtitle().

SpecialEditWatchlist::checkTitle ( title,
namespace,
dbKey 
) [private]

Validates watchlist entry.

Parameters:
Title$title
int$namespace
string$dbKey
Returns:
bool Whether this item is valid

Definition at line 384 of file SpecialEditWatchlist.php.

References $title, and array().

Referenced by getNormalForm(), and getWatchlist().

Attempts to clean up broken items.

Definition at line 406 of file SpecialEditWatchlist.php.

References $title, $user, array(), as, SpecialPage\getUser(), list, wfDebug(), and wfGetDB().

Referenced by getNormalForm(), and getWatchlist().

Remove all titles from a user's watchlist.

Definition at line 438 of file SpecialEditWatchlist.php.

References array(), SpecialPage\getUser(), and wfGetDB().

Referenced by submitClear(), and submitRaw().

Executes an edit mode for the watchlist view, from which you can manage your watchlist.

Definition at line 123 of file SpecialEditWatchlist.php.

References $form, $out, getNormalForm(), SpecialPage\getOutput(), SpecialPage\getTitleFor(), and SpecialPage\msg().

Referenced by execute().

SpecialEditWatchlist::extractTitles ( list) [private]

Extract a list of titles from a blob of text, returning (prefixed) strings; unwatchable titles are ignored.

Parameters:
string$list
Returns:
array

Definition at line 163 of file SpecialEditWatchlist.php.

References $title, $titles, array(), as, Title\newFromText(), and GenderCache\singleton().

Referenced by submitRaw().

Get a form for clearing the watchlist.

Returns:
HTMLForm

Definition at line 694 of file SpecialEditWatchlist.php.

References $form, array(), SpecialPage\getContext(), SpecialPage\getPageTitle(), and SpecialPage\msg().

Referenced by execute().

static SpecialEditWatchlist::getMode ( request,
par 
) [static]

Determine whether we are editing the watchlist, and if so, what kind of editing operation.

Parameters:
WebRequest$request
string$par
Returns:
int

Definition at line 716 of file SpecialEditWatchlist.php.

References EDIT_CLEAR, EDIT_NORMAL, and EDIT_RAW.

Referenced by SpecialWatchlist\execute(), and execute().

Get a form for editing the watchlist in "raw" mode.

Returns:
HTMLForm

Definition at line 667 of file SpecialEditWatchlist.php.

References $form, $titles, array(), SpecialPage\getContext(), SpecialPage\getPageTitle(), getWatchlist(), and SpecialPage\msg().

Referenced by execute().

Prepare a list of titles on a user's watchlist (excluding talk pages) and return an array of (prefixed) strings.

Returns:
array

Definition at line 305 of file SpecialEditWatchlist.php.

References $dbr, $res, $title, $titles, array(), as, checkTitle(), cleanupWatchlist(), SpecialPage\getUser(), Title\makeTitleSafe(), GenderCache\singleton(), and wfGetDB().

Referenced by getRawForm(), submitClear(), and submitRaw().

Get a list of titles on a user's watchlist, excluding talk pages, and return as a two-dimensional array with namespace and title.

Returns:
array

Definition at line 350 of file SpecialEditWatchlist.php.

References $dbr, $lb, $res, $titles, array(), as, SpecialPage\getUser(), MWNamespace\isTalk(), and wfGetDB().

Referenced by getNormalForm().

Renders a subheader on the watchlist page.

Definition at line 113 of file SpecialEditWatchlist.php.

References $out, buildTools(), SpecialPage\getName(), SpecialPage\getOutput(), SpecialPage\getUser(), and SpecialPage\msg().

Referenced by execute().

SpecialEditWatchlist::prefixSearchSubpages ( search,
limit = 10 
)

Return an array of subpages beginning with $search that this special page will accept.

Parameters:
string$searchPrefix to search for
int$limitMaximum number of results to return
Returns:
string[] Matching subpages

Reimplemented from SpecialPage.

Definition at line 143 of file SpecialEditWatchlist.php.

References $limit, array(), and SpecialPage\prefixSearchArray().

SpecialEditWatchlist::showTitles ( titles,
&$  output 
) [private]

Print out a list of linked titles.

$titles can be an array of strings or Title objects; the former is preferred, since Titles are very memory-heavy

Parameters:
array$titlesArray of strings, or Title objects
string$output

Definition at line 259 of file SpecialEditWatchlist.php.

References $batch, $output, $title, $titles, as, Linker\link(), SpecialPage\msg(), Title\newFromText(), and wfMessage().

Referenced by submitClear(), submitNormal(), and submitRaw().

SpecialEditWatchlist::unwatchTitles ( titles) [private]

Remove a list of titles from a user's watchlist.

$titles can be an array of strings or Title objects; the former is preferred, since Titles are very memory-heavy

Parameters:
array$titlesArray of strings, or Title objects

Definition at line 491 of file SpecialEditWatchlist.php.

References $title, $titles, array(), as, WikiPage\factory(), MWNamespace\getSubject(), MWNamespace\getTalk(), SpecialPage\getUser(), Title\newFromText(), wfGetDB(), and wfRunHooks().

Referenced by submitNormal(), and submitRaw().

SpecialEditWatchlist::watchTitles ( titles) [private]

Add a list of titles to a user's watchlist.

$titles can be an array of strings or Title objects; the former is preferred, since Titles are very memory-heavy

Parameters:
array$titlesArray of strings, or Title objects

Definition at line 455 of file SpecialEditWatchlist.php.

References $title, $titles, array(), as, MWNamespace\getSubject(), MWNamespace\getTalk(), SpecialPage\getUser(), Title\newFromText(), and wfGetDB().

Referenced by submitRaw().


Member Data Documentation

SpecialEditWatchlist::$badItems = array() [private]

Definition at line 50 of file SpecialEditWatchlist.php.

SpecialEditWatchlist::$successMessage [protected]

Definition at line 46 of file SpecialEditWatchlist.php.

SpecialEditWatchlist::$toc [protected]

Definition at line 48 of file SpecialEditWatchlist.php.

Editing modes.

EDIT_CLEAR is no longer used; the "Clear" link scared people too much. Now it's passed on to the raw editor, from which it's very easy to clear.

Definition at line 42 of file SpecialEditWatchlist.php.

Referenced by SpecialWatchlist\execute(), and getMode().

Definition at line 44 of file SpecialEditWatchlist.php.

Referenced by getMode().

Definition at line 43 of file SpecialEditWatchlist.php.

Referenced by SpecialWatchlist\execute(), and getMode().


The documentation for this class was generated from the following file: