mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-12-18 09:11:16 +00:00
refactor(core): ♻️ rename sidebar data to main menu
This commit is contained in:
parent
049366aaa9
commit
ce5532eb8c
|
@ -38,23 +38,23 @@ use NumberFormatter;
|
|||
*/
|
||||
final class Drawer extends Partial {
|
||||
/**
|
||||
* Decorate sidebar template data
|
||||
* Decorate main menu template data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function decorateSidebarData( $sidebarData ) {
|
||||
for ( $i = 0; $i < count( $sidebarData['array-portlets-rest'] ); $i++ ) {
|
||||
if ( $sidebarData['array-portlets-rest'][$i]['id'] === 'p-tb' ) {
|
||||
public function decorateMainMenuData( $mainMenuData ) {
|
||||
for ( $i = 0; $i < count( $mainMenuData['array-portlets-rest'] ); $i++ ) {
|
||||
if ( $mainMenuData['array-portlets-rest'][$i]['id'] === 'p-tb' ) {
|
||||
// Remove toolbox since it is handled by page tools
|
||||
unset( $sidebarData['array-portlets-rest'][$i] );
|
||||
unset( $mainMenuData['array-portlets-rest'][$i] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset index after unsetting toolbox
|
||||
$sidebarData['array-portlets-rest'] = array_values( $sidebarData['array-portlets-rest'] );
|
||||
$mainMenuData['array-portlets-rest'] = array_values( $mainMenuData['array-portlets-rest'] );
|
||||
|
||||
return $sidebarData;
|
||||
return $mainMenuData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -116,7 +116,7 @@ class SkinCitizen extends SkinMustache {
|
|||
'msg-citizen-footer-tagline' => $this->msg( "citizen-footer-tagline" )->inContentLanguage()->parse(),
|
||||
// Decorate data provided by core
|
||||
'data-search-box' => $header->decorateSearchBoxData( $parentData['data-search-box'] ),
|
||||
'data-portlets-sidebar' => $drawer->decorateSidebarData( $parentData['data-portlets-sidebar'] ),
|
||||
'data-main-menu' => $drawer->decorateMainMenuData( $parentData['data-portlets-sidebar'] ),
|
||||
'data-footer' => $footer->decorateFooterData( $parentData['data-footer'] ),
|
||||
];
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
<div class="mw-logo-wordmark">{{msg-sitetitle}}</div>
|
||||
</div>
|
||||
</header>
|
||||
{{#data-portlets-sidebar}}
|
||||
{{#data-main-menu}}
|
||||
<section class="citizen-drawer__menu">
|
||||
{{#data-portlets-first}}{{>Menu}}{{/data-portlets-first}}
|
||||
{{#array-portlets-rest}}{{>Menu}}{{/array-portlets-rest}}
|
||||
</section>
|
||||
{{/data-portlets-sidebar}}
|
||||
{{/data-main-menu}}
|
||||
</aside>
|
||||
</div>
|
Loading…
Reference in a new issue