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