From ce5532eb8c810712d6556102e6aabc1fe46805ca Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 8 May 2024 16:47:46 -0400 Subject: [PATCH] =?UTF-8?q?refactor(core):=20=E2=99=BB=EF=B8=8F=20rename?= =?UTF-8?q?=20sidebar=20data=20to=20main=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/Partials/Drawer.php | 14 +++++++------- includes/SkinCitizen.php | 2 +- templates/Drawer.mustache | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/Partials/Drawer.php b/includes/Partials/Drawer.php index dd848e03..ea7fbf2c 100644 --- a/includes/Partials/Drawer.php +++ b/includes/Partials/Drawer.php @@ -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; } /** diff --git a/includes/SkinCitizen.php b/includes/SkinCitizen.php index 46d38746..05a3b0c4 100644 --- a/includes/SkinCitizen.php +++ b/includes/SkinCitizen.php @@ -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'] ), ]; diff --git a/templates/Drawer.mustache b/templates/Drawer.mustache index 97d523cb..ad9618c6 100644 --- a/templates/Drawer.mustache +++ b/templates/Drawer.mustache @@ -20,11 +20,11 @@
{{msg-sitetitle}}
- {{#data-portlets-sidebar}} + {{#data-main-menu}}
{{#data-portlets-first}}{{>Menu}}{{/data-portlets-first}} {{#array-portlets-rest}}{{>Menu}}{{/array-portlets-rest}}
- {{/data-portlets-sidebar}} + {{/data-main-menu}} \ No newline at end of file