MediaWiki REL1_34
MediaWiki\Revision\FallbackSlotRoleHandler Class Reference

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

Inheritance diagram for MediaWiki\Revision\FallbackSlotRoleHandler:
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, LinkTarget $page)
 
 isAllowedOn (LinkTarget $page)
 
- Public Member Functions inherited from MediaWiki\Revision\SlotRoleHandler
 __construct ( $role, $contentModel, $layout=[])
 
 getDefaultModel (LinkTarget $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 ()
 
 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 36 of file FallbackSlotRoleHandler.php.

Constructor & Destructor Documentation

◆ __construct()

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

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.
Returns
array an associative array of hints

Reimplemented from MediaWiki\Revision\SlotRoleHandler.

Definition at line 63 of file FallbackSlotRoleHandler.php.

◆ isAllowedModel()

MediaWiki\Revision\FallbackSlotRoleHandler::isAllowedModel (   $model,
LinkTarget  $page 
)
Parameters
string$model
LinkTarget$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: