MediaWiki  master
SpecialPage Class Reference

Parent class for all special pages. More...

Inheritance diagram for SpecialPage:
Collaboration diagram for SpecialPage:

List of all members.

Public Member Functions

 __construct ($name= '', $restriction= '', $listed=true, $function=false, $file= 'default', $includable=false)
 Default constructor for special pages Derivative classes should call this from their constructor Note that if the user does not have the required level, an error message will be displayed by the default execute() method, without the global function ever being called.
 checkPermissions ()
 Checks if userCanExecute, and if not throws a PermissionsError.
 checkReadOnly ()
 If the wiki is currently in readonly mode, throws a ReadOnlyError.
 displayRestrictionError ()
 Output an error message telling the user what access level they have to have.
 execute ($subPage)
 Default execute method Checks user permissions, calls the function given in mFunction.
 getContext ()
 Gets the context this SpecialPage is executed in.
 getDescription ()
 Returns the name that goes in the <h1> in the special page itself, and also the name that will be listed in Special:Specialpages.
 getFile ()
 Get the file which will be included by SpecialPage::execute() if your extension is still stuck in the past and hasn't overridden the execute() method.
 getFinalGroupName ()
 Get the group that the special page belongs in on Special:SpecialPage Use this method, instead of getGroupName to allow customization of the group name from the wiki side.
 getFullTitle ()
 Return the full title, including $par.
 getLang ()
 Shortcut to get user's language.
 getLanguage ()
 Shortcut to get user's language.
 getLocalName ()
 Get the localised name of the special page.
 getName ()
 Get the name of this Special Page.
 getOutput ()
 Get the OutputPage being used for this instance.
 getPageTitle ($subpage=false)
 Get a self-referential title object.
 getRequest ()
 Get the WebRequest being used for this instance.
 getRestriction ()
 Get the permission that a user must have to execute this page.
 getSkin ()
 Shortcut to get the skin being used for this instance.
 getTitle ($subpage=false)
 Get a self-referential title object.
 getUser ()
 Shortcut to get the User executing this instance.
 including ($x=null)
 Whether the special page is being evaluated via transclusion.
 isCached ()
 Is this page cached? Expensive pages are cached or disabled in miser mode.
 isExpensive ()
 Is this page expensive (for some definition of expensive)? Expensive pages are disabled or cached in miser mode.
 isIncludable ()
 Whether it's allowed to transclude the special page via {{Special:Foo/params}}.
 isListed ()
 Whether this special page is listed in Special:SpecialPages.
 isRestricted ()
 Can be overridden by subclasses with more complicated permissions schemes.
 listed ($x=null)
 Get or set whether this special page is listed in Special:SpecialPages.
 msg ()
 Wrapper around wfMessage that sets the current context.
 outputHeader ($summaryMessageKey= '')
 Outputs a summary message on top of special pages Per default the message key is the canonical name of the special page May be overridden, i.e.
 requireLogin ($reasonMsg=null, $titleMsg=null)
 If the user is not logged in, throws UserNotLoggedIn error.
 run ($subPage)
 Entry point.
 setContext ($context)
 Sets the context this SpecialPage is executed in.
 setHeaders ()
 Sets headers - this should be called from the execute() method of all derived classes!
 setListed ($listed)
 Set whether this page is listed in Special:Specialpages, at run-time.
 userCanExecute (User $user)
 Checks if the given user (identified by an object) can execute this special page (as defined by $mRestriction).

Static Public Member Functions

static getSafeTitleFor ($name, $subpage=false)
 Get a localised Title object for a page name with a possibly unvalidated subpage.
static getTitleFor ($name, $subpage=false, $fragment= '')
 Get a localised Title object for a specified special page name.

Protected Member Functions

 addFeedLinks ($params)
 Adds RSS/atom links.
 afterExecute ($subPage)
 Gets called after.
 beforeExecute ($subPage)
 Gets called before.
 getGroupName ()
 Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.
 getRobotPolicy ()
 Return the robot policy.

Protected Attributes

IContextSource $mContext
 Current request context.
 $mIncludable
 $mIncluding
 $mName

Private Attributes

 $mFile
 $mFunction
 $mListed
 $mLocalName
 $mRestriction

Detailed Description

Parent class for all special pages.

Includes some static functions for handling the special page list deprecated in favor of SpecialPageFactory.

Todo:
Turn this into a real ContextSource

Definition at line 33 of file SpecialPage.php.


Constructor & Destructor Documentation

SpecialPage::__construct ( name = '',
restriction = '',
listed = true,
function = false,
file = 'default',
includable = false 
)

