MediaWiki master
MediaWiki\Revision\FallbackSlotRoleHandler Class Reference

A SlotRoleHandler for providing basic functionality for undefined slot roles. More...

Inherits MediaWiki\Revision\SlotRoleHandler.

Collaboration diagram for MediaWiki\Revision\FallbackSlotRoleHandler:

Public Member Functions

 __construct ( $role)
 
 getOutputLayoutHints ()
 Layout hints for use while laying out the combined output of all slots, typically by RevisionRenderer.
 
 isAllowedModel ( $model, PageIdentity $page)
 
 isAllowedOn (LinkTarget $page)
 
- Public Member Functions inherited from MediaWiki\Revision\SlotRoleHandler
 __construct ( $role, $contentModel, $layout=[], bool $derived=false)
 
 getDefaultModel ( $page)
 Determines the content model to use per default for this slot on the given page.
 
 getNameMessageKey ()
 The message key for the translation of the slot name.
 
 getRole ()
 
 isDerived ()
 
 supportsArticleCount ()
 Whether this slot should be considered when determining whether a page should be counted as an "article" in the site statistics.
 

Detailed Description

A SlotRoleHandler for providing basic functionality for undefined slot roles.

This class is intended to be used when encountering slots with a role that used to be defined by an extension, but no longer is backed by hany specific handler, since the extension in question has been uninstalled. It may also be used for pages imported from another wiki.

Since
1.33

Definition at line 37 of file FallbackSlotRoleHandler.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Revision\FallbackSlotRoleHandler::__construct (   $role)

Definition at line 39 of file FallbackSlotRoleHandler.php.

References CONTENT_MODEL_UNKNOWN.

Member Function Documentation

◆ getOutputLayoutHints()

MediaWiki\Revision\FallbackSlotRoleHandler::getOutputLayoutHints ( )

Layout hints for use while laying out the combined output of all slots, typically by RevisionRenderer.

The layout hints are given as an associative array. Well-known keys to use:

  • "display": how the output of this slot should be represented. Supported values:
    • "section": show as a top level section of the region.
    • "none": do not show at all Further values that may be supported in the future include "box" and "banner".
  • "region": in which region of the page the output should be placed. Supported values:
    • "center": the central content area. Further values that may be supported in the future include "top" and "bottom", "left" and "right", "header" and "footer".
  • "placement": placement relative to other content of the same area.
    • "append": place at the end, after any output processed previously. Further values that may be supported in the future include "prepend". A "weight" key may be introduced for more fine grained control.
Stability: stable
to override
Returns
string[] an associative array of hints

Reimplemented from MediaWiki\Revision\SlotRoleHandler.

Definition at line 63 of file FallbackSlotRoleHandler.php.

◆ isAllowedModel()

MediaWiki\Revision\FallbackSlotRoleHandler::isAllowedModel (   $model,
PageIdentity  $page 
)
Parameters
string$model
PageIdentity$page
Returns
bool Always false, to prevent undefined slots from being used for arbitrary content.

Reimplemented from MediaWiki\Revision\SlotRoleHandler.

Definition at line 59 of file FallbackSlotRoleHandler.php.

◆ isAllowedOn()

MediaWiki\Revision\FallbackSlotRoleHandler::isAllowedOn ( LinkTarget  $page)
Parameters
LinkTarget$page
Returns
bool Always false, to prevent undefined slots from being used in new revisions.

Definition at line 48 of file FallbackSlotRoleHandler.php.


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