commons
1 month ago
dashboard
1 month ago
dialogs
1 month ago
email-lists
9 months ago
embedded
3 years ago
global
5 months ago
integrations
1 month ago
integrations-page
5 months ago
popup
3 years ago
settings
1 month ago
slidein
3 years ago
sshare
9 months ago
dashboard.php
1 month ago
entries.php
2 years ago
image-markup.php
3 years ago
integrations.php
1 month ago
settings.php
1 month ago
tutorials.php
3 years ago
upsell.php
2 years ago
widget-analytics.php
3 years ago
settings.php
163 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Main wrapper for the Settings page. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.0.0 |
| 7 | */ |
| 8 | |
| 9 | $sections = array( |
| 10 | 'general' => array( |
| 11 | 'label' => __( 'General', 'hustle' ), |
| 12 | 'data' => array( |
| 13 | 'settings' => Hustle_Settings_Admin::get_general_settings(), |
| 14 | ), |
| 15 | ), |
| 16 | 'palettes' => array( |
| 17 | 'label' => __( 'Color Palettes', 'hustle' ), |
| 18 | 'data' => array( |
| 19 | 'palettes' => Hustle_Settings_Admin::get_custom_color_palettes(), |
| 20 | ), |
| 21 | ), |
| 22 | 'analytics' => array( |
| 23 | 'label' => __( 'Dashboard Analytics', 'hustle' ), |
| 24 | ), |
| 25 | 'data' => array( |
| 26 | 'label' => __( 'Data', 'hustle' ), |
| 27 | ), |
| 28 | 'privacy' => array( |
| 29 | 'label' => __( 'Viewer\'s Privacy', 'hustle' ), |
| 30 | ), |
| 31 | 'permissions' => array( |
| 32 | 'label' => __( 'Permissions', 'hustle' ), |
| 33 | ), |
| 34 | 'recaptcha' => array( |
| 35 | 'label' => __( 'reCAPTCHA', 'hustle' ), |
| 36 | 'data' => array( |
| 37 | 'settings' => Hustle_Settings_Admin::get_recaptcha_settings(), |
| 38 | ), |
| 39 | ), |
| 40 | 'turnstile' => array( |
| 41 | 'label' => __( 'Cloudflare Turnstile', 'hustle' ), |
| 42 | 'data' => array( |
| 43 | 'settings' => Hustle_Settings_Admin::get_turnstile_settings(), |
| 44 | ), |
| 45 | ), |
| 46 | 'accessibility' => array( |
| 47 | 'label' => __( 'Accessibility', 'hustle' ), |
| 48 | 'data' => array( |
| 49 | 'settings' => Hustle_Settings_Admin::get_hustle_settings( 'accessibility' ), |
| 50 | ), |
| 51 | ), |
| 52 | 'metrics' => array( |
| 53 | 'label' => __( 'Top Metrics', 'hustle' ), |
| 54 | 'data' => array( |
| 55 | 'stored_metrics' => Hustle_Settings_Admin::get_top_metrics_settings(), |
| 56 | ), |
| 57 | ), |
| 58 | 'unsubscribe' => array( |
| 59 | 'label' => __( 'Unsubscribe', 'hustle' ), |
| 60 | ), |
| 61 | ); |
| 62 | ?> |
| 63 | |
| 64 | <div class="sui-header"> |
| 65 | <h1 class="sui-header-title"><?php esc_html_e( 'Settings', 'hustle' ); ?></h1> |
| 66 | <?php $this->render( 'admin/commons/view-documentation', array( 'docs_section' => 'settings' ) ); ?> |
| 67 | </div> |
| 68 | |
| 69 | <div id="hustle-floating-notifications-wrapper" class="sui-floating-notices"></div> |
| 70 | |
| 71 | <div class="sui-row-with-sidenav"> |
| 72 | |
| 73 | <div class="sui-sidenav"> |
| 74 | |
| 75 | <ul class="sui-vertical-tabs sui-sidenav-hide-md"> |
| 76 | <?php |
| 77 | foreach ( $sections as $key => $value ) { |
| 78 | |
| 79 | $classes = array( |
| 80 | 'sui-vertical-tab', |
| 81 | ); |
| 82 | |
| 83 | if ( $section === $key ) { |
| 84 | $classes[] = 'current'; |
| 85 | } |
| 86 | |
| 87 | printf( |
| 88 | '<li class="%s"><a href="#" data-tab="%s">%s</a></li>', |
| 89 | esc_attr( implode( ' ', $classes ) ), |
| 90 | esc_attr( $key ), |
| 91 | esc_html( $value['label'] ) |
| 92 | ); |
| 93 | } |
| 94 | ?> |
| 95 | </ul> |
| 96 | |
| 97 | <div class="sui-sidenav-hide-lg"> |
| 98 | |
| 99 | <label class="sui-label" id="sui-wizard-navigation-label"><?php esc_html_e( 'Navigate', 'hustle' ); ?></label> |
| 100 | |
| 101 | <select class="sui-mobile-nav" style="margin-bottom: 20px;" aria-labelledby="sui-wizard-navigation-label"> |
| 102 | <?php |
| 103 | foreach ( $sections as $key => $value ) { |
| 104 | |
| 105 | printf( |
| 106 | '<option value="%1$s" %2$s>%3$s</option>', |
| 107 | esc_attr( $key ), |
| 108 | selected( $section, $key, false ), |
| 109 | esc_html( $value['label'] ) |
| 110 | ); |
| 111 | |
| 112 | } |
| 113 | ?> |
| 114 | </select> |
| 115 | |
| 116 | </div> |
| 117 | |
| 118 | </div> |
| 119 | |
| 120 | <?php |
| 121 | foreach ( $sections as $key => $value ) { |
| 122 | |
| 123 | if ( ! empty( $value['status'] ) && 'hide' === $value['status'] ) { |
| 124 | continue; |
| 125 | } |
| 126 | |
| 127 | $data = isset( $value['data'] ) ? $value['data'] : array(); |
| 128 | $data['section'] = $section; |
| 129 | $template = sprintf( 'admin/settings/tab-%s', esc_attr( $key ) ); |
| 130 | |
| 131 | $this->render( $template, $data ); |
| 132 | } |
| 133 | ?> |
| 134 | |
| 135 | </div> |
| 136 | |
| 137 | <?php |
| 138 | // Global Footer. |
| 139 | $this->render( 'admin/global/sui-components/sui-footer' ); |
| 140 | |
| 141 | // DIALOG: Delete. |
| 142 | $this->render( 'admin/commons/sui-listing/dialogs/delete-module' ); |
| 143 | |
| 144 | // DIALOG: Delete All IPs. |
| 145 | $this->render( 'admin/settings/dialogs/privacy-ip-delete' ); |
| 146 | |
| 147 | // DIALOG: Dissmiss migrate tracking notice modal confirmation. |
| 148 | if ( Hustle_Notifications::is_show_migrate_tracking_notice() ) { |
| 149 | $this->render( 'admin/dialogs/migrate-dismiss-confirmation' ); |
| 150 | } |
| 151 | |
| 152 | // DIALOG: Data -> Reset plugin. |
| 153 | $this->render( 'admin/settings/dialogs/data-reset-data-dialog' ); |
| 154 | |
| 155 | // DIALOG: Palettes -> Edit palette. |
| 156 | $this->render( |
| 157 | 'admin/settings/dialogs/palettes-edit-palette', |
| 158 | array( |
| 159 | 'palettes' => Hustle_Palettes_Helper::get_all_palettes_slug_and_name(), |
| 160 | ) |
| 161 | ); |
| 162 | ?> |
| 163 |