Default constructor for special pages Derivative classes should call this from their constructor Note that if the user does not have the required level, an error message will be displayed by the default execute() method, without the global function ever being called.

If you override execute(), you can recover the default behavior with userCanExecute() and displayRestrictionError()

Parameters:
string$nameName of the special page, as seen in links and URLs
string$restrictionUser right required, e.g. "block" or "delete"
bool$listedWhether the page is listed in Special:Specialpages
callable | bool$functionFunction called by execute(). By default it is constructed from $name
string$fileFile which is included by execute(). It is also constructed from $name by default
bool$includableWhether the page can be included in normal pages

Definition at line 115 of file SpecialPage.php.


Member Function Documentation

SpecialPage::addFeedLinks ( params) [protected]

Adds RSS/atom links.

Parameters:
array$params

Definition at line 630 of file SpecialPage.php.

Referenced by SpecialContributions\execute(), SpecialRecentChanges\outputFeedLinks(), and SpecialWatchlist\outputFeedLinks().

SpecialPage::afterExecute ( subPage) [protected]

Gets called after.

See also:
SpecialPage::execute.
Since:
1.20
Parameters:
string | null$subPage

Reimplemented in SpecialCachedPage.

Definition at line 410 of file SpecialPage.php.

SpecialPage::beforeExecute ( subPage) [protected]

Gets called before.

See also:
SpecialPage::execute.
Since:
1.20
Parameters:
string | null$subPage

Definition at line 399 of file SpecialPage.php.

Output an error message telling the user what access level they have to have.

Exceptions:
PermissionsError

Definition at line 276 of file SpecialPage.php.

Referenced by DeletedContributionsPage\__construct().

SpecialPage::execute ( subPage)

Returns the name that goes in the <h1> in the special page itself, and also the name that will be listed in Special:Specialpages.

Derived classes can override this, but usually it is easier to keep the default behavior.

Returns:
string

Reimplemented in LoginForm, and SpecialEmailUser.

Definition at line 466 of file SpecialPage.php.

Referenced by SpecialNewpages\feedTitle().

Get the file which will be included by SpecialPage::execute() if your extension is still stuck in the past and hasn't overridden the execute() method.

No modern code should want or need to know this.

Returns:
string
Deprecated:
since 1.18

Definition at line 158 of file SpecialPage.php.

Get the group that the special page belongs in on Special:SpecialPage Use this method, instead of getGroupName to allow customization of the group name from the wiki side.

Returns:
string Group of this special page
Since:
1.21

Definition at line 650 of file SpecialPage.php.

Return the full title, including $par.

Returns:
Title
Since:
1.18

Definition at line 588 of file SpecialPage.php.

Referenced by LoginForm\execute().

SpecialPage::getGroupName ( ) [protected]

Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.

Returns:
string
Since:
1.21

Reimplemented in SpecialUndelete, LoginForm, SpecialSearch, SpecialVersion, SpecialBlock, MovePageForm, UserrightsPage, SpecialUpload, SpecialContributions, SpecialRevisionDelete, SpecialAllpages, SpecialExport, DeletedContributionsPage, SpecialNewpages, SpecialWhatLinksHere, ChangesListSpecialPage, SpecialMergeHistory, SpecialListUsers, SpecialImport, SpecialEmailUser, SpecialPasswordReset, SpecialStatistics, SpecialChangePassword, SpecialPrefixindex, SpecialListGroupRights, LinkSearchPage, SpecialRandomInCategory, SpecialProtectedpages, SpecialChangeEmail, SpecialActiveUsers, SpecialRedirect, SpecialExpandTemplates, SpecialLog, FileDuplicateSearchPage, SpecialUnblock, SpecialBlockList, SpecialProtectedtitles, SpecialBookSources, MIMEsearchPage, DoubleRedirectsPage, SpecialJavaScriptTest, SpecialComparePages, RandomPage, BrokenRedirectsPage, SpecialPagesWithProp, SpecialResetTokens, ListredirectsPage, MostlinkedTemplatesPage, MostlinkedPage, SpecialTrackingCategories, WantedCategoriesPage, MostinterwikisPage, ShortPagesPage, MostcategoriesPage, SpecialTags, ListDuplicatedFilesPage, WithoutInterwikiPage, FewestrevisionsPage, SpecialLockdb, MostlinkedCategoriesPage, UnwatchedpagesPage, LonelyPagesPage, SpecialPreferences, WantedPagesPage, UnusedtemplatesPage, WantedFilesPage, DeadendPagesPage, SpecialCategories, SpecialUnlockdb, PopularPagesPage, AncientPagesPage, UnusedimagesPage, UncategorizedPagesPage, SpecialAllmessages, UnusedCategoriesPage, SpecialUserlogout, MostimagesPage, SpecialListFiles, UncategorizedImagesPage, WantedTemplatesPage, SpecialNewFiles, SpecialFilepath, SpecialCreateAccount, LongPagesPage, and MostrevisionsPage.

