MediaWiki  master
FallbackSlotRoleHandler.php
Go to the documentation of this file.
1 <?php
24 
26 
37 
38  public function __construct( $role ) {
39  // treat unknown content as plain text
40  parent::__construct( $role, CONTENT_MODEL_TEXT );
41  }
42 
48  public function isAllowedOn( LinkTarget $page ) {
49  return false;
50  }
51 
59  public function isAllowedModel( $model, LinkTarget $page ) {
60  return false;
61  }
62 
63  public function getOutputLayoutHints() {
64  // TODO: should be return [ 'display' => 'none'] here, causing undefined slots
65  // to be hidden? We'd still need some place to surface the content of such
66  // slots, see T209923.
67 
68  return parent::getOutputLayoutHints(); // TODO: Change the autogenerated stub
69  }
70 
71 }
Revision\FallbackSlotRoleHandler\isAllowedOn
isAllowedOn(LinkTarget $page)
Definition: FallbackSlotRoleHandler.php:48
Revision\SlotRoleHandler
SlotRoleHandler instances are used to declare the existence and behavior of slot roles.
Definition: SlotRoleHandler.php:34
MediaWiki\Revision
Created by PhpStorm.
Definition: FallbackSlotRoleHandler.php:23
Revision\SlotRoleHandler\$role
string $role
Definition: SlotRoleHandler.php:39
Revision\FallbackSlotRoleHandler\isAllowedModel
isAllowedModel( $model, LinkTarget $page)
Definition: FallbackSlotRoleHandler.php:59
Revision\FallbackSlotRoleHandler\getOutputLayoutHints
getOutputLayoutHints()
Layout hints for use while laying out the combined output of all slots, typically by RevisionRenderer...
Definition: FallbackSlotRoleHandler.php:63
Revision\FallbackSlotRoleHandler\__construct
__construct( $role)
Definition: FallbackSlotRoleHandler.php:38
Revision\FallbackSlotRoleHandler
A SlotRoleHandler for providing basic functionality for undefined slot roles.
Definition: FallbackSlotRoleHandler.php:36
MediaWiki\Linker\LinkTarget
Definition: LinkTarget.php:26
CONTENT_MODEL_TEXT
const CONTENT_MODEL_TEXT
Definition: Defines.php:218