Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Diff\SiteLinkDiffView Class Reference

Class for generating views of DiffOp objects representing diffs of an Item’s site links (including badges). More...

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

Public Member Functions

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

Protected Member Functions

 generateOpHtml (array $path, DiffOp $op)
 Does the actual work.
 
 generateHtmlDiffTableRow (?string $oldHtml, ?string $newHtml)
 Generates an HTML table row for a change diffOp given HTML snippets representing old and new sides of the Diff.
 
 generateDiffHeaderHtml (string $name)
 Generates HTML for the header of the diff operation.
 

Private Member Functions

 generateDiffOpHtml (array $path, AtomicDiffOp $op)
 
 generateBadgeDiffOpHtml (AtomicDiffOp $op)
 
 generateLinkDiffOpHtml (string $siteId, AtomicDiffOp $op)
 
 getDeletedLine (string $html)
 
 getAddedLine (string $html)
 
 getChangedLine (string $tag, string $html)
 
 getSiteLinkElement (string $siteId, string $pageName, string $html=null)
 
 getBadgeLinkElement (string $idString)
 

Private Attributes

 $path
 
 $diff
 
 $siteLookup
 
 $entityIdFormatter
 
 $messageLocalizer
 

Detailed Description

Class for generating views of DiffOp objects representing diffs of an Item’s site links (including badges).

Diffing of other Item data is done by BasicDiffView.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Diff\SiteLinkDiffView::__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

◆ generateBadgeDiffOpHtml()

Wikibase\Repo\Diff\SiteLinkDiffView::generateBadgeDiffOpHtml ( AtomicDiffOp $op)
private

◆ generateDiffHeaderHtml()

Wikibase\Repo\Diff\SiteLinkDiffView::generateDiffHeaderHtml ( string $name)
protected

Generates HTML for the header of the diff operation.

◆ generateDiffOpHtml()

Wikibase\Repo\Diff\SiteLinkDiffView::generateDiffOpHtml ( array $path,
AtomicDiffOp $op )
private

◆ generateHtmlDiffTableRow()

Wikibase\Repo\Diff\SiteLinkDiffView::generateHtmlDiffTableRow ( ?string $oldHtml,
?string $newHtml )
protected

Generates an HTML table row for a change diffOp given HTML snippets representing old and new sides of the Diff.

◆ generateLinkDiffOpHtml()

Wikibase\Repo\Diff\SiteLinkDiffView::generateLinkDiffOpHtml ( string $siteId,
AtomicDiffOp $op )
private

◆ generateOpHtml()

Wikibase\Repo\Diff\SiteLinkDiffView::generateOpHtml ( array $path,
DiffOp $op )
protected

Does the actual work.

Parameters
string[]$path
DiffOp$op
Returns
string

◆ getAddedLine()

Wikibase\Repo\Diff\SiteLinkDiffView::getAddedLine ( string $html)
private

◆ getBadgeLinkElement()

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

◆ getChangedLine()

Wikibase\Repo\Diff\SiteLinkDiffView::getChangedLine ( string $tag,
string $html )
private

◆ getDeletedLine()

Wikibase\Repo\Diff\SiteLinkDiffView::getDeletedLine ( string $html)
private

◆ getHtml()

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

Builds and returns the HTML to represent the Diff.

Implements Wikibase\Repo\Diff\DiffView.

◆ getSiteLinkElement()

Wikibase\Repo\Diff\SiteLinkDiffView::getSiteLinkElement ( string $siteId,
string $pageName,
string $html = null )
private
Parameters
string$siteId
string$pageName
string | null$htmlDefaults to $pageName (HTML-escaped)
Returns
string

Member Data Documentation

◆ $diff

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

◆ $entityIdFormatter

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

◆ $messageLocalizer

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

◆ $path

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

◆ $siteLookup

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

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