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