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

Implements the Watchlist special page. More...

+ Inheritance diagram for SpecialMobileWatchlist:
+ Collaboration diagram for SpecialMobileWatchlist:

Public Member Functions

 executeWhenAvailable ( $par)
 Render the special page.
 
 addWatchlistHTML (IResultWrapper $res, User $user)
 Builds the watchlist HTML inside the associated OutputPage.
 
- Public Member Functions inherited from MobileSpecialPageFeed
 execute ( $par)
 Render the special page content.
 
- Public Member Functions inherited from MobileSpecialPage
 __construct ( $page)
 
 setHeaders ()
 Add modules to headers and wrap content in div.content if unstyledContent = true.
 
 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.
 

Static Public Member Functions

static getWatchlistHeader (User $user, $view=self::VIEW_LIST, $filter=null)
 Get the header for the watchlist page.
 
static getEmptyListHtml ( $feed, $lang)
 Get the HTML needed to show if a user doesn't watch any page, show information how to watch pages where no pages have been watched.
 

Public Attributes

const LIMIT = 50
 
const VIEW_OPTION_NAME = 'mfWatchlistView'
 
const FILTER_OPTION_NAME = 'mfWatchlistFilter'
 
const VIEW_LIST = 'a-z'
 
const VIEW_FEED = 'feed'
 

Protected Member Functions

 getNSConditions ( $column)
 Returns an array of conditions restricting namespace in queries.
 
 doFeedQuery ()
 Get watchlist items for feed view.
 
 showFeedResults (IResultWrapper $res)
 Show results of doFeedQuery.
 
 showResults (IResultWrapper $res, $feed)
 Render the Watchlist items.
 
 showFeedResultRow ( $row)
 Render a result row in feed view.
 
 formatComment ( $comment, $title)
 Formats a comment of revision via Linker:formatComment and Sanitizer::stripAllTags.
 
- Protected Member Functions inherited from MobileSpecialPageFeed
 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 ( $ts, $diffLink='', $username='', $comment='', $title=null, $isAnon=false, $bytes=0, $isMinor=false)
 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.
 

Additional Inherited Members

- Protected Attributes inherited from MobileSpecialPageFeed
 $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
 
 $userOptionsLookup
 
 $userGroupManager
 

Detailed Description

Implements the Watchlist special page.

Member Function Documentation

◆ addWatchlistHTML()

SpecialMobileWatchlist::addWatchlistHTML ( IResultWrapper  $res,
User  $user 
)

Builds the watchlist HTML inside the associated OutputPage.

Parameters
IResultWrapper$res
User$user

◆ doFeedQuery()

SpecialMobileWatchlist::doFeedQuery ( )
protected

Get watchlist items for feed view.

Returns
IResultWrapper
See also
getNSConditions()
doPageImages()

◆ executeWhenAvailable()

SpecialMobileWatchlist::executeWhenAvailable (   $par)

Render the special page.

Parameters
string | null$parparameter submitted as subpage

Reimplemented from MobileSpecialPage.

◆ formatComment()

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

Formats a comment of revision via Linker:formatComment and Sanitizer::stripAllTags.

Parameters
string$comment
Title$titlethe title object of comments page
Returns
string formatted comment

Reimplemented from MobileSpecialPageFeed.

◆ getEmptyListHtml()

static SpecialMobileWatchlist::getEmptyListHtml (   $feed,
  $lang 
)
static

Get the HTML needed to show if a user doesn't watch any page, show information how to watch pages where no pages have been watched.

Parameters
bool$feedRender as feed (true) or list (false) view?
Language$langThe language of the current mode
Returns
string

◆ getNSConditions()

SpecialMobileWatchlist::getNSConditions (   $column)
protected

Returns an array of conditions restricting namespace in queries.

Parameters
string$columnNamespace db key
Returns
array

◆ getWatchlistHeader()

static SpecialMobileWatchlist::getWatchlistHeader ( User  $user,
  $view = self::VIEW_LIST,
  $filter = null 
)
static

Get the header for the watchlist page.

Parameters
User$userthe current user for obtaining default view and filter preferences
string$viewthe name of the view to show (optional) If absent a-z will be used.
string | null$filterthe name of the filter to show (optional) If absent user preferences will be consulted, defaulting to all if no preference
Returns
string Parsed HTML

◆ showFeedResultRow()

SpecialMobileWatchlist::showFeedResultRow (   $row)
protected

Render a result row in feed view.

Parameters
object$rowa row of db result

◆ showFeedResults()

SpecialMobileWatchlist::showFeedResults ( IResultWrapper  $res)
protected

Show results of doFeedQuery.

Parameters
IResultWrapper$resResult wrapper returned from db
See also
showResults()

◆ showResults()

SpecialMobileWatchlist::showResults ( IResultWrapper  $res,
  $feed 
)
protected

Render the Watchlist items.

When ?from not set, adds a link "more" to see the other watchlist items.

Parameters
IResultWrapper$resResult wrapper from db
bool$feedRender as feed (true) or list (false) view?
Todo:
FIXME: use templates/PageList.html when server side templates are available to keep consistent with nearby view

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