Add wikidata link to overflow menu

The director is now passed the array from `BaseTemplate::getToolbox()`
as all of the server rendered links we show in the main namespace/user
namespace overflow menus (including wikibase) will be in the toolbox
array except for the "Uploads" link in the User overflow menu which is
added in the UserNamespaceOverflowBuilder.

Bug: T222630
Change-Id: I280537c6b8b32036d68a5a004571bb5a41c2e703
This commit is contained in:
Nicholas Ray 2019-06-10 18:57:13 -06:00
parent b64585dfad
commit 162f8aa95c
5 changed files with 5 additions and 2 deletions

View File

@ -55,6 +55,7 @@
"minerva-page-actions-uploads": "Uploads",
"minerva-page-actions-user-rights": "User rights",
"minerva-page-actions-logs": "Logs",
"minerva-page-actions-wikibase": "{{WBREPONAME}} item",
"skinname-minerva": "MinervaNeue",
"minerva-skin-desc": "A responsive mobile first skin",
"skin-minerva-issue-learn-more": "Learn more",

View File

@ -64,6 +64,7 @@
"minerva-page-actions-uploads": "In the secondary page menu for user pages, the user uploads button label",
"minerva-page-actions-user-rights": "In the secondary page menu for user pages, the user rights button label",
"minerva-page-actions-logs": "In the secondary page menu for user pages, the user logs button label",
"minerva-page-actions-wikibase": "In the secondary page menu, the wikibase item button label",
"skinname-minerva": "{{name}}",
"minerva-skin-desc": "{{desc|name=Minerva Neue|url=https://www.mediawiki.org/wiki/Skin:Minerva_Neue|what=skin}}",
"skin-minerva-issue-learn-more": "Label for link that allows expanding of ambox issue templates.",

View File

@ -50,6 +50,7 @@ class DefaultOverflowBuilder implements IOverflowBuilder {
$this->buildEntry( 'info', 'info', 'info', $navUrls ),
$this->buildEntry( 'permalink', 'link', 'permalink', $navUrls ),
$this->buildEntry( 'backlinks', 'articleRedirect', 'whatlinkshere', $navUrls ),
$this->buildEntry( 'wikibase', 'logo-Wikidata', 'wikibase', $navUrls ),
$this->buildEntry( 'cite', 'quotes', 'citethispage', $navUrls )
] );

View File

@ -60,7 +60,7 @@ final class PageActionsDirector {
/**
* Build the menu data array that can be passed to views/javascript
* @param array $navUrls A set of navigation urls build by SkinTemplate::buildNavUrls()
* @param array $navUrls A set of navigation urls passed to the builder
* @param bool $doesHaveLangUrls Whether the page is also available in other languages or variants
* @return array
* @throws MWException

View File

@ -832,7 +832,7 @@ class SkinMinerva extends SkinTemplate {
/** @var \MediaWiki\Minerva\Menu\PageActions\PageActionsDirector $director */
$director = MediaWikiServices::getInstance()->getService( 'Minerva.Menu.PageActionsDirector' );
$tpl->set( 'page_actions',
$director->buildMenu( $tpl->data[ 'nav_urls'], $this->doesPageHaveLanguages )
$director->buildMenu( $tpl->getToolbox(), $this->doesPageHaveLanguages )
);
}