MobileFrontend
Mobile optimised frontend for MediaWiki
Loading...
Searching...
No Matches
MobileSpecialPageFeed Class Reference

This is an abstract class intended for use by special pages that consist primarily of a list of pages, for example, Special:Watchlist or Special:History. More...

+ Inheritance diagram for MobileSpecialPageFeed:
+ Collaboration diagram for MobileSpecialPageFeed:

Public Member Functions

 execute ( $par)
 Render the special page content.
 
- Public Member Functions inherited from MobileSpecialPage
 __construct ( $page)
 
 executeWhenAvailable ( $subPage)
 Executes the page when available in the current $mode.
 
 setHeaders ()
 Add modules to headers.
 
 isListed ()
 Returns if this page is listed on Special:SpecialPages.
 
 getDesktopUrl ( $subPage)
 When overridden in a descendant class, returns desktop URL for this special page.
 

Protected Member Functions

 formatComment ( $comment, $title)
 Formats an edit comment.
 
 renderListHeaderWhereNeeded ( $date)
 Renders a date header when necessary.
 
 getRevisionCommentHTML (RevisionRecord $rev, $user, $unhide)
 Generates revision text based on user's rights and preference.
 
 getUsernameText ( $rev, $user, $unhide)
 Generates username text based on user's rights and preference.
 
 renderFeedItemHtml (array $options)
 Renders an item in the feed.
 
- Protected Member Functions inherited from MobileSpecialPage
 renderUnavailableBanner ( $msg)
 Renders a banner telling the user the page is unavailable.
 
 addModules ()
 Add mobile special page specific modules (styles and scripts)
 
 showPageNotFound ()
 Render mobile specific error page, when special page can not be found.
 
 getUserOptionsLookup ()
 Get a user options lookup object.
 
 getUserGroupManager ()
 Get a user group manager object.
 
 getUserFactory ()
 Get a user factory object for creating UserIdentify object.
 

Protected Attributes

 $showUsername = true
 
 $lastDate
 
 $title
 
- Protected Attributes inherited from MobileSpecialPage
 $hasDesktopVersion = false
 
 $listed = false
 
 $config = null
 
 $errorNotFoundTitleMsg = 'mobile-frontend-generic-404-title'
 
 $errorNotFoundDescriptionMsg = 'mobile-frontend-generic-404-desc'
 
 $mobileContext
 
 $userOptionsLookup
 
 $userGroupManager
 
 $userFactory
 
 $commentFormatter
 

Detailed Description

This is an abstract class intended for use by special pages that consist primarily of a list of pages, for example, Special:Watchlist or Special:History.

Member Function Documentation

◆ execute()

MobileSpecialPageFeed::execute ( $par)

Render the special page content.

Parameters
string | null$parparameters submitted as subpage

Reimplemented from MobileSpecialPage.

◆ formatComment()

MobileSpecialPageFeed::formatComment ( $comment,
$title )
protected

Formats an edit comment.

Parameters
string$commentThe raw comment text
Title$titleThe title of the page that was edited
Returns
string HTML code

◆ getRevisionCommentHTML()

MobileSpecialPageFeed::getRevisionCommentHTML ( RevisionRecord $rev,
$user,
$unhide )
protected

Generates revision text based on user's rights and preference.

Parameters
RevisionRecord$rev
User$userviewing the revision
bool$unhidewhether the user wants to see hidden comments if the user doesn't have permission, comment will display as rev-deleted-comment
Returns
string plain text label

◆ getUsernameText()

MobileSpecialPageFeed::getUsernameText ( $rev,
$user,
$unhide )
protected

Generates username text based on user's rights and preference.

Parameters
RevisionRecord$rev
User$userviewing the revision
bool$unhidewhether the user wants to see hidden usernames
Returns
string plain test label

◆ renderFeedItemHtml()

MobileSpecialPageFeed::renderFeedItemHtml ( array $options)
protected

Renders an item in the feed.

Parameters
array$optionsAn array of various options for rendering the feed item's HTML e.g.

[ 'ts' => MWTimestamp - The time the edit occurred 'diffLink' => string - The URL to the diff for the edit 'username' => string - The username of the user that made the edit (absent if anonymous) 'comment' => string - The edit summary, HTML escaped 'title' => Title|null - The title of the page that was edited 'isAnon' => bool - Is the edit anonymous? 'bytes' => int|null - Net number of bytes changed or null if not applicable 'isMinor' => bool - Is the edit minor? ];

◆ renderListHeaderWhereNeeded()

MobileSpecialPageFeed::renderListHeaderWhereNeeded ( $date)
protected

Renders a date header when necessary.

FIXME: Juliusz won't like this function.

Parameters
string$dateThe date of the current item

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