| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: Settings |
| 4 |
* |
| 5 |
* @package Notifier |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
?> |
| 12 |
<div class="wrap notifier"> |
| 13 |
<div class="notifier-wrapper"> |
| 14 |
<?php |
| 15 |
$current_tab = isset($_GET['tab']) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'general'; |
| 16 |
$settings_tabs = Notifier_Settings::get_settings_tabs(); |
| 17 |
echo '<h2 class="nav-tab-wrapper">'; |
| 18 |
foreach ( $settings_tabs as $tab_key => $name ) { |
| 19 |
$class = ( $tab_key == $current_tab ) ? ' nav-tab-active' : ''; |
| 20 |
echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=notifier-settings&tab=' . esc_attr( $tab_key ) . '">' . esc_html($name) . '</a>'; |
| 21 |
} |
| 22 |
echo '</h2>'; |
| 23 |
?> |
| 24 |
|
| 25 |
<?php do_action('notifier_before_settings_fields_form', $current_tab); ?> |
| 26 |
|
| 27 |
<form method="POST" id="notifier_settings_form" class="notifier-settings-form notifier-settings-form-<?php echo esc_attr( $current_tab ); ?>" action="" enctype="multipart/form-data"> |
| 28 |
|
| 29 |
<?php do_action('notifier_before_settings_fields', $current_tab); ?> |
| 30 |
|
| 31 |
<?php Notifier_Settings::show_settings_fields($current_tab); ?> |
| 32 |
|
| 33 |
<p class="submit"> |
| 34 |
<button name="save" class="button-primary notifier-save-button" type="submit" value="">Save changes</button> |
| 35 |
<?php wp_nonce_field( NOTIFIER_NAME . '-settings' ); ?> |
| 36 |
</p> |
| 37 |
|
| 38 |
<?php do_action('notifier_after_settings_fields', $current_tab); ?> |
| 39 |
|
| 40 |
</form> |
| 41 |
<?php if($current_tab === 'click_to_chat'): ?> |
| 42 |
<?php $btn_style = get_option('notifier_ctc_button_style');?> |
| 43 |
<div class="notifier-btn-preview-wrap"> |
| 44 |
<?php |
| 45 |
if($btn_style){ |
| 46 |
if($btn_style == 'btn-custom-image'){ |
| 47 |
echo '<style>.notifier-fields-table .notifier-chat-btn-image-url{display:table-row;}</style>'; |
| 48 |
} |
| 49 |
|
| 50 |
if($btn_style !== 'default'){ |
| 51 |
include_once NOTIFIER_PATH.'templates/buttons/'.$btn_style.'.php'; |
| 52 |
} |
| 53 |
} |
| 54 |
?> |
| 55 |
</div> |
| 56 |
<?php endif; ?> |
| 57 |
|
| 58 |
<?php do_action('notifier_after_settings_fields_form', $current_tab); ?> |
| 59 |
|
| 60 |
</div> |
| 61 |
</div> |
| 62 |
|