Definition at line 686 of file SpecialPage.php.

Shortcut to get user's language.

Deprecated:
since 1.19 Use getLanguage instead
Returns:
Language
Since:
1.18

Definition at line 566 of file SpecialPage.php.

Shortcut to get user's language.

Returns:
Language
Since:
1.19

Definition at line 578 of file SpecialPage.php.

Referenced by DeletedContributionsPage\__construct(), SpecialChangePassword\attemptReset(), SpecialEditWatchlist\buildRemoveLine(), SpecialVersion\compare(), SpecialContributions\contributionsSub(), SpecialWatchlist\cutoffLinks(), SpecialWatchlist\daysLink(), SpecialWatchlist\doHeader(), SpecialTrackingCategories\execute(), SpecialBlockList\execute(), LinkSearchPage\execute(), FileDuplicateSearchPage\execute(), SpecialNewpages\filterLinks(), SpecialListGroupRights\formatPermissions(), PopularPagesPage\formatResult(), AncientPagesPage\formatResult(), UnusedtemplatesPage\formatResult(), FewestrevisionsPage\formatResult(), UnwatchedpagesPage\formatResult(), MostlinkedCategoriesPage\formatResult(), ShortPagesPage\formatResult(), WantedCategoriesPage\formatResult(), MostcategoriesPage\formatResult(), MostinterwikisPage\formatResult(), BrokenRedirectsPage\formatResult(), MostlinkedTemplatesPage\formatResult(), ListredirectsPage\formatResult(), MostlinkedPage\formatResult(), DoubleRedirectsPage\formatResult(), SpecialPagesWithProp\formatResult(), MIMEsearchPage\formatResult(), SpecialMergeHistory\formatRevisionRow(), SpecialProtectedtitles\formatRow(), SpecialVersion\getCreditsForExtension(), SpecialStatistics\getEditStats(), SpecialVersion\getEntryPointInfo(), SpecialStatistics\getGroupStats(), SpecialStatistics\getMostViewedPages(), SpecialEditWatchlist\getNormalForm(), SpecialStatistics\getOtherStats(), SpecialStatistics\getPageStats(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), SpecialWatchlist\hoursLink(), SpecialJavaScriptTest\initQUnitTesting(), SpecialVersion\listToText(), SpecialRecentChanges\optionsPanel(), SpecialNewpages\parseParams(), SpecialUpload\processVerificationError(), UserrightsPage\showEditUserGroupsForm(), EmailConfirmation\showRequestForm(), and MovePageForm\showSubpages().

Get the localised name of the special page.

Returns:
string

Definition at line 215 of file SpecialPage.php.

Get the OutputPage being used for this instance.

Returns:
OutputPage
Since:
1.18

Definition at line 535 of file SpecialPage.php.

