From ea54d476bb6061bf06baa1e85fe29950c86a5c87 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 22 Aug 2025 18:32:06 -0300 Subject: [PATCH] refactor: remove old button navigation and integrate into dropdown menu - Removed old button navigation from master dashboard - Added Google Sheets to Tools dropdown menu - Added Account dropdown with Trainer Dashboard and Logout options - Ensured all navigation links are properly integrated in the menu system - Master dashboard now uses consistent navigation with all other pages --- includes/class-hvac-master-menu-system.php | 29 ++++++++++++++++++++ templates/template-hvac-master-dashboard.php | 12 +------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/includes/class-hvac-master-menu-system.php b/includes/class-hvac-master-menu-system.php index 2b9912b3..12ad5760 100644 --- a/includes/class-hvac-master-menu-system.php +++ b/includes/class-hvac-master-menu-system.php @@ -155,6 +155,12 @@ class HVAC_Master_Menu_System { 'icon' => 'dashicons-admin-tools', 'cap' => 'manage_communication_templates', 'children' => array( + array( + 'title' => esc_html__('Google Sheets', 'hvac-community-events'), + 'url' => home_url('/master-trainer/google-sheets/'), + 'icon' => 'dashicons-media-spreadsheet', + 'cap' => 'manage_google_sheets_integration' + ), array( 'title' => esc_html__('Communication Templates', 'hvac-community-events'), 'url' => home_url('/master-trainer/communication-templates/'), @@ -176,6 +182,29 @@ class HVAC_Master_Menu_System { ) ), + // Account - User options + array( + 'title' => esc_html__('Account', 'hvac-community-events'), + 'url' => '#', + 'icon' => 'dashicons-admin-users', + 'cap' => 'read', + 'children' => array( + array( + 'title' => esc_html__('Trainer Dashboard', 'hvac-community-events'), + 'url' => home_url('/trainer/dashboard/'), + 'icon' => 'dashicons-dashboard', + 'cap' => 'read' + ), + array( + 'title' => esc_html__('Logout', 'hvac-community-events'), + 'url' => wp_logout_url(home_url('/training-login/')), + 'icon' => 'dashicons-exit', + 'cap' => 'read', + 'class' => 'menu-item-logout' + ) + ) + ), + // Help - Documentation array( 'title' => esc_html__('Help', 'hvac-community-events'), diff --git a/templates/template-hvac-master-dashboard.php b/templates/template-hvac-master-dashboard.php index 95039797..e15d6444 100644 --- a/templates/template-hvac-master-dashboard.php +++ b/templates/template-hvac-master-dashboard.php @@ -220,19 +220,9 @@ if ( isset( $_GET['error'] ) && $_GET['error'] === 'access_denied' ) { - +

Master Dashboard

-