main-tabs.php
60 lines
| 1 | <?php |
| 2 | use cybot\cookiebot\settings\pages\Dashboard_Page; |
| 3 | use cybot\cookiebot\settings\pages\Settings_Page; |
| 4 | use cybot\cookiebot\addons\config\Settings_Config; |
| 5 | use cybot\cookiebot\settings\pages\Support_Page; |
| 6 | use cybot\cookiebot\settings\pages\Debug_Page; |
| 7 | |
| 8 | /** |
| 9 | * @var string $active_tab |
| 10 | */ |
| 11 | |
| 12 | $isnw = is_network_admin(); |
| 13 | ?> |
| 14 | <div class="cb-main__tabs"> |
| 15 | <?php if ( ! $isnw ) : ?> |
| 16 | <div class="cb-main__tabs_item <?php echo $active_tab === 'dashboard' ? 'active-item' : ''; ?>"> |
| 17 | <a href="<?php echo esc_url( add_query_arg( 'page', Dashboard_Page::ADMIN_SLUG, admin_url( 'admin.php' ) ) ); ?>" class="cb-main__tabs__link"> |
| 18 | <div class="cb-main__tabs__icon dashboard-icon"></div> |
| 19 | <span><?php esc_html_e( 'Dashboard', 'cookiebot' ); ?></span> |
| 20 | </a> |
| 21 | </div> |
| 22 | <?php endif; ?> |
| 23 | <div class="cb-main__tabs_item <?php echo $active_tab === 'settings' ? 'active-item' : ''; ?>"> |
| 24 | <?php if ( $isnw ) : ?> |
| 25 | <a href="<?php echo esc_url( add_query_arg( 'page', 'cookiebot_network', network_admin_url( 'admin.php' ) ) ); ?>" class="cb-main__tabs__link"> |
| 26 | <?php else : ?> |
| 27 | <a href="<?php echo esc_url( add_query_arg( 'page', Settings_Page::ADMIN_SLUG, admin_url( 'admin.php' ) ) ); ?>" class="cb-main__tabs__link"> |
| 28 | <?php endif; ?> |
| 29 | <div class="cb-main__tabs__icon settings-icon"></div> |
| 30 | <span><?php esc_html_e( 'Settings', 'cookiebot' ); ?></span> |
| 31 | </a> |
| 32 | </div> |
| 33 | <?php if ( ! $isnw ) : ?> |
| 34 | <div class="cb-main__tabs_item <?php echo $active_tab === 'addons' ? 'active-item' : ''; ?>"> |
| 35 | <a href="<?php echo esc_url( add_query_arg( 'page', Settings_Config::ADMIN_SLUG, admin_url( 'admin.php' ) ) ); ?>" class="cb-main__tabs__link"> |
| 36 | <div class="cb-main__tabs__icon plugins-icon"></div> |
| 37 | <span><?php esc_html_e( 'Plugins', 'cookiebot' ); ?></span> |
| 38 | </a> |
| 39 | </div> |
| 40 | <?php endif; ?> |
| 41 | <div class="cb-main__tabs_item <?php echo $active_tab === 'support' ? 'active-item' : ''; ?>"> |
| 42 | <?php if ( $isnw ) : ?> |
| 43 | <a href="<?php echo esc_url( add_query_arg( 'page', Support_Page::ADMIN_SLUG, network_admin_url( 'admin.php' ) ) ); ?>" class="cb-main__tabs__link"> |
| 44 | <?php else : ?> |
| 45 | <a href="<?php echo esc_url( add_query_arg( 'page', Support_Page::ADMIN_SLUG, admin_url( 'admin.php' ) ) ); ?>" class="cb-main__tabs__link"> |
| 46 | <?php endif; ?> |
| 47 | <div class="cb-main__tabs__icon support-icon"></div> |
| 48 | <span><?php esc_html_e( 'Support', 'cookiebot' ); ?></span> |
| 49 | </a> |
| 50 | </div> |
| 51 | <?php if ( ! $isnw ) : ?> |
| 52 | <div class="cb-main__tabs_item <?php echo $active_tab === 'debug' ? 'active-item' : ''; ?>"> |
| 53 | <a href="<?php echo esc_url( add_query_arg( 'page', Debug_Page::ADMIN_SLUG, admin_url( 'admin.php' ) ) ); ?>" class="cb-main__tabs__link"> |
| 54 | <div class="cb-main__tabs__icon debug-icon"></div> |
| 55 | <span><?php esc_html_e( 'Debug info', 'cookiebot' ); ?></span> |
| 56 | </a> |
| 57 | </div> |
| 58 | <?php endif; ?> |
| 59 | </div> |
| 60 |