Referenced by DeletedContributionsPage\__construct(), SpecialLog\addHeader(), SpecialRecentChanges\addModules(), EmailConfirmation\attemptConfirm(), EmailInvalidation\attemptInvalidate(), SpecialRevisionDelete\buildCheckBoxes(), SpecialContributions\contributionsSub(), SpecialRecentChanges\doHeader(), SpecialWatchlist\doHeader(), SpecialImport\doImport(), SpecialRecentChangesLinked\doMainQuery(), MovePageForm\doSubmit(), UserrightsPage\editUserGroupsForm(), SpecialNewFiles\execute(), SpecialListFiles\execute(), SpecialUserlogout\execute(), SpecialPreferences\execute(), SpecialRunJobs\execute(), SpecialSpecialpages\execute(), SpecialBlankpage\execute(), RedirectSpecialPage\execute(), SpecialContributions\execute(), SpecialProtectedtitles\execute(), SpecialStatistics\execute(), SpecialTags\execute(), SpecialProtectedpages\execute(), SpecialUnblock\execute(), SpecialTrackingCategories\execute(), SpecialExport\execute(), SpecialWatchlist\execute(), SpecialRecentChanges\execute(), EmailConfirmation\execute(), SpecialPagesWithProp\execute(), SpecialBlockList\execute(), SpecialJavaScriptTest\execute(), SpecialListGroupRights\execute(), SpecialChangePassword\execute(), SpecialExpandTemplates\execute(), SpecialBookSources\execute(), SpecialPrefixindex\execute(), SpecialVersion\execute(), RandomPage\execute(), SpecialEditWatchlist\execute(), SpecialResetTokens\execute(), SpecialCategories\execute(), SpecialRandomInCategory\execute(), UserrightsPage\execute(), LinkSearchPage\execute(), SpecialMergeHistory\execute(), FileDuplicateSearchPage\execute(), SpecialEmailUser\execute(), MIMEsearchPage\execute(), LoginForm\execute(), SpecialListUsers\execute(), SpecialNewpages\form(), SpecialVersion\getCreditsForExtension(), SpecialJavaScriptTest\initQUnitTesting(), SpecialVersion\listAuthors(), SpecialMergeHistory\merge(), SpecialChangePassword\onSubmit(), SpecialResetTokens\onSuccess(), SpecialUnlockdb\onSuccess(), SpecialLockdb\onSuccess(), SpecialChangePassword\onSuccess(), SpecialRecentChanges\outputChangesList(), SpecialWatchlist\outputChangesList(), SpecialListGroupRights\outputNamespaceProtectionInfo(), SpecialSpecialpages\outputPageList(), SpecialRecentChangesLinked\setTopText(), SpecialRecentChanges\setTopText(), SpecialWatchlist\setTopText(), SpecialLog\show(), UserrightsPage\showEditUserGroupsForm(), SpecialImport\showForm(), SpecialMergeHistory\showHistory(), SpecialBlockList\showList(), SpecialBookSources\showList(), MovePageForm\showLogFragment(), SpecialMergeHistory\showMergeForm(), SpecialPrefixindex\showPrefixChunk(), EmailConfirmation\showRequestForm(), SpecialPreferences\showResetForm(), MovePageForm\showSubpages(), SpecialUploadStash\showUpload(), SpecialUploadStash\showUploads(), SpecialPreferences\submitReset(), and UserrightsPage\switchForm().

SpecialPage::getPageTitle ( subpage = false)

Get the WebRequest being used for this instance.

Returns:
WebRequest
Since:
1.18

Definition at line 525 of file SpecialPage.php.

Referenced by DeletedContributionsPage\__construct(), SpecialChangePassword\alterForm(), SpecialChangePassword\checkExecutePermissions(), SpecialImport\doImport(), SpecialListFiles\execute(), SpecialUserlogout\execute(), SpecialPreferences\execute(), SpecialRunJobs\execute(), SpecialContributions\execute(), WithoutInterwikiPage\execute(), SpecialProtectedtitles\execute(), SpecialProtectedpages\execute(), SpecialExport\execute(), SpecialUnblock\execute(), SpecialWatchlist\execute(), SpecialRecentChanges\execute(), SpecialBlockList\execute(), SpecialPagesWithProp\execute(), MovePageForm\execute(), SpecialLog\execute(), SpecialExpandTemplates\execute(), SpecialBookSources\execute(), SpecialPrefixindex\execute(), SpecialImport\execute(), RandomPage\execute(), SpecialEditWatchlist\execute(), SpecialCategories\execute(), SpecialRandomInCategory\execute(), UserrightsPage\execute(), LinkSearchPage\execute(), FileDuplicateSearchPage\execute(), SpecialEmailUser\execute(), MIMEsearchPage\execute(), LoginForm\execute(), SpecialWatchlist\fetchOptionsFromRequest(), SpecialChangePassword\getFormFields(), SpecialFilepath\getRedirect(), RedirectSpecialPage\getRedirectQuery(), SpecialVersion\IPInfo(), SpecialChangePassword\onSubmit(), SpecialChangePassword\onSuccess(), UserrightsPage\saveUserGroups(), SpecialNewpages\setup(), UserrightsPage\showEditUserGroupsForm(), and EmailConfirmation\showRequestForm().

Get the permission that a user must have to execute this page.

Returns:
string

Definition at line 147 of file SpecialPage.php.

SpecialPage::getRobotPolicy ( ) [protected]

Return the robot policy.

Derived classes that override this can change the robot policy set by setHeaders() from the default 'noindex,nofollow'.

Returns:
string
Since:
1.23

Definition at line 599 of file SpecialPage.php.

static SpecialPage::getSafeTitleFor ( name,
subpage = false 
) [static]

Get a localised Title object for a page name with a possibly unvalidated subpage.

Parameters:
string$name
string | bool$subpageSubpage string, or false to not use a subpage
Returns:
Title|null Title object or null if the page doesn't exist

Definition at line 87 of file SpecialPage.php.

