MediaWiki
REL1_40
UnsupportedSlotDiffRenderer.php
Go to the documentation of this file.
1
<?php
24
use
MediaWiki\Html\Html
;
25
33
class
UnsupportedSlotDiffRenderer
extends
SlotDiffRenderer
{
34
38
private
$localizer;
39
43
public
function
__construct
(
MessageLocalizer
$localizer ) {
44
$this->localizer = $localizer;
45
}
46
48
public
function
getDiff
(
Content
$oldContent =
null
,
Content
$newContent =
null
) {
49
$this->
normalizeContents
( $oldContent, $newContent );
50
51
$oldModel = $oldContent->getModel();
52
$newModel = $newContent->getModel();
53
54
if
( $oldModel !== $newModel ) {
55
$msg = $this->localizer->msg(
'unsupported-content-diff2'
, $oldModel, $newModel );
56
}
else
{
57
$msg = $this->localizer->msg(
'unsupported-content-diff'
, $oldModel );
58
}
59
60
return
Html::rawElement(
61
'tr'
,
62
[],
63
Html::rawElement(
64
'td'
,
65
[
'colspan'
=> 4,
'class'
=>
'error'
],
66
$msg->parse()
67
)
68
);
69
}
70
71
}
MediaWiki\Html\Html
This class is a collection of static functions that serve two purposes:
Definition
Html.php:55
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:33
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:48
UnsupportedSlotDiffRenderer\__construct
__construct(MessageLocalizer $localizer)
Definition
UnsupportedSlotDiffRenderer.php:43
Content
Base interface for representing page content.
Definition
Content.php:37
MessageLocalizer
Interface for localizing messages in MediaWiki.
Definition
MessageLocalizer.php:29
includes
diff
UnsupportedSlotDiffRenderer.php
Generated on Thu Jun 27 2024 14:02:40 for MediaWiki by
1.10.0