analytics
6 years ago
data
5 years ago
dialogs
5 years ago
general
5 years ago
permissions
5 years ago
privacy
5 years ago
recaptcha
5 years ago
unsubscribe
6 years ago
tab-accessibility.php
6 years ago
tab-analytics.php
5 years ago
tab-data.php
6 years ago
tab-general.php
5 years ago
tab-metrics.php
6 years ago
tab-palettes.php
5 years ago
tab-permissions.php
6 years ago
tab-privacy.php
6 years ago
tab-recaptcha.php
6 years ago
tab-unsubscribe.php
6 years ago
tab-analytics.php
131 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Analytics tab. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.0.0 |
| 7 | */ |
| 8 | |
| 9 | $settings = Hustle_Settings_Admin::get_dashboard_analytics_settings(); |
| 10 | $is_enabled = '1' === $settings['enabled']; |
| 11 | ?> |
| 12 | |
| 13 | <div id="analytics-box" class="sui-box hustle-settings-tab-analytics" data-tab="analytics" |
| 14 | <?php |
| 15 | if ( $section && 'analytics' !== $section ) { |
| 16 | echo 'style="display: none;"';} |
| 17 | ?> |
| 18 | > |
| 19 | |
| 20 | <div class="sui-box-header"> |
| 21 | <h2 class="sui-box-title"><?php esc_html_e( 'Dashboard Analytics Tracking', 'hustle' ); ?></h2> |
| 22 | </div> |
| 23 | |
| 24 | <form id="hustle-analytics-settings-form" class="sui-box-body"> |
| 25 | |
| 26 | <p><?php esc_html_e( "Add analytics tracking for your Hustle modules that doesn't require any third party integration, and display the data in the WordPress Admin Dashboard area.", 'hustle' ); ?> |
| 27 | |
| 28 | <?php if ( $is_enabled ) { ?> |
| 29 | |
| 30 | <div class="sui-box-settings-row"> |
| 31 | |
| 32 | <div class="sui-box-settings-col-2"> |
| 33 | |
| 34 | <?php |
| 35 | $this->get_html_for_options( |
| 36 | array( |
| 37 | array( |
| 38 | 'type' => 'inline_notice', |
| 39 | 'class' => 'sui-notice-success', |
| 40 | 'icon' => 'check-tick', |
| 41 | 'value' => esc_html__( 'Analytics tracking is enabled, and the widget is visible to the selected user roles in their dashboard.', 'hustle' ), |
| 42 | ), |
| 43 | ) |
| 44 | ); |
| 45 | ?> |
| 46 | |
| 47 | </div> |
| 48 | |
| 49 | </div> |
| 50 | |
| 51 | <?php |
| 52 | /** |
| 53 | * Widget Title. |
| 54 | */ |
| 55 | $this->render( |
| 56 | 'admin/settings/analytics/widget-title', |
| 57 | array( |
| 58 | 'value' => $settings['title'], |
| 59 | ) |
| 60 | ); |
| 61 | |
| 62 | /** |
| 63 | * User Role |
| 64 | */ |
| 65 | $this->render( |
| 66 | 'admin/settings/analytics/user-role', |
| 67 | array( |
| 68 | 'value' => array_keys( $settings['role'] ), |
| 69 | ) |
| 70 | ); |
| 71 | |
| 72 | /** |
| 73 | * Modules |
| 74 | */ |
| 75 | $this->render( |
| 76 | 'admin/settings/analytics/modules', |
| 77 | array( |
| 78 | 'values' => $settings['modules'], |
| 79 | ) |
| 80 | ); |
| 81 | |
| 82 | } else { |
| 83 | ?> |
| 84 | |
| 85 | <p> |
| 86 | <button |
| 87 | class="sui-button sui-button-blue hustle-settings-save" |
| 88 | data-enabled="1" |
| 89 | data-target="analytics" |
| 90 | > |
| 91 | <span class="sui-loading-text"><?php esc_html_e( 'Activate', 'hustle' ); ?></span> |
| 92 | <span class="sui-icon-loader sui-loading" aria-hidden="true"></span> |
| 93 | </button> |
| 94 | </p> |
| 95 | |
| 96 | <?php } ?> |
| 97 | |
| 98 | </form> |
| 99 | |
| 100 | <?php if ( $is_enabled ) { ?> |
| 101 | |
| 102 | <div class="sui-box-footer"> |
| 103 | |
| 104 | <button |
| 105 | class="sui-button sui-button-ghost hustle-settings-save" |
| 106 | data-enabled="0" |
| 107 | data-target="analytics" |
| 108 | > |
| 109 | <span class="sui-loading-text"><?php esc_html_e( 'Deactivate', 'hustle' ); ?></span> |
| 110 | <span class="sui-icon-loader sui-loading" aria-hidden="true"></span> |
| 111 | </button> |
| 112 | |
| 113 | <div class="sui-actions-right"> |
| 114 | |
| 115 | <button |
| 116 | class="sui-button sui-button-blue hustle-settings-save" |
| 117 | data-form-id="hustle-analytics-settings-form" |
| 118 | data-target="analytics" |
| 119 | > |
| 120 | <span class="sui-loading-text"><?php esc_html_e( 'Save Settings', 'hustle' ); ?></span> |
| 121 | <span class="sui-icon-loader sui-loading" aria-hidden="true"></span> |
| 122 | </button> |
| 123 | |
| 124 | </div> |
| 125 | |
| 126 | </div> |
| 127 | |
| 128 | <?php } ?> |
| 129 | |
| 130 | </div> |
| 131 |