Referenced by SpecialFilepath\getRedirect(), Skin\makeSpecialUrl(), and Skin\makeSpecialUrlSubpage().

Shortcut to get the skin being used for this instance.

Returns:
Skin
Since:
1.18

Definition at line 555 of file SpecialPage.php.

Referenced by DeletedContributionsPage\__construct(), SpecialEditWatchlist\buildRemoveLine(), SpecialContributions\execute(), SpecialUnblock\execute(), and SpecialLog\show().

SpecialPage::getTitle ( subpage = false)

Get a self-referential title object.

Parameters:
string | bool$subpage
Returns:
Title
Deprecated:
since 1.23, use SpecialPage::getPageTitle

Definition at line 477 of file SpecialPage.php.

static SpecialPage::getTitleFor ( name,
subpage = false,
fragment = '' 
) [static]

Get a localised Title object for a specified special page name.

Parameters:
string$name
string | bool$subpageSubpage string, or false to not use a subpage
string$fragmentThe link fragment (after the "#")
Returns:
Title
Exceptions:
MWException

Definition at line 74 of file SpecialPage.php.

Referenced by DeletedContributionsPage\__construct(), ApiQuerySiteinfo\appendExtensions(), EmailConfirmation\attemptConfirm(), Linker\blockLink(), SkinTemplate\buildContentNavigationUrls(), SkinTemplate\buildNavUrls(), SpecialEditWatchlist\buildRemoveLine(), SpecialEditWatchlist\buildTools(), WatchAction\checkCanExecute(), Title\checkReadPermissions(), SpecialTags\doTagRow(), Linker\emailLink(), TidyUpBug37714\execute(), UserloginTemplate\execute(), ApiCreateAccount\execute(), SpecialUserlogout\execute(), SpecialWatchlist\execute(), ApiFeedContributions\execute(), SpecialBlockList\execute(), SpecialListGroupRights\execute(), ApiFeedWatchlist\execute(), SpecialEditWatchlist\execute(), SpecialResetTokens\execute(), UnusedtemplatesPage\formatResult(), ListDuplicatedFilesPage\formatResult(), BlockListPager\formatValue(), MoveLogFormatter\getActionLinks(), DeleteLogFormatter\getActionLinks(), RevDel_FileItem\getApiData(), PreferencesForm\getButtons(), InfoAction\getContributors(), HistoryAction\getDescription(), RevDel_ArchiveItem\getDiffLink(), ApiFeedRecentChanges\getFeedObject(), SpecialStatistics\getGroupStats(), RevDel_LogItem\getHTML(), RevDel_ArchivedFileItem\getLink(), SpecialStatistics\getPageStats(), SpecialMycontributions\getRedirect(), SpecialMyuploads\getRedirect(), SpecialAllMyUploads\getRedirect(), SpecialLog\getRevisionButton(), RevDel_ArchiveItem\getRevisionLink(), Skin\getSearchLink(), ImageListPager\getTitle(), SpecialPageFactory\getTitleForAlias(), Skin\getUndeleteLink(), Linker\getUploadUrl(), SpecialStatistics\getUserStats(), ImageHistoryList\imageHistoryLine(), CreditsAction\link(), MostlinkedPage\makeWlhLink(), MostlinkedTemplatesPage\makeWlhLink(), Linker\normaliseSpecialPage(), MarkpatrolledAction\onView(), SpecialListGroupRights\outputNamespaceProtectionInfo(), InfoAction\pageInfo(), SpecialBlock\postText(), SkinTemplate\prepareQuickTemplate(), Preferences\profilePreferences(), OldChangesList\recentChangesLine(), Linker\revDeleteLink(), CoreParserFunctions\special(), Linker\specialLink(), RevDel_LogList\suggestTarget(), SpecialPageTest\testGetTitleFor(), SpecialPageTest\testGetTitleForWithWarning(), SpecialPageTest\testInvalidGetTitleFor(), Linker\userLink(), and Linker\userToolLinks().

Shortcut to get the User executing this instance.

Returns:
User
Since:
1.18

Definition at line 545 of file SpecialPage.php.

