available-addons
3 years ago
jetpack-widgets
3 years ago
other-addons
3 years ago
partials
3 years ago
unavailable-addons
3 years ago
page.php
3 years ago
page.php
69 lines
| 1 | <?php |
| 2 | use cybot\cookiebot\settings\templates\Header; |
| 3 | use cybot\cookiebot\settings\templates\Main_Tabs; |
| 4 | |
| 5 | use cybot\cookiebot\lib\Settings_Page_Tab; |
| 6 | |
| 7 | /** |
| 8 | * @var Settings_Page_Tab[] $settings_page_tabs |
| 9 | * @var Settings_Page_Tab $active_tab |
| 10 | */ |
| 11 | |
| 12 | $header = new Header(); |
| 13 | $main_tabs = new Main_Tabs(); |
| 14 | $jetpack_enabled = isset( get_option( 'cookiebot_available_addons' )['jetpack']['enabled'] ) && get_option( 'cookiebot_available_addons' )['jetpack']['enabled']; |
| 15 | |
| 16 | $header->display(); |
| 17 | ?> |
| 18 | <div class="cb-body"> |
| 19 | <div class="cb-wrapper"> |
| 20 | <?php $main_tabs->display( 'addons' ); ?> |
| 21 | <div class="cb-main__content"> |
| 22 | <form method="post" action="options.php" class="<?php echo esc_attr( $active_tab->get_name() ); ?>"> |
| 23 | <div class="cb-settings__header"> |
| 24 | <h1 class="cb-main__page_title"><?php esc_html_e( 'Plugins', 'cookiebot' ); ?></h1> |
| 25 | <?php |
| 26 | if ( $active_tab->has_submit_button() ) { |
| 27 | if ( $active_tab->get_name() === 'jetpack' ) { |
| 28 | if ( $jetpack_enabled ) { |
| 29 | submit_button(); |
| 30 | } |
| 31 | } else { |
| 32 | submit_button(); |
| 33 | } |
| 34 | } |
| 35 | ?> |
| 36 | </div> |
| 37 | |
| 38 | <div class="cb-settings__tabs"> |
| 39 | <?php foreach ( $settings_page_tabs as $settings_page_tab ) : ?> |
| 40 | <a href="<?php echo esc_url( $settings_page_tab->get_tab_href() ); ?>" class="cb-settings__tabs__item <?php echo esc_attr( $settings_page_tab->get_classes() ); ?>"> |
| 41 | <?php echo esc_html( $settings_page_tab->get_label() ); ?> |
| 42 | </a> |
| 43 | <?php endforeach; ?> |
| 44 | </div> |
| 45 | |
| 46 | <div class="cb-settings__tabs__content"> |
| 47 | <div class="cb-settings__tabs__content--item"> |
| 48 | |
| 49 | <?php |
| 50 | settings_fields( $active_tab->get_settings_fields_option_group() ); |
| 51 | do_settings_sections( $active_tab->get_page_name() ); |
| 52 | if ( $active_tab->has_submit_button() ) { |
| 53 | if ( $active_tab->get_name() === 'jetpack' ) { |
| 54 | if ( $jetpack_enabled ) { |
| 55 | submit_button(); |
| 56 | } |
| 57 | } else { |
| 58 | submit_button(); |
| 59 | } |
| 60 | } |
| 61 | ?> |
| 62 | |
| 63 | </div> |
| 64 | </div> |
| 65 | </form> |
| 66 | </div> |
| 67 | </div> |
| 68 | </div> |
| 69 |