MediaWiki  master
FallbackSlotRoleHandler.php
Go to the documentation of this file.
1 <?php
23 namespace MediaWiki\Revision;
24 
26 
37 
38  public function __construct( $role ) {
39  parent::__construct( $role, CONTENT_MODEL_UNKNOWN );
40  }
41 
47  public function isAllowedOn( LinkTarget $page ) {
48  return false;
49  }
50 
58  public function isAllowedModel( $model, LinkTarget $page ) {
59  return false;
60  }
61 
62  public function getOutputLayoutHints() {
63  // TODO: should we return [ 'display' => 'none'] here, causing undefined slots
64  // to be hidden? We'd still need some place to surface the content of such
65  // slots, see T209923.
66 
67  return parent::getOutputLayoutHints();
68  }
69 
70 }
Revision\FallbackSlotRoleHandler\isAllowedOn
isAllowedOn(LinkTarget $page)
Definition: FallbackSlotRoleHandler.php:47
Revision\SlotRoleHandler
SlotRoleHandler instances are used to declare the existence and behavior of slot roles.
Definition: SlotRoleHandler.php:36
MediaWiki\Revision
Definition: ContributionsLookup.php:3
Revision\SlotRoleHandler\$role
string $role
Definition: SlotRoleHandler.php:41
Revision\FallbackSlotRoleHandler\isAllowedModel
isAllowedModel( $model, LinkTarget $page)
Definition: FallbackSlotRoleHandler.php:58
Revision\FallbackSlotRoleHandler\getOutputLayoutHints
getOutputLayoutHints()
Layout hints for use while laying out the combined output of all slots, typically by RevisionRenderer...
Definition: FallbackSlotRoleHandler.php:62
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_UNKNOWN
const CONTENT_MODEL_UNKNOWN
Definition: Defines.php:229