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