MobileFrontend
MobileoptimisedfrontendforMediaWiki
SpecialMobileDiff Class Reference

Show the difference between two revisions of a page. More...

+ Inheritance diagram for SpecialMobileDiff:
+ Collaboration diagram for SpecialMobileDiff:

Public Member Functions

 executeBadQuery ()
 Generate a 404 Error message, that revisions can not be found.
 
 getRevisionsToCompare ( $revids)
 Takes 2 ids/keywords and validates them returning respective revisions. More...
 
 executeWhenAvailable ( $par)
 Render the diff page. More...
 
 getDesktopUrl ( $subPage)
 Get the URL for Desktop version of difference view. More...
 
- Public Member Functions inherited from MobileSpecialPage
 __construct ( $page)
 
 execute ( $subPage)
 Checks the availability of the special page in actual mode and display the page, if available. More...
 
 setHeaders ()
 Add modules to headers and wrap content in div.content if unstyledContent = true.
 
 isListed ()
 Returns if this page is listed on Special:SpecialPages. More...
 

Static Public Member Functions

static getRevision ( $id)
 Get the revision object from ID. More...
 
static getMobileUrlFromDesktop (WebRequest $req)
 Get the url for the mobile diff special page to use in Desktop footer. More...
 

Protected Member Functions

 getPrevId ()
 Returns the ID of the previous Revision, if it is set, otherwise 0. More...
 
 displayDiffPage ()
 Setups the mobile DifferenceEngine and displays a mobile optimised diff.
 
- Protected Member Functions inherited from MobileSpecialPage
 renderUnavailableBanner ( $msg)
 Renders a banner telling the user the page is unavailable. More...
 
 addModules ()
 Add mobile special page specific modules (styles and scripts)
 
 showPageNotFound ()
 Render mobile specific error page, when special page can not be found.
 

Protected Attributes

 $hasDesktopVersion = true
 
 $mDiffEngine
 
- Protected Attributes inherited from MobileSpecialPage
 $hasDesktopVersion = false
 
 $mode = 'stable'
 
 $listed = false
 
 $unstyledContent = true
 
 $config = null
 
 $errorNotFoundTitleMsg = 'mobile-frontend-generic-404-title'
 
 $errorNotFoundDescriptionMsg = 'mobile-frontend-generic-404-desc'
 
 $mobileContext
 

Detailed Description

Show the difference between two revisions of a page.

Member Function Documentation

◆ executeWhenAvailable()

SpecialMobileDiff::executeWhenAvailable (   $par)

Render the diff page.

Returns
bool false when revision not exist
Parameters
string | null$parRevision IDs separated by three points (e.g. 123...124)

Reimplemented from MobileSpecialPage.

◆ getDesktopUrl()

SpecialMobileDiff::getDesktopUrl (   $subPage)

Get the URL for Desktop version of difference view.

Parameters
string | null$subPageURL of mobile diff page
Returns
string Url to mobile diff page

Reimplemented from MobileSpecialPage.

◆ getMobileUrlFromDesktop()

static SpecialMobileDiff::getMobileUrlFromDesktop ( WebRequest  $req)
static

Get the url for the mobile diff special page to use in Desktop footer.

Parameters
WebRequest$req
Returns
bool|string Return URL or false when revision id's not set

◆ getPrevId()

SpecialMobileDiff::getPrevId ( )
protected

Returns the ID of the previous Revision, if it is set, otherwise 0.

Returns
int|null

◆ getRevision()

static SpecialMobileDiff::getRevision (   $id)
static

Get the revision object from ID.

Parameters
int$idID of the wanted revision
Returns
Revision

Reimplemented in MockSpecialMobileDiff.

◆ getRevisionsToCompare()

SpecialMobileDiff::getRevisionsToCompare (   $revids)

Takes 2 ids/keywords and validates them returning respective revisions.

Parameters
int[]$revidsArray of revision ids currently limited to 2 elements
Returns
Revision[]|null[] Array of previous and next revision. The next revision is null if a bad parameter is passed

Member Data Documentation

◆ $mDiffEngine

InlineDifferenceEngine DifferenceEngine SpecialMobileDiff::$mDiffEngine
protected

DifferenceEngine for this Diff-page


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