| 1 |
<?php |
| 2 |
/** |
| 3 |
* Nav dashboard |
| 4 |
* |
| 5 |
* @package |
| 6 |
*/ |
| 7 |
use WPFunnels\Wpfnl_functions; |
| 8 |
|
| 9 |
$nav_menus = apply_filters('wpfnl_dashboard_nav_lists', [ |
| 10 |
'dashboard' => [ |
| 11 |
'title' => __('Dashboard', 'wpfnl'), |
| 12 |
'icon' => 'dashboard-icon', |
| 13 |
'page' => WPFNL_MAIN_PAGE_SLUG, |
| 14 |
], |
| 15 |
'overview' => [ |
| 16 |
'title' => __('Funnels', 'wpfnl'), |
| 17 |
'icon' => 'overview-icon', |
| 18 |
'page' => WPFNL_FUNNEL_PAGE_SLUG, |
| 19 |
], |
| 20 |
'store_checkout' => [ |
| 21 |
'title' => __('Store Checkout', 'wpfnl'), |
| 22 |
'icon' => 'storewide-checkout-icon', |
| 23 |
'page' => 'store_checkout', |
| 24 |
], |
| 25 |
'automations' => [ |
| 26 |
'title' => __('Automations', 'wpfnl'), |
| 27 |
'icon' => 'automations-icon', |
| 28 |
'page' => WPFNL_AUTOMATIONS_SLUG, |
| 29 |
], |
| 30 |
'integrations' => [ |
| 31 |
'title' => __('Integrations', 'wpfnl'), |
| 32 |
'icon' => 'settings-icon-2x', |
| 33 |
'page' => WPFNL_INTEGRATIONS_MAIN_PAGE_SLUG, |
| 34 |
], |
| 35 |
'templates' => [ |
| 36 |
'title' => __('Templates', 'wpfnl'), |
| 37 |
'icon' => 'templates-icon', |
| 38 |
'page' => WPFNL_TEMPLATE_PAGE_SLUG, |
| 39 |
], |
| 40 |
// 'addons' => [ |
| 41 |
// 'title' => __('Add-ons', 'wpfnl'), |
| 42 |
// 'icon' => 'addons-icon', |
| 43 |
// 'page' => WPFNL_ADDONS_SLUG, |
| 44 |
// ], |
| 45 |
// Settings is not listed here — it is reached from the gear button in |
| 46 |
// the header action group rendered into #wpfnl-header-actions below. |
| 47 |
]); |
| 48 |
?> |
| 49 |
|
| 50 |
<ul class="wpfnl-dashboard__nav-ul"> |
| 51 |
<li class="logo"> |
| 52 |
<?php require_once WPFNL_DIR . '/admin/partials/icons/logo.php'; ?> |
| 53 |
</li> |
| 54 |
|
| 55 |
<?php |
| 56 |
foreach ($nav_menus as $key => $menu) { |
| 57 |
$is_active = Wpfnl_functions::define_active_class($key); |
| 58 |
$active_class = $is_active ? 'active' : ''; |
| 59 |
$link = add_query_arg( |
| 60 |
[ |
| 61 |
'page' => $menu['page'], |
| 62 |
], |
| 63 |
admin_url('admin.php') |
| 64 |
); |
| 65 |
if($key === 'create_funnel') $link='#'; ?> |
| 66 |
|
| 67 |
<li class="wpfnl-dashboard__nav-li <?php echo $key .' '. $active_class; ?>"> |
| 68 |
<a id="<?php echo "wpfnl-tab-".$key ?>" href="<?php echo esc_url($link); ?>"> |
| 69 |
<?php echo $menu['title']; ?> |
| 70 |
</a> |
| 71 |
</li> |
| 72 |
<?php |
| 73 |
} |
| 74 |
?> |
| 75 |
</ul> |
| 76 |
|
| 77 |
<!-- Header action group (Knowledge Base, AI Assistant, Settings, Upgrade). |
| 78 |
Rendered by admin/src/global-ai-drawer/HeaderActions.vue so every page |
| 79 |
that includes this nav gets the same right-hand controls. --> |
| 80 |
<div id="wpfnl-header-actions" class="wpfnl-dashboard__nav-right"></div> |
| 81 |
|