MinervaNeue
A responsive mobile first skin
Loading...
Searching...
No Matches
MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder Class Reference

Public Member Functions

 __construct (Title $title, User $user, MessageLocalizer $msgLocalizer, IMinervaPagePermissions $permissions, SkinOptions $skinOptions, SkinUserPageHelper $relevantUserPageHelper, LanguagesHelper $languagesHelper, ServiceOptions $options, WatchlistManager $watchlistManager)
 Build Group containing icons for toolbar.
 
 getGroup ()
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 ServiceOptions needed.
 

Protected Member Functions

 createContributionsPageAction (UserIdentity $user)
 Create Contributions page action visible on user pages or user talk pages for given $user.
 
 createEditPageAction ()
 Creates the "edit" page action: the well-known pencil icon that, when tapped, will open an editor with the lead section loaded.
 
 createWatchPageAction ()
 Creates the "watch" or "unwatch" action: the well-known star icon that, when tapped, will add the page to or remove the page from the user's watchlist; or, if the user is logged out, will direct the user's UA to Special:Login.
 
 getHistoryPageAction ()
 Creates a history action: An icon that links to the mobile history page.
 
 getHistoryUrl (Title $title)
 Get the URL for the history page for the given title using Special:History when available.
 

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::__construct ( Title $title,
User $user,
MessageLocalizer $msgLocalizer,
IMinervaPagePermissions $permissions,
SkinOptions $skinOptions,
SkinUserPageHelper $relevantUserPageHelper,
LanguagesHelper $languagesHelper,
ServiceOptions $options,
WatchlistManager $watchlistManager )

Build Group containing icons for toolbar.

Parameters
Title$titleArticle title user is currently browsing
User$userCurrently logged in user
MessageLocalizer$msgLocalizerMessage localizer to generate localized texts
IMinervaPagePermissions$permissionsMinerva permissions system
SkinOptions$skinOptions
SkinUserPageHelper$relevantUserPageHelperUser Page helper. The UserPageHelper passed should always be specific to the user page Title. If on a user talk page, UserPageHelper should be instantiated with the user page Title and NOT with the user talk page Title.
LanguagesHelper$languagesHelperHelper to check title languages/variants
ServiceOptions$options
WatchlistManager$watchlistManager

Member Function Documentation

◆ createContributionsPageAction()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::createContributionsPageAction ( UserIdentity $user)
protected

Create Contributions page action visible on user pages or user talk pages for given $user.

Parameters
UserIdentity$userDetermines what the contribution page action will link to
Returns
IMenuEntry

◆ createEditPageAction()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::createEditPageAction ( )
protected

Creates the "edit" page action: the well-known pencil icon that, when tapped, will open an editor with the lead section loaded.

Returns
IMenuEntry An edit page actions menu entry
Exceptions
MWException

Exception

◆ createWatchPageAction()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::createWatchPageAction ( )
protected

Creates the "watch" or "unwatch" action: the well-known star icon that, when tapped, will add the page to or remove the page from the user's watchlist; or, if the user is logged out, will direct the user's UA to Special:Login.

Returns
IMenuEntry An watch/unwatch page actions menu entry
Exceptions
MWException

◆ getGroup()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::getGroup ( )
Returns
Group
Exceptions
MWException

◆ getHistoryPageAction()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::getHistoryPageAction ( )
protected

Creates a history action: An icon that links to the mobile history page.

Returns
IMenuEntry A menu entry object that represents a map of HTML attributes and a 'text' property to be used with the pageActionMenu.mustache template.
Exceptions
MWException

◆ getHistoryUrl()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::getHistoryUrl ( Title $title)
protected

Get the URL for the history page for the given title using Special:History when available.

FIXME: temporary duplicated code, same as SkinMinerva::getHistoryUrl()

Parameters
Title$titleThe Title object of the page being viewed
Returns
string
Exceptions
MWException

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::CONSTRUCTOR_OPTIONS
Initial value:
= [
'WatchlistExpiry',
]

ServiceOptions needed.


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