MediaWiki REL1_35
|
A SlotRoleHandler for the main slot. More...
Public Member Functions | |
__construct (array $namespaceContentModels, IContentHandlerFactory $contentHandlerFactory) | |
getDefaultModel (LinkTarget $page) | |
isAllowedModel ( $model, LinkTarget $page) | |
supportsArticleCount () | |
Whether this slot should be considered when determining whether a page should be counted as an "article" in the site statistics. | |
Public Member Functions inherited from MediaWiki\Revision\SlotRoleHandler | |
__construct ( $role, $contentModel, $layout=[]) | |
Stable to call. | |
getNameMessageKey () | |
The message key for the translation of the slot name. | |
getOutputLayoutHints () | |
Layout hints for use while laying out the combined output of all slots, typically by RevisionRenderer. | |
getRole () | |
Private Attributes | |
IContentHandlerFactory | $contentHandlerFactory |
string[] | $namespaceContentModels |
A mapping of namespaces to content models. | |
A SlotRoleHandler for the main slot.
While most slot roles serve a specific purpose and thus typically exhibit the same behaviour on all pages, the main slot is used for different things in different pages, typically depending on the namespace, a "file extension" in the page name, or the content model of the slot's content.
MainSlotRoleHandler implements some of the per-namespace and per-model behavior that was supported prior to MediaWiki Version 1.33.
Definition at line 42 of file MainSlotRoleHandler.php.
MediaWiki\Revision\MainSlotRoleHandler::__construct | ( | array | $namespaceContentModels, |
IContentHandlerFactory | $contentHandlerFactory | ||
) |
string[] | $namespaceContentModels | A mapping of namespaces to content models, typically from $wgNamespaceContentModels. |
IContentHandlerFactory | $contentHandlerFactory |
Definition at line 60 of file MainSlotRoleHandler.php.
References MediaWiki\Revision\MainSlotRoleHandler\$contentHandlerFactory, MediaWiki\Revision\MainSlotRoleHandler\$namespaceContentModels, and CONTENT_MODEL_WIKITEXT.
MediaWiki\Revision\MainSlotRoleHandler::getDefaultModel | ( | LinkTarget | $page | ) |
LinkTarget | $page |
Reimplemented from MediaWiki\Revision\SlotRoleHandler.
Definition at line 92 of file MainSlotRoleHandler.php.
References $ext, $title, CONTENT_MODEL_CSS, CONTENT_MODEL_JAVASCRIPT, CONTENT_MODEL_JSON, CONTENT_MODEL_TEXT, CONTENT_MODEL_WIKITEXT, MediaWiki\Linker\LinkTarget\getNamespace(), NS_MEDIAWIKI, and NS_USER.
MediaWiki\Revision\MainSlotRoleHandler::isAllowedModel | ( | $model, | |
LinkTarget | $page | ||
) |
string | $model | |
LinkTarget | $page |
MWUnknownContentModelException |
Reimplemented from MediaWiki\Revision\SlotRoleHandler.
Definition at line 80 of file MainSlotRoleHandler.php.
References $title.
MediaWiki\Revision\MainSlotRoleHandler::supportsArticleCount | ( | ) |
Whether this slot should be considered when determining whether a page should be counted as an "article" in the site statistics.
For a page to be considered countable, one of the page's slots must return true from this method, and Content::isCountable() must return true for the content of that slot.
The default implementation always returns false.
Stable to override
Reimplemented from MediaWiki\Revision\SlotRoleHandler.
Definition at line 69 of file MainSlotRoleHandler.php.
|
private |
Definition at line 53 of file MainSlotRoleHandler.php.
Referenced by MediaWiki\Revision\MainSlotRoleHandler\__construct().
|
private |
A mapping of namespaces to content models.
Definition at line 48 of file MainSlotRoleHandler.php.
Referenced by MediaWiki\Revision\MainSlotRoleHandler\__construct().