Public Member Functions | |
execute ($user, $output, $request, $mode) | |
Main execution point. | |
showRawForm ($output, $user) | |
Show a form for editing the watchlist in "raw" mode. | |
Static Public Member Functions | |
static | getMode ($request, $par) |
Determine whether we are editing the watchlist, and if so, what kind of editing operation. | |
static | buildTools ($skin) |
Build a set of links for convenient navigation between watchlist viewing and editing modes. | |
Public Attributes | |
const | EDIT_CLEAR = 1 |
Editing modes. | |
const | EDIT_RAW = 2 |
const | EDIT_NORMAL = 3 |
Private Member Functions | |
checkToken ($request, $user) | |
Check the edit token from a form submission. | |
extractTitles ($list) | |
Extract a list of titles from a blob of text, returning (prefixed) strings; unwatchable titles are ignored. | |
showTitles ($titles, $output, $skin) | |
Print out a list of linked titles. | |
countWatchlist ($user) | |
Count the number of titles on a user's watchlist, excluding talk pages. | |
getWatchlist ($user) | |
Prepare a list of titles on a user's watchlist (excluding talk pages) and return an array of (prefixed) strings. | |
getWatchlistInfo ($user) | |
Get a list of titles on a user's watchlist, excluding talk pages, and return as a two-dimensional array with namespace, title and redirect status. | |
showItemCount ($output, $user) | |
Show a message indicating the number of items on the user's watchlist, and return this count for additional checking. | |
clearWatchlist ($user) | |
Remove all titles from a user's watchlist. | |
watchTitles ($titles, $user) | |
Add a list of titles to a user's watchlist. | |
unwatchTitles ($titles, $user) | |
Remove a list of titles from a user's watchlist. | |
showNormalForm ($output, $user) | |
Show the standard watchlist editing form. | |
buildRemoveList ($user, $skin) | |
Build the part of the standard watchlist editing form with the actual title selection checkboxes and stuff. | |
getNamespaceHeading ($namespace) | |
Get the correct "heading" for a namespace. | |
buildRemoveLine ($title, $redirect, $skin) | |
Build a single list item containing a check box selecting a title and a link to that title, with various additional bits. |
Definition at line 10 of file WatchlistEditor.php.
WatchlistEditor::buildRemoveLine | ( | $ | title, | |
$ | redirect, | |||
$ | skin | |||
) | [private] |
Build a single list item containing a check box selecting a title and a link to that title, with various additional bits.
Definition at line 409 of file WatchlistEditor.php.
References $title, $wgLang, Xml::check(), SpecialPage::getTitleFor(), and wfMsgHtml().
Referenced by buildRemoveList().
WatchlistEditor::buildRemoveList | ( | $ | user, | |
$ | skin | |||
) | [private] |
Build the part of the standard watchlist editing form with the actual title selection checkboxes and stuff.
Also generates a table of contents if there's more than one heading.
Definition at line 362 of file WatchlistEditor.php.
References $title, $user, buildRemoveLine(), getNamespaceHeading(), getWatchlistInfo(), and Title::makeTitleSafe().
Referenced by showNormalForm().
static WatchlistEditor::buildTools | ( | $ | skin | ) | [static] |
Build a set of links for convenient navigation between watchlist viewing and editing modes.
$skin | Skin to use |
Definition at line 484 of file WatchlistEditor.php.
References $mode, $wgLang, SpecialPage::getTitleFor(), and wfMsgHtml().
Referenced by wfSpecialWatchlist().
WatchlistEditor::checkToken | ( | $ | request, | |
$ | user | |||
) | [private] |
Check the edit token from a form submission.
$request | WebRequest | |
$user | User |
Definition at line 88 of file WatchlistEditor.php.
References $user.
Referenced by execute().
WatchlistEditor::clearWatchlist | ( | $ | user | ) | [private] |
WatchlistEditor::countWatchlist | ( | $ | user | ) | [private] |
Count the number of titles on a user's watchlist, excluding talk pages.
$user | User |
Definition at line 159 of file WatchlistEditor.php.
References $dbr, $res, $row, $user, and wfGetDB().
Referenced by showItemCount().
WatchlistEditor::execute | ( | $ | user, | |
$ | output, | |||
$ | request, | |||
$ | mode | |||
) |
Main execution point.
$user | User | |
$output | OutputPage | |
$request | WebRequest | |
$mode | int |
Definition at line 27 of file WatchlistEditor.php.
References $count, $GLOBALS, $mode, $output, $user, $wgUser, checkToken(), clearWatchlist(), extractTitles(), getWatchlist(), showNormalForm(), showRawForm(), showTitles(), unwatchTitles(), watchTitles(), wfMsg(), wfMsgExt(), and wfReadOnly().
WatchlistEditor::extractTitles | ( | $ | list | ) | [private] |
Extract a list of titles from a blob of text, returning (prefixed) strings; unwatchable titles are ignored.
$list | mixed |
Definition at line 99 of file WatchlistEditor.php.
References $text, $title, and Title::newFromText().
Referenced by execute().
static WatchlistEditor::getMode | ( | $ | request, | |
$ | par | |||
) | [static] |
Determine whether we are editing the watchlist, and if so, what kind of editing operation.
$request | WebRequest | |
$par | mixed |
Definition at line 463 of file WatchlistEditor.php.
References $mode.
Referenced by wfSpecialWatchlist().
WatchlistEditor::getNamespaceHeading | ( | $ | namespace | ) | [private] |
Get the correct "heading" for a namespace.
$namespace | int |
Definition at line 394 of file WatchlistEditor.php.
References $GLOBALS, and wfMsgHtml().
Referenced by buildRemoveList().
WatchlistEditor::getWatchlist | ( | $ | user | ) | [private] |
Prepare a list of titles on a user's watchlist (excluding talk pages) and return an array of (prefixed) strings.
$user | User |
Definition at line 173 of file WatchlistEditor.php.
References $dbr, $res, $row, $title, $user, Title::makeTitleSafe(), and wfGetDB().
Referenced by execute(), and showRawForm().
WatchlistEditor::getWatchlistInfo | ( | $ | user | ) | [private] |
Get a list of titles on a user's watchlist, excluding talk pages, and return as a two-dimensional array with namespace, title and redirect status.
$user | User |
Definition at line 203 of file WatchlistEditor.php.
References $dbr, $page, $res, $row, $sql, $title, $user, Title::makeTitleSafe(), LinkCache::singleton(), and wfGetDB().
Referenced by buildRemoveList().
WatchlistEditor::showItemCount | ( | $ | output, | |
$ | user | |||
) | [private] |
Show a message indicating the number of items on the user's watchlist, and return this count for additional checking.
$output | OutputPage | |
$user | User |
Definition at line 240 of file WatchlistEditor.php.
References $count, $GLOBALS, $output, $user, countWatchlist(), and wfMsgExt().
Referenced by showNormalForm(), and showRawForm().
WatchlistEditor::showNormalForm | ( | $ | output, | |
$ | user | |||
) | [private] |
Show the standard watchlist editing form.
$output | OutputPage | |
$user | User |
Definition at line 338 of file WatchlistEditor.php.
References $count, $output, $self, $user, $wgUser, buildRemoveList(), SpecialPage::getTitleFor(), Xml::hidden(), Xml::openElement(), showItemCount(), Xml::submitButton(), wfMsg(), wfMsgExt(), and wfMsgHtml().
Referenced by execute().
WatchlistEditor::showRawForm | ( | $ | output, | |
$ | user | |||
) |
Show a form for editing the watchlist in "raw" mode.
$output | OutputPage | |
$user | User |
Definition at line 433 of file WatchlistEditor.php.
References $output, $self, $title, $user, $wgUser, SpecialPage::getTitleFor(), getWatchlist(), Xml::hidden(), Xml::label(), Xml::openElement(), showItemCount(), Xml::submitButton(), wfMsg(), wfMsgExt(), and wfMsgHtml().
Referenced by execute().
WatchlistEditor::showTitles | ( | $ | titles, | |
$ | output, | |||
$ | skin | |||
) | [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
$titles | An array of strings, or Title objects | |
$output | OutputPage | |
$skin | Skin |
Definition at line 127 of file WatchlistEditor.php.
References $batch, $output, $title, Title::newFromText(), and wfMsgHtml().
Referenced by execute().
WatchlistEditor::unwatchTitles | ( | $ | titles, | |
$ | user | |||
) | [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
Definition at line 302 of file WatchlistEditor.php.
References $dbw, $title, $user, Title::newFromText(), wfGetDB(), and wfRunHooks().
Referenced by execute().
WatchlistEditor::watchTitles | ( | $ | titles, | |
$ | user | |||
) | [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
Definition at line 269 of file WatchlistEditor.php.
References $dbw, $rows, $title, $user, Title::newFromText(), and wfGetDB().
Referenced by execute().
const WatchlistEditor::EDIT_CLEAR = 1 |
const WatchlistEditor::EDIT_NORMAL = 3 |
Definition at line 17 of file WatchlistEditor.php.
const WatchlistEditor::EDIT_RAW = 2 |
Definition at line 16 of file WatchlistEditor.php.