templates
3 years ago
ga-accounts-selector.php
4 years ago
ga-auth-button.php
4 years ago
ga-code.php
4 years ago
ga-dashboard-widget.php
4 years ago
ga-debug-modal.php
4 years ago
ga-ga4-settings.php
3 years ago
ga-googleanalytics-loader.php
4 years ago
ga-notice.php
3 years ago
ga-oauth-notice.php
4 years ago
ga-wp-notice.php
4 years ago
page.php
3 years ago
statistics.php
3 years ago
stats.php
3 years ago
trending.php
4 years ago
ga-auth-button.php
36 lines
| 1 | <?php |
| 2 | /** |
| 3 | * GA Auth Button view. |
| 4 | * |
| 5 | * @package GoogleAnalytics |
| 6 | */ |
| 7 | |
| 8 | // Template partial fallback values. |
| 9 | $label = isset( $label ) ? $label : ''; |
| 10 | $manually_id = isset( $manually_id ) ? $manually_id : ''; |
| 11 | $button_type = isset( $button_type ) ? $button_type : ''; |
| 12 | $url = isset( $url ) ? $url : ''; |
| 13 | $classes = array(); |
| 14 | |
| 15 | // Determine button classes. |
| 16 | if ( 'auth' === $button_type ) { |
| 17 | $classes[] = 'button-primary'; |
| 18 | } else { |
| 19 | $classes[] = 'button-secondary'; |
| 20 | } |
| 21 | ?> |
| 22 | <button id="ga_authorize_with_google_button" |
| 23 | class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>" |
| 24 | <?php if ( true === Ga_Helper::are_features_enabled() ) : ?> |
| 25 | onclick="ga_popup.authorize( event, '<?php echo esc_attr( $url ); ?>' )" |
| 26 | <?php endif; ?> |
| 27 | <?php |
| 28 | echo disabled( |
| 29 | false === empty( $manually_id ) |
| 30 | || false === Ga_Helper::are_features_enabled() |
| 31 | || true === Ga_Helper::is_curl_disabled() |
| 32 | ); |
| 33 | ?> |
| 34 | ><?php echo esc_html( $label ); ?> |
| 35 | </button> |
| 36 |