MediaWiki
REL1_33
FallbackSlotRoleHandler.php
Go to the documentation of this file.
1
<?php
23
namespace
MediaWiki\Revision
;
24
25
use
MediaWiki\Linker\LinkTarget
;
26
36
class
FallbackSlotRoleHandler
extends
SlotRoleHandler
{
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
}
MediaWiki\Revision\FallbackSlotRoleHandler
A SlotRoleHandler for providing basic functionality for undefined slot roles.
Definition
FallbackSlotRoleHandler.php:36
MediaWiki\Revision\FallbackSlotRoleHandler\isAllowedModel
isAllowedModel( $model, LinkTarget $page)
Definition
FallbackSlotRoleHandler.php:59
MediaWiki\Revision\FallbackSlotRoleHandler\isAllowedOn
isAllowedOn(LinkTarget $page)
Definition
FallbackSlotRoleHandler.php:48
MediaWiki\Revision\FallbackSlotRoleHandler\getOutputLayoutHints
getOutputLayoutHints()
Layout hints for use while laying out the combined output of all slots, typically by RevisionRenderer...
Definition
FallbackSlotRoleHandler.php:63
MediaWiki\Revision\FallbackSlotRoleHandler\__construct
__construct( $role)
Definition
FallbackSlotRoleHandler.php:38
MediaWiki\Revision\SlotRoleHandler
SlotRoleHandler instances are used to declare the existence and behavior of slot roles.
Definition
SlotRoleHandler.php:34
MediaWiki\Revision\SlotRoleHandler\$role
string $role
Definition
SlotRoleHandler.php:39
CONTENT_MODEL_TEXT
const CONTENT_MODEL_TEXT
Definition
Defines.php:247
MediaWiki\Linker\LinkTarget
Definition
LinkTarget.php:26
MediaWiki\Revision
Created by PhpStorm.
Definition
FallbackSlotRoleHandler.php:23
includes
Revision
FallbackSlotRoleHandler.php
Generated on Mon Nov 25 2024 15:49:53 for MediaWiki by
1.10.0