MediaWiki  REL1_19
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.
 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

 getNormalForm ()
 Get the standard watchlist editing form.
 getRawForm ()
 Get a form for editing the watchlist in "raw" mode.

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.
 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.
 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 10 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:
$titleTitle
Returns:
string

Definition at line 491 of file SpecialEditWatchlist.php.

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

Referenced by getNormalForm().

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialEditWatchlist::buildTools ( unused) [static]

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

Parameters:
$unusedUnused
Returns:
string

Definition at line 578 of file SpecialEditWatchlist.php.

References $wgLang, SpecialPage\getTitleFor(), Linker\linkKnown(), Html\rawElement(), wfMsg(), and wfMsgHtml().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 276 of file SpecialEditWatchlist.php.

References $title.

Referenced by getNormalForm(), and getWatchlist().

Here is the caller graph for this function:

Attempts to clean up broken items.

Definition at line 296 of file SpecialEditWatchlist.php.

References $title, SpecialPage\getUser(), wfDebug(), and wfGetDB().

Referenced by getNormalForm(), and getWatchlist().

Here is the call graph for this function:

Here is the caller graph for this function:

Remove all titles from a user's watchlist.

Definition at line 325 of file SpecialEditWatchlist.php.

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

Referenced by submitRaw().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialEditWatchlist::extractTitles ( list) [private]

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

Parameters:
$listString
Returns:
array

Definition at line 104 of file SpecialEditWatchlist.php.

References $title, and Title\newFromText().

Referenced by submitRaw().

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Parameters:
$requestWebRequest
$parmixed
Returns:
int

Definition at line 551 of file SpecialEditWatchlist.php.

References EDIT_CLEAR, EDIT_NORMAL, and EDIT_RAW.

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

Here is the caller graph for this function:

Get the standard watchlist editing form.

Returns:
HTMLForm

Definition at line 429 of file SpecialEditWatchlist.php.

References $count, $title, $wgContLang, buildRemoveLine(), checkTitle(), cleanupWatchlist(), SpecialPage\getContext(), SpecialPage\getLanguage(), SpecialPage\getTitle(), getWatchlistInfo(), Title\makeTitleSafe(), SpecialPage\msg(), Linker\tocIndent(), Linker\tocLine(), Linker\tocLineEnd(), and Linker\tocList().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
HTMLForm

Definition at line 523 of file SpecialEditWatchlist.php.

References SpecialPage\getContext(), SpecialPage\getTitle(), getWatchlist(), and SpecialPage\msg().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

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 212 of file SpecialEditWatchlist.php.

References $dbr, $res, $title, checkTitle(), cleanupWatchlist(), SpecialPage\getUser(), Title\makeTitleSafe(), and wfGetDB().

Referenced by getRawForm(), and submitRaw().

Here is the call graph for this function:

Here is the caller graph for this function:

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 244 of file SpecialEditWatchlist.php.

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

Referenced by getNormalForm().

Here is the call graph for this function:

Here is the caller graph for this function:

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:
$titlesarray of strings, or Title objects
$outputString

Definition at line 176 of file SpecialEditWatchlist.php.

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

Referenced by submitNormal(), and submitRaw().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 406 of file SpecialEditWatchlist.php.

References SpecialPage\msg(), showTitles(), and unwatchTitles().

Here is the call graph for this function:

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:
$titlesArray of strings, or Title objects

Definition at line 375 of file SpecialEditWatchlist.php.

References $page, $title, WikiPage\factory(), SpecialPage\getUser(), Title\newFromText(), wfGetDB(), and wfRunHooks().

Referenced by submitNormal(), and submitRaw().

Here is the call graph for this function:

Here is the caller graph for this function:

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:
$titlesArray of strings, or Title objects

Definition at line 342 of file SpecialEditWatchlist.php.

References $rows, $title, SpecialPage\getUser(), Title\newFromText(), and wfGetDB().

Referenced by submitRaw().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

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

Definition at line 23 of file SpecialEditWatchlist.php.

SpecialEditWatchlist::$successMessage [protected]

Definition at line 19 of file SpecialEditWatchlist.php.

SpecialEditWatchlist::$toc [protected]

Definition at line 21 of file SpecialEditWatchlist.php.

Editing modes.

Definition at line 15 of file SpecialEditWatchlist.php.

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

Definition at line 17 of file SpecialEditWatchlist.php.

Referenced by getMode().

Definition at line 16 of file SpecialEditWatchlist.php.

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


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