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, IContextSource $context, IMinervaPagePermissions $permissions, SkinOptions $skinOptions, SkinUserPageHelper $relevantUserPageHelper, LanguagesHelper $languagesHelper, ServiceOptions $options, WatchlistManager $watchlistManager)
 Build Group containing icons for toolbar.
 
 getGroup (array $actions, array $views)
 

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 (string $key, array $editAction)
 Creates the "edit" page action: the well-known pencil icon that, when tapped, will open an editor with the lead section loaded.
 
 createWatchPageAction (string $watchKey, array $watchData)
 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 (array $historyAction)
 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,
IContextSource $context,
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
IContextSource$context
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 ( string $key,
array $editAction )
protected

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

Parameters
string$key
array$editAction
Returns
IMenuEntry An edit page actions menu entry

◆ createWatchPageAction()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::createWatchPageAction ( string $watchKey,
array $watchData )
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.

Parameters
string$watchKeyeither watch or unwatch
array$watchData
Returns
IMenuEntry An watch/unwatch page actions menu entry

◆ getGroup()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::getGroup ( array $actions,
array $views )
Parameters
array$actions
array$views
Returns
Group

◆ getHistoryPageAction()

MediaWiki\Minerva\Menu\PageActions\ToolbarBuilder::getHistoryPageAction ( array $historyAction)
protected

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

Parameters
array$historyAction
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.

◆ 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

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: