MediaWiki
master
FallbackSlotRoleHandler.php
Go to the documentation of this file.
1
<?php
9
namespace
MediaWiki\Revision
;
10
11
use
MediaWiki\Linker\LinkTarget
;
12
use
MediaWiki\Page\PageIdentity
;
13
23
class
FallbackSlotRoleHandler
extends
SlotRoleHandler
{
24
25
public
function
__construct
(
string
$role ) {
26
parent::__construct( $role,
CONTENT_MODEL_UNKNOWN
);
27
}
28
34
public
function
isAllowedOn
(
LinkTarget
$page ) {
35
return
false
;
36
}
37
45
public
function
isAllowedModel
( $model,
PageIdentity
$page ) {
46
return
false
;
47
}
48
50
public
function
getOutputLayoutHints
() {
51
// TODO: should we return [ 'display' => 'none'] here, causing undefined slots
52
// to be hidden? We'd still need some place to surface the content of such
53
// slots, see T209923.
54
55
return
parent::getOutputLayoutHints();
56
}
57
58
}
CONTENT_MODEL_UNKNOWN
const CONTENT_MODEL_UNKNOWN
Definition
Defines.php:242
MediaWiki\Revision\FallbackSlotRoleHandler
A SlotRoleHandler for providing basic functionality for undefined slot roles.
Definition
FallbackSlotRoleHandler.php:23
MediaWiki\Revision\FallbackSlotRoleHandler\isAllowedOn
isAllowedOn(LinkTarget $page)
Definition
FallbackSlotRoleHandler.php:34
MediaWiki\Revision\FallbackSlotRoleHandler\getOutputLayoutHints
getOutputLayoutHints()
Layout hints for use while laying out the combined output of all slots, typically by RevisionRenderer...
Definition
FallbackSlotRoleHandler.php:50
MediaWiki\Revision\FallbackSlotRoleHandler\isAllowedModel
isAllowedModel( $model, PageIdentity $page)
Definition
FallbackSlotRoleHandler.php:45
MediaWiki\Revision\FallbackSlotRoleHandler\__construct
__construct(string $role)
Definition
FallbackSlotRoleHandler.php:25
MediaWiki\Revision\SlotRoleHandler
SlotRoleHandler instances are used to declare the existence and behavior of slot roles.
Definition
SlotRoleHandler.php:23
MediaWiki\Linker\LinkTarget
Represents the target of a wiki link.
Definition
LinkTarget.php:19
MediaWiki\Page\PageIdentity
Interface for objects (potentially) representing an editable wiki page.
Definition
PageIdentity.php:53
MediaWiki\Revision
Definition
ArchivedRevisionLookup.php:7
includes
Revision
FallbackSlotRoleHandler.php
Generated on Sat Mar 7 2026 21:24:44 for MediaWiki by
1.10.0