ga_accounts_selector.php
9 years ago
ga_code.php
9 years ago
ga_dashboard_widget.php
9 years ago
ga_notice.php
9 years ago
ga_oauth_notice.php
9 years ago
ga_wp_notice.php
9 years ago
page.php
9 years ago
statistics.php
9 years ago
stats.php
9 years ago
page.php
158 lines
| 1 | <div id="ga_access_code_modal" class="ga-modal" tabindex="-1"> |
| 2 | <div class="ga-modal-dialog"> |
| 3 | <div class="ga-modal-content"> |
| 4 | <div class="ga-modal-header"> |
| 5 | <span id="ga_close" class="ga-close">×</span> |
| 6 | <h4 class="ga-modal-title"><?php _e( 'Please paste the access code obtained from Google below:' ) ?></h4> |
| 7 | </div> |
| 8 | <div class="ga-modal-body"> |
| 9 | <label for="ga_access_code"><strong><?php _e( 'Access Code' ); ?></strong>:</label> |
| 10 | <input id="ga_access_code_tmp" type="text" |
| 11 | placeholder="<?php _e( 'Paste your access code here' ) ?>"/> |
| 12 | <div class="ga-loader-wrapper"> |
| 13 | <div class="ga-loader"></div> |
| 14 | </div> |
| 15 | </div> |
| 16 | <div class="ga-modal-footer"> |
| 17 | <button id="ga_btn_close" type="button" class="button"><?php _e( 'Close' ); ?></button> |
| 18 | <button type="button" class="button-primary" |
| 19 | id="ga_save_access_code" |
| 20 | onclick="ga_popup.saveAccessCode( event )"><?php _e( 'Save Changes' ); ?></button> |
| 21 | </div> |
| 22 | </div><!-- /.modal-content --> |
| 23 | </div><!-- /.modal-dialog --> |
| 24 | </div><!-- /.modal --> |
| 25 | |
| 26 | <div class="wrap ga-wrap"> |
| 27 | <h2>Google Analytics - <?php _e( 'Settings' ); ?></h2> |
| 28 | <div class="ga_container"> |
| 29 | <?php if ( ! empty( $data['error_message'] ) ) : ?> |
| 30 | <?php echo $data['error_message']; ?> |
| 31 | <?php endif; ?> |
| 32 | <form id="ga_form" method="post" action="options.php"> |
| 33 | <?php settings_fields( 'googleanalytics' ); ?> |
| 34 | <input id="ga_access_code" type="hidden" |
| 35 | name="<?php echo esc_attr( Ga_Admin::GA_OAUTH_AUTH_CODE_OPTION_NAME ); ?>" value=""/> |
| 36 | <table class="form-table"> |
| 37 | <tr valign="top"> |
| 38 | <?php if ( ! empty( $data['popup_url'] ) ): ?> |
| 39 | <th scope="row"> |
| 40 | <label <?php echo ( ! Ga_Helper::are_terms_accepted() ) ? 'class="label-grey ga-tooltip"' : '' ?>><?php echo _e( 'Google Profile' ) ?> |
| 41 | : |
| 42 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( 'Please accept the terms to use this feature' ); ?></span> |
| 43 | </label> |
| 44 | </th> |
| 45 | <td <?php echo ( ! Ga_Helper::are_terms_accepted() ) ? 'class="ga-tooltip"' : ''; ?>> |
| 46 | <button id="ga_authorize_with_google_button" class="button-primary" |
| 47 | <?php if ( Ga_Helper::are_terms_accepted() ) : ?> |
| 48 | onclick="ga_popup.authorize( event, '<?php echo esc_attr( $data['popup_url'] ); ?>' )" |
| 49 | <?php endif; ?> |
| 50 | <?php echo( ( esc_attr( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] ) || ! Ga_Helper::are_terms_accepted() ) ? 'disabled="disabled"' : '' ); ?> |
| 51 | ><?php _e( 'Authenticate |
| 52 | with Google' ) ?> |
| 53 | </button> |
| 54 | <span class="ga-tooltiptext"><?php _e( 'Please accept the terms to use this feature' ); ?></span> |
| 55 | <?php if ( ! empty( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] ) ): ?> |
| 56 | <div class="ga_warning"> |
| 57 | <strong><?php _e( 'Notice' ) ?></strong>: <?php _e( 'Please uncheck the "Manually enter Tracking ID" option to authenticate and view statistics.' ); ?> |
| 58 | </div> |
| 59 | <?php endif; ?> |
| 60 | </td> |
| 61 | <?php endif; ?> |
| 62 | |
| 63 | <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?> |
| 64 | <th scope="row"><?php echo _e( 'Google Analytics Account' ) ?>:</th> |
| 65 | <td><?php echo $data['ga_accounts_selector']; ?></td> |
| 66 | <?php endif; ?> |
| 67 | |
| 68 | </tr> |
| 69 | |
| 70 | <tr valign="top"> |
| 71 | |
| 72 | <th scope="row"> |
| 73 | <div class="checkbox"> |
| 74 | <label class="ga_checkbox_label <?php echo ( ! Ga_Helper::are_terms_accepted() ) ? 'label-grey ga-tooltip' : '' ?>" |
| 75 | for="ga_enter_code_manually"> <input |
| 76 | <?php if ( Ga_Helper::are_terms_accepted() ) : ?> |
| 77 | onclick="ga_events.click( this, ga_events.codeManuallyCallback( <?php echo Ga_Helper::are_terms_accepted() ? 1 : 0; ?> ) )" |
| 78 | <?php endif; ?> |
| 79 | type="checkbox" |
| 80 | <?php echo ( ! Ga_Helper::are_terms_accepted() ) ? 'disabled="disabled"' : ''; ?> |
| 81 | name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ); ?>" |
| 82 | id="ga_enter_code_manually" |
| 83 | value="1" |
| 84 | <?php echo( ( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] || ! Ga_Helper::are_terms_accepted() ) ? 'checked="checked"' : '' ); ?>/> |
| 85 | <?php _e( 'Manually enter Tracking ID' ) ?> |
| 86 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( 'Please accept the terms to use this feature' ); ?></span> |
| 87 | </label> |
| 88 | <?php if ( ! Ga_Helper::are_terms_accepted() ) : ?> |
| 89 | <input id="ga_access_code" type="hidden" |
| 90 | name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ); ?>" |
| 91 | value="1"/> |
| 92 | <?php endif; ?> |
| 93 | </div> |
| 94 | </th> |
| 95 | <td></td> |
| 96 | </tr> |
| 97 | <tr valign="top" |
| 98 | id="ga_manually_wrapper" <?php echo( ( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] || ! Ga_Helper::are_terms_accepted() ) ? '' : 'style="display: none"' ); ?> > |
| 99 | |
| 100 | <th scope="row"><?php _e( 'Tracking ID' ) ?>:</th> |
| 101 | <td> |
| 102 | <input type="text" |
| 103 | name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_VALUE_OPTION_NAME ); ?>" |
| 104 | value="<?php echo esc_attr( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_VALUE_OPTION_NAME ] ); ?>" |
| 105 | id="ga_manually_input"/> |
| 106 | <div class="ga_warning"> |
| 107 | <strong><?php _e( 'Warning' ); ?></strong>: <?php _e( 'If you enter your Tracking ID manually, Analytics statistics will not be shown.' ); ?> |
| 108 | <br> |
| 109 | <?php _e( 'We strongly recommend to authenticate with Google using the button above.' ); ?> |
| 110 | </div> |
| 111 | </td> |
| 112 | |
| 113 | </tr> |
| 114 | |
| 115 | <tr valign="top"> |
| 116 | <th scope="row"> |
| 117 | <label <?php echo ( ! Ga_Helper::are_terms_accepted() ) ? 'class="label-grey ga-tooltip"' : '' ?>><?php _e( 'Exclude Tracking for Roles' ) ?> |
| 118 | : |
| 119 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( 'Please accept the terms to use this feature' ); ?></span> |
| 120 | </label> |
| 121 | </th> |
| 122 | <td> |
| 123 | |
| 124 | |
| 125 | <?php |
| 126 | if ( ! empty( $data['roles'] ) ) { |
| 127 | $roles = $data['roles']; |
| 128 | foreach ( $roles as $role ) { |
| 129 | ?> |
| 130 | <div class="checkbox"> |
| 131 | <label class="ga_checkbox_label <?php echo ( ! Ga_Helper::are_terms_accepted() ) ? 'label-grey ga-tooltip' : ''; ?>" |
| 132 | for="checkbox_<?php echo $role['id']; ?>"> |
| 133 | <input id="checkbox_<?php echo $role['id']; ?>" type="checkbox" |
| 134 | <?php echo ( ! Ga_Helper::are_terms_accepted() ) ? 'disabled="disabled"' : ''; ?> |
| 135 | name="<?php echo esc_attr( Ga_Admin::GA_EXCLUDE_ROLES_OPTION_NAME . "[" . $role['id'] . "]" ); ?>" |
| 136 | id="<?php echo esc_attr( $role['id'] ); ?>" |
| 137 | <?php echo esc_attr( ( $role['checked'] ? 'checked="checked"' : '' ) ); ?> /> |
| 138 | <?php echo esc_html( $role['name'] ); ?> |
| 139 | <span class="ga-tooltiptext"><?php _e( 'Please accept the terms to use this feature' ); ?></span> |
| 140 | </label> |
| 141 | </div> |
| 142 | <?php |
| 143 | } |
| 144 | } |
| 145 | ?> |
| 146 | |
| 147 | </td> |
| 148 | </tr> |
| 149 | |
| 150 | </table> |
| 151 | |
| 152 | <p class="submit"> |
| 153 | <input type="submit" class="button-primary" |
| 154 | value="<?php _e( 'Save Changes' ) ?>"/> |
| 155 | </p> |
| 156 | </form> |
| 157 | </div> |
| 158 | </div> |