Referenced by DeletedContributionsPage\__construct(), UserrightsPage\addLogEntry(), SpecialChangePassword\alterForm(), EmailConfirmation\attemptConfirm(), EmailInvalidation\attemptInvalidate(), SpecialChangePassword\attemptReset(), UserrightsPage\changeableGroups(), SpecialEditWatchlist\cleanupWatchlist(), SpecialEditWatchlist\clearWatchlist(), SpecialWatchlist\countItems(), SpecialWatchlist\doHeader(), SpecialImport\doImport(), SpecialRecentChangesLinked\doMainQuery(), SpecialWatchlist\doMainQuery(), SpecialRecentChanges\doMainQuery(), UserrightsPage\doSaveUserGroups(), MovePageForm\doSubmit(), SpecialTags\doTagRow(), SpecialPreferences\execute(), SpecialUserlogout\execute(), SpecialContributions\execute(), SpecialWatchlist\execute(), EmailConfirmation\execute(), MovePageForm\execute(), SpecialLog\execute(), SpecialImport\execute(), SpecialEditWatchlist\execute(), UserrightsPage\execute(), SpecialEmailUser\execute(), UserrightsPage\fetchUser(), SpecialNewpages\filterLinks(), UnwatchedpagesPage\formatResult(), BrokenRedirectsPage\formatResult(), SpecialMergeHistory\formatRevisionRow(), SpecialProtectedtitles\formatRow(), SpecialRecentChanges\getDefaultOptions(), SpecialWatchlist\getDefaultOptions(), SpecialEmailUser\getFormFields(), SpecialChangePassword\getFormFields(), SpecialResetTokens\getFormFields(), SpecialBlock\getFormFields(), SpecialSpecialpages\getPageGroups(), SpecialMypage\getRedirect(), SpecialMytalk\getRedirect(), SpecialMycontributions\getRedirect(), SpecialMyuploads\getRedirect(), SpecialAllMyUploads\getRedirect(), SpecialLog\getRevisionButton(), SpecialEditWatchlist\getWatchlist(), SpecialEditWatchlist\getWatchlistInfo(), SpecialMergeHistory\merge(), SpecialLockdb\onSubmit(), SpecialResetTokens\onSubmit(), SpecialChangePassword\onSubmit(), SpecialChangePassword\onSuccess(), SpecialRecentChanges\optionsPanel(), SpecialRecentChanges\outputChangesList(), SpecialWatchlist\outputChangesList(), SpecialWatchlist\outputFeedLinks(), SpecialWatchlist\setTopText(), SpecialNewpages\setup(), UserrightsPage\showEditUserGroupsForm(), SpecialImport\showForm(), SpecialMergeHistory\showHistory(), SpecialBlockList\showList(), EmailConfirmation\showRequestForm(), SpecialPreferences\showResetForm(), SpecialEditWatchlist\submitRaw(), SpecialPreferences\submitReset(), SpecialEditWatchlist\unwatchTitles(), SpecialExport\userCanOverrideExportDepth(), and SpecialEditWatchlist\watchTitles().

Is this page cached? Expensive pages are cached or disabled in miser mode.

Used by QueryPage and subclasses, moved here so that Special:SpecialPages can safely call it for all special pages.

Returns:
bool
Since:
1.21

Reimplemented in QueryPage, and FileDuplicateSearchPage.

Definition at line 244 of file SpecialPage.php.

Is this page expensive (for some definition of expensive)? Expensive pages are disabled or cached in miser mode.

Originally used (and still overridden) by QueryPage and subclasses, moved here so that Special:SpecialPages can safely call it for all special pages.

Returns:
bool

Reimplemented in WantedQueryPage, QueryPage, WithoutInterwikiPage, DeadendPagesPage, LonelyPagesPage, MostlinkedTemplatesPage, UncategorizedPagesPage, UncategorizedImagesPage, MostlinkedPage, UnwatchedpagesPage, ListDuplicatedFilesPage, MIMEsearchPage, MostcategoriesPage, MostimagesPage, MostinterwikisPage, UnusedtemplatesPage, BrokenRedirectsPage, ListredirectsPage, AncientPagesPage, DoubleRedirectsPage, FewestrevisionsPage, PopularPagesPage, UnusedimagesPage, and UnusedCategoriesPage.

Definition at line 231 of file SpecialPage.php.

Whether it's allowed to transclude the special page via {{Special:Foo/params}}.

Returns:
bool

Reimplemented in SpecialRecentChanges, IncludableSpecialPage, and WantedPagesPage.

Definition at line 198 of file SpecialPage.php.

Whether this special page is listed in Special:SpecialPages.

Since:
r3583 (v1.3)
Returns:
bool

Reimplemented in SpecialPasswordReset, SpecialResetTokens, SpecialChangeEmail, SpecialCreateAccount, and UnlistedSpecialPage.

Definition at line 170 of file SpecialPage.php.

Can be overridden by subclasses with more complicated permissions schemes.

Returns:
bool Should the page be displayed with the restricted-access pages?

Reimplemented in UserrightsPage.

Definition at line 255 of file SpecialPage.php.

SpecialPage::listed ( x = null)

