mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 06:24:22 +00:00
Separate language portal from other portals in sidebar
This commit is contained in:
parent
22832841da
commit
193c027eb4
|
@ -115,7 +115,7 @@ class CitizenTemplate extends BaseTemplate {
|
|||
|
||||
/**
|
||||
* Render the navigation drawer
|
||||
* Based on Vector (be3843e)
|
||||
* Based on Vector
|
||||
* @return array
|
||||
* @throws MWException
|
||||
* @throws Exception
|
||||
|
@ -124,6 +124,7 @@ class CitizenTemplate extends BaseTemplate {
|
|||
$skin = $this->getSkin();
|
||||
$portals = $skin->buildSidebar();
|
||||
$props = [];
|
||||
$languages = null;
|
||||
|
||||
// Render portals
|
||||
foreach ( $portals as $name => $content ) {
|
||||
|
@ -138,17 +139,17 @@ class CitizenTemplate extends BaseTemplate {
|
|||
case 'SEARCH':
|
||||
break;
|
||||
case 'TOOLBOX':
|
||||
$portal = $this->getMenuData( 'tb', $this->getToolbox() );
|
||||
$portal = $this->getMenuData( 'tb', $content );
|
||||
$props[] = $portal;
|
||||
break;
|
||||
case 'LANGUAGES':
|
||||
$languages = $skin->getLanguages();
|
||||
$portal = $this->getMenuData( 'lang', $languages );
|
||||
$portal = $this->getMenuData( 'lang', $content );
|
||||
// The language portal will be added provided either
|
||||
// languages exist or there is a value in html-after-portal
|
||||
// for example to show the add language wikidata link (T252800)
|
||||
if ( $portal['html-after-portal'] || count( $languages ) ) {
|
||||
$props[] = $portal;
|
||||
if ( count( $content ) || $portal['html-after-portal'] ) {
|
||||
$languages = $portal;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -202,6 +203,7 @@ class CitizenTemplate extends BaseTemplate {
|
|||
'data-logo' => $this->buildLogo(),
|
||||
'data-portals-first' => $firstPortal,
|
||||
'array-portals-rest' => array_slice( $props, 1 ),
|
||||
'data-portals-languages' => $languages,
|
||||
'data-personal-menu' => $personalToolsPortal,
|
||||
];
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<section id="mw-drawer-menu-main">
|
||||
{{#data-portals-first}}{{>Menu}}{{/data-portals-first}}
|
||||
{{#array-portals-rest}}{{>Menu}}{{/array-portals-rest}}
|
||||
{{#data-portals-languages}}{{>Menu}}{{/data-portals-languages}}
|
||||
</section>
|
||||
<section id="mw-drawer-menu-user" class="mw-user-links">
|
||||
{{#data-personal-menu}}{{>Menu}}{{/data-personal-menu}}
|
||||
|
|
Loading…
Reference in a new issue