MediaWiki
REL1_37
UnsupportedSlotDiffRenderer.php
Go to the documentation of this file.
1
<?php
31
class
UnsupportedSlotDiffRenderer
extends
SlotDiffRenderer
{
32
36
private
$localizer
;
37
41
public
function
__construct
(
MessageLocalizer
$localizer
) {
42
$this->localizer =
$localizer
;
43
}
44
46
public
function
getDiff
(
Content
$oldContent =
null
,
Content
$newContent =
null
) {
47
$this->
normalizeContents
( $oldContent, $newContent );
48
49
$oldModel = $oldContent->getModel();
50
$newModel = $newContent->getModel();
51
52
if
( $oldModel !== $newModel ) {
53
$msg = $this->localizer->msg(
'unsupported-content-diff2'
, $oldModel, $newModel );
54
}
else
{
55
$msg = $this->localizer->msg(
'unsupported-content-diff'
, $oldModel );
56
}
57
58
return
Html::rawElement(
59
'tr'
,
60
[],
61
Html::rawElement(
62
'td'
,
63
[
'colspan'
=> 4,
'class'
=>
'error'
],
64
$msg->parse()
65
)
66
);
67
}
68
69
}
SlotDiffRenderer
Renders a diff for a single slot (that is, a diff between two content objects).
Definition
SlotDiffRenderer.php:40
SlotDiffRenderer\normalizeContents
normalizeContents(Content &$oldContent=null, Content &$newContent=null, $allowedClasses=null)
Helper method to normalize the input of getDiff().
Definition
SlotDiffRenderer.php:78
UnsupportedSlotDiffRenderer
Produces a warning message about not being able to render a slot diff.
Definition
UnsupportedSlotDiffRenderer.php:31
UnsupportedSlotDiffRenderer\getDiff
getDiff(Content $oldContent=null, Content $newContent=null)
Get a diff between two content objects.One of them might be null (meaning a slot was created or remov...
Definition
UnsupportedSlotDiffRenderer.php:46
UnsupportedSlotDiffRenderer\__construct
__construct(MessageLocalizer $localizer)
Definition
UnsupportedSlotDiffRenderer.php:41
UnsupportedSlotDiffRenderer\$localizer
MessageLocalizer $localizer
Definition
UnsupportedSlotDiffRenderer.php:36
Content
Base interface for content objects.
Definition
Content.php:35
MessageLocalizer
Interface for localizing messages in MediaWiki.
Definition
MessageLocalizer.php:29
includes
diff
UnsupportedSlotDiffRenderer.php
Generated on Fri Apr 5 2024 23:40:12 for MediaWiki by
1.9.8