Get or set whether this special page is listed in Special:SpecialPages.

Since:
1.6
Parameters:
bool$x
Returns:
bool

Definition at line 190 of file SpecialPage.php.

Referenced by SpecialChangePassword\__construct().

Wrapper around wfMessage that sets the current context.

Returns:
Message
See also:
wfMessage

Definition at line 609 of file SpecialPage.php.

Referenced by DeletedContributionsPage\__construct(), SpecialUnlockdb\alterForm(), SpecialLockdb\alterForm(), SpecialChangePassword\alterForm(), SpecialChangePassword\attemptReset(), SpecialEditWatchlist\buildRemoveLine(), SpecialRecentChanges\categoryFilterForm(), SpecialComparePages\checkExistingRevision(), SpecialComparePages\checkExistingTitle(), SpecialWatchlist\cutoffLinks(), SpecialWatchlist\daysLink(), SpecialRecentChanges\doHeader(), SpecialWatchlist\doHeader(), SpecialRecentChangesLinked\doMainQuery(), MovePageForm\doSubmit(), SpecialTags\doTagRow(), SpecialUserlogout\execute(), SpecialContributions\execute(), SpecialStatistics\execute(), SpecialTags\execute(), SpecialTrackingCategories\execute(), SpecialUnblock\execute(), SpecialExport\execute(), SpecialJavaScriptTest\execute(), SpecialPagesWithProp\execute(), SpecialListGroupRights\execute(), SpecialBlockList\execute(), SpecialPrefixindex\execute(), SpecialVersion\execute(), SpecialEditWatchlist\execute(), SpecialCategories\execute(), SpecialRandomInCategory\execute(), LinkSearchPage\execute(), SpecialMergeHistory\execute(), FileDuplicateSearchPage\execute(), SpecialEmailUser\execute(), MIMEsearchPage\execute(), SpecialListUsers\execute(), SpecialNewpages\feedItemDesc(), SpecialNewpages\filterLinks(), SpecialNewpages\form(), SpecialListGroupRights\formatPermissions(), PopularPagesPage\formatResult(), UnusedtemplatesPage\formatResult(), FewestrevisionsPage\formatResult(), UnwatchedpagesPage\formatResult(), MostlinkedCategoriesPage\formatResult(), ShortPagesPage\formatResult(), WantedCategoriesPage\formatResult(), MostcategoriesPage\formatResult(), ListDuplicatedFilesPage\formatResult(), MostinterwikisPage\formatResult(), BrokenRedirectsPage\formatResult(), MostlinkedPage\formatResult(), DoubleRedirectsPage\formatResult(), SpecialPagesWithProp\formatResult(), MIMEsearchPage\formatResult(), SpecialMergeHistory\formatRevisionRow(), SpecialProtectedtitles\formatRow(), SpecialStatistics\formatRow(), SpecialStatistics\formatRowHeader(), SpecialProtectedpages\getCascadeCheck(), MostimagesPage\getCellHtml(), SpecialVersion\getCreditsForExtension(), SpecialEmailUser\getDescription(), SpecialStatistics\getEditStats(), SpecialVersion\getEntryPointInfo(), SpecialProtectedpages\getExpiryCheck(), SpecialVersion\getExtensionCredits(), SpecialEmailUser\getFormFields(), SpecialChangePassword\getFormFields(), SpecialResetTokens\getFormFields(), SpecialBlock\getFormFields(), SpecialJavaScriptTest\getFrameworkListHtml(), SpecialStatistics\getGroupStats(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), SpecialStatistics\getMostViewedPages(), SpecialProtectedpages\getNamespaceMenu(), SpecialProtectedtitles\getNamespaceMenu(), SpecialEditWatchlist\getNormalForm(), RandomPage\getNsList(), SpecialStatistics\getOtherStats(), DeadendPagesPage\getPageHeader(), LonelyPagesPage\getPageHeader(), UnusedCategoriesPage\getPageHeader(), WantedFilesPage\getPageHeader(), WithoutInterwikiPage\getPageHeader(), DoubleRedirectsPage\getPageHeader(), BrokenRedirectsPage\getPageHeader(), UnusedimagesPage\getPageHeader(), UnusedtemplatesPage\getPageHeader(), SpecialStatistics\getPageStats(), SpecialVersion\getParserFunctionHooks(), SpecialVersion\getParserTags(), SpecialEditWatchlist\getRawForm(), SpecialProtectedpages\getRedirectCheck(), SpecialLog\getRevisionButton(), SpecialProtectedpages\getSizeLimit(), SpecialProtectedpages\getTypeMenu(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), SpecialVersion\getWgHooks(), UserrightsPage\groupCheckboxes(), SpecialJavaScriptTest\initQUnitTesting(), SpecialVersion\listAuthors(), SpecialBookSources\makeForm(), UserrightsPage\makeGroupNameList(), MostlinkedTemplatesPage\makeWlhLink(), SpecialMergeHistory\merge(), SpecialRecentChanges\namespaceFilterForm(), SpecialPrefixindex\namespacePrefixForm(), SpecialLockdb\onSubmit(), SpecialUnlockdb\onSuccess(), SpecialLockdb\onSuccess(), SpecialVersion\openExtType(), SpecialRecentChanges\optionsPanel(), SpecialRecentChanges\outputChangesList(), SpecialListGroupRights\outputNamespaceProtectionInfo(), SpecialSearch\powerSearchBox(), SpecialUpload\processVerificationError(), SpecialRecentChanges\setTopText(), SpecialWatchlist\setTopText(), UserrightsPage\showEditUserGroupsForm(), SpecialImport\showForm(), SpecialWatchlist\showHideLink(), SpecialMergeHistory\showHistory(), SpecialBlockList\showList(), SpecialBookSources\showList(), SpecialMergeHistory\showMergeForm(), SpecialProtectedpages\showOptions(), SpecialProtectedtitles\showOptions(), SpecialPrefixindex\showPrefixChunk(), EmailConfirmation\showRequestForm(), SpecialEditWatchlist\showTitles(), SpecialUploadStash\showUploads(), SpecialEditWatchlist\submitNormal(), SpecialEditWatchlist\submitRaw(), and UserrightsPage\switchForm().

SpecialPage::requireLogin ( reasonMsg = null,
titleMsg = null 
)

If the user is not logged in, throws UserNotLoggedIn error.

Default error message includes a link to Special:Userlogin with properly set 'returnto' query parameter.

Since:
1.23
Parameters:
string | Message$reasonMsg[optional] Passed on to UserNotLoggedIn constructor. Strings will be used as message keys. If a string is given, the message will also receive a formatted login link (generated using the 'loginreqlink' message) as first parameter. If a Message is given, it will be passed on verbatim.
string | Message$titleMsg[optional] Passed on to UserNotLoggedIn constructor. Strings will be used as message keys.
Exceptions:
UserNotLoggedIn

Definition at line 321 of file SpecialPage.php.

Referenced by SpecialChangePassword\checkExecutePermissions(), SpecialPreferences\execute(), SpecialWatchlist\execute(), EmailConfirmation\execute(), SpecialResetTokens\execute(), and SpecialEditWatchlist\execute().

SpecialPage::run ( subPage) [final]

Entry point.

Since:
1.20
Parameters:
string | null$subPage

Definition at line 366 of file SpecialPage.php.

SpecialPage::setContext ( context)

Sets the context this SpecialPage is executed in.

Parameters:
IContextSource$context
Since:
1.18

Definition at line 498 of file SpecialPage.php.

Referenced by SkinTemplate\buildNavUrls(), and ApiQueryUsers\execute().

SpecialPage::setListed ( listed)

Set whether this page is listed in Special:Specialpages, at run-time.

Since:
1.3
Parameters:
bool$listed
Returns:
bool

Definition at line 180 of file SpecialPage.php.

Checks if the given user (identified by an object) can execute this special page (as defined by $mRestriction).

Can be overridden by sub- classes with more complicated permissions schemes.

Parameters:
User$userThe user to check
Returns:
bool Does the user have permission to view the page?

Reimplemented in SpecialUpload, SpecialPasswordReset, and UserrightsPage.

Definition at line 268 of file SpecialPage.php.

Referenced by DeletedContributionsPage\__construct().


Member Data Documentation

IContextSource SpecialPage::$mContext [protected]

Current request context.

Definition at line 63 of file SpecialPage.php.

SpecialPage::$mFile [private]

Definition at line 52 of file SpecialPage.php.

SpecialPage::$mFunction [private]

Definition at line 49 of file SpecialPage.php.

SpecialPage::$mIncludable [protected]

Definition at line 58 of file SpecialPage.php.

SpecialPage::$mIncluding [protected]

Definition at line 55 of file SpecialPage.php.

SpecialPage::$mListed [private]

Definition at line 46 of file SpecialPage.php.

SpecialPage::$mLocalName [private]

Definition at line 39 of file SpecialPage.php.

SpecialPage::$mName [protected]

Definition at line 36 of file SpecialPage.php.

SpecialPage::$mRestriction [private]

Definition at line 43 of file SpecialPage.php.


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