MobileFrontend
MobileoptimisedfrontendforMediaWiki
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. More...
 
- Public Member Functions inherited from MobileSpecialPage
 __construct ( $page)
 
 executeWhenAvailable ( $subPage)
 Executes the page when available in the current $mode. 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...
 
 getDesktopUrl ( $subPage)
 When overridden in a descendant class, returns desktop URL for this special page. More...
 

Protected Member Functions

 formatComment ( $comment, $title)
 Formats an edit comment. More...
 
 renderListHeaderWhereNeeded ( $date)
 Renders a date header when necessary. More...
 
 getRevisionCommentHTML ( $rev, $user, $unhide)
 Generates revision text based on user's rights and preference. More...
 
 getUsernameText ( $rev, $user, $unhide)
 Generates username text based on user's rights and preference. More...
 
 renderFeedItemHtml ( $ts, $diffLink='', $username='', $comment='', $title=null, $isAnon=false, $bytes=0, $isMinor=false)
 Renders an item in the feed. More...
 
- 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

 $showUsername = true
 
 $lastDate
 
 $title
 
- 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

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 @fixme Duplication with SpecialMobileWatchlist @suppress SecurityCheck-DoubleEscaped phan false positive
Returns
string HTML code

Reimplemented in SpecialMobileWatchlist.

◆ getRevisionCommentHTML()

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

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

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

◆ getUsernameText()

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

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

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

◆ renderFeedItemHtml()

MobileSpecialPageFeed::renderFeedItemHtml (   $ts,
  $diffLink = '',
  $username = '',
  $comment = '',
  $title = null,
  $isAnon = false,
  $bytes = 0,
  $isMinor = false 
)
protected

Renders an item in the feed.

Parameters
MWTimestamp$tsThe time the edit occurred
string$diffLinkurl to the diff for the edit
string$usernameThe username of the user that made the edit (absent if anonymous)
string$commentThe edit summary, HTML escaped
Title | null$titleThe title of the page that was edited
bool$isAnonIs the edit anonymous?
int | null$bytesNet number of bytes changed or null if not applicable
bool$isMinorIs the edit minor?
Todo:
FIXME: use an array as an argument?

◆ 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: