Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Diff\ItemDiffView Class Reference

Class for generating views of DiffOp objects. More...

+ Inheritance diagram for Wikibase\Repo\Diff\ItemDiffView:
+ Collaboration diagram for Wikibase\Repo\Diff\ItemDiffView:

Public Member Functions

 __construct (array $path, Diff $diff, SiteLookup $siteLookup, EntityIdFormatter $entityIdFormatter, MessageLocalizer $messageLocalizer)
 
 getHtml ()
 Builds and returns the HTML to represent the Diff. More...
 

Protected Member Functions

 generateChangeOpHtml ( $oldValue, $newValue, array $path)
 Generates HTML for an change diffOp. More...
 
 generateDiffHeaderHtml ( $name)
 Generates HTML for the header of the diff operation. More...
 

Private Member Functions

 getDeletedLine ( $value, array $path)
 
 getAddedLine ( $value, array $path)
 
 getChangedLine ( $tag, $value, array $path)
 
 getSiteLinkElement ( $siteId, $pageName)
 
 getBadgeLinkElement ( $idString)
 

Private Attributes

 $path
 
 $diff
 
 $siteLookup
 
 $entityIdFormatter
 
 $messageLocalizer
 
 $siteLinkPath
 

Detailed Description

Class for generating views of DiffOp objects.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Diff\ItemDiffView::__construct ( array  $path,
Diff  $diff,
SiteLookup  $siteLookup,
EntityIdFormatter  $entityIdFormatter,
MessageLocalizer  $messageLocalizer 
)
Parameters
string[]$path
Diff$diff
SiteLookup$siteLookup
EntityIdFormatter$entityIdFormatterthat must return only HTML! otherwise injections might be possible
MessageLocalizer$messageLocalizer

Member Function Documentation

◆ generateChangeOpHtml()

Wikibase\Repo\Diff\ItemDiffView::generateChangeOpHtml (   $oldValue,
  $newValue,
array  $path 
)
protected

Generates HTML for an change diffOp.

Parameters
string | null$oldValue
string | null$newValue
string[]$path
Returns
string

◆ generateDiffHeaderHtml()

Wikibase\Repo\Diff\ItemDiffView::generateDiffHeaderHtml (   $name)
protected

Generates HTML for the header of the diff operation.

Parameters
string$name
Returns
string

◆ getAddedLine()

Wikibase\Repo\Diff\ItemDiffView::getAddedLine (   $value,
array  $path 
)
private
Parameters
string$value
string[]$path
Returns
string

◆ getBadgeLinkElement()

Wikibase\Repo\Diff\ItemDiffView::getBadgeLinkElement (   $idString)
private
Parameters
string$idString
Returns
string HTML

◆ getChangedLine()

Wikibase\Repo\Diff\ItemDiffView::getChangedLine (   $tag,
  $value,
array  $path 
)
private
Parameters
string$tag
string$value
string[]$path
Returns
string

◆ getDeletedLine()

Wikibase\Repo\Diff\ItemDiffView::getDeletedLine (   $value,
array  $path 
)
private
Parameters
string$value
string[]$path
Returns
string

◆ getHtml()

Wikibase\Repo\Diff\ItemDiffView::getHtml ( )

Builds and returns the HTML to represent the Diff.

Returns
string

Implements Wikibase\Repo\Diff\DiffView.

◆ getSiteLinkElement()

Wikibase\Repo\Diff\ItemDiffView::getSiteLinkElement (   $siteId,
  $pageName 
)
private
Parameters
string$siteId
string$pageName
Returns
string

Member Data Documentation

◆ $diff

Wikibase\Repo\Diff\ItemDiffView::$diff
private

◆ $entityIdFormatter

Wikibase\Repo\Diff\ItemDiffView::$entityIdFormatter
private

◆ $messageLocalizer

Wikibase\Repo\Diff\ItemDiffView::$messageLocalizer
private

◆ $path

Wikibase\Repo\Diff\ItemDiffView::$path
private

◆ $siteLinkPath

Wikibase\Repo\Diff\ItemDiffView::$siteLinkPath
private

◆ $siteLookup

Wikibase\Repo\Diff\ItemDiffView::$siteLookup
private

The documentation for this class was generated from the following file: