| 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 |
|
| 42 |
<?php do_action('notifier_after_settings_fields_form', $current_tab); ?> |
| 43 |
|
| 44 |
</div> |
| 45 |
</div> |
| 46 |
|