templates
3 years ago
ga-accounts-selector.php
4 years ago
ga-auth-button.php
3 years ago
ga-code.php
4 years ago
ga-dashboard-widget.php
4 years ago
ga-debug-modal.php
2 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
old-page.php
3 years ago
page.php
3 years ago
statistics.php
3 years ago
stats.php
2 years ago
trending.php
4 years ago
ga-accounts-selector.php
48 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Accounts Selector view. |
| 4 | * |
| 5 | * @package GoogleAnalytics |
| 6 | */ |
| 7 | |
| 8 | // Set add_manually_enabled fallback. |
| 9 | $add_manually_enabled = isset( $add_manually_enabled ) ? $add_manually_enabled : false; |
| 10 | |
| 11 | // Set selected value fallback. |
| 12 | $selected = isset( $selected ) ? $selected : ''; |
| 13 | ?> |
| 14 | <div class="wrap"> |
| 15 | <input type="hidden" name="<?php echo esc_attr( Ga_Admin::GA_SELECTED_ACCOUNT ); ?>" |
| 16 | value="<?php echo esc_attr( $selected ); ?>"> |
| 17 | <select id="ga_account_selector" |
| 18 | name="<?php echo esc_attr( Ga_Admin::GA_SELECTED_ACCOUNT ); ?>" |
| 19 | <?php echo disabled( true === $add_manually_enabled ); ?> |
| 20 | > |
| 21 | <option><?php echo esc_html__( 'Please select your Google Analytics account:', 'googleanalytics' ); ?></option> |
| 22 | <?php |
| 23 | if ( false === empty( $selector ) ) : |
| 24 | foreach ( $selector as $account ) : |
| 25 | ?> |
| 26 | <optgroup label="<?php echo esc_attr( $account['name'] ); ?>"> |
| 27 | <?php foreach ( $account['webProperties'] as $property ) : ?> |
| 28 | <?php |
| 29 | foreach ( $property['profiles'] as $profile ) : |
| 30 | $profile_value = $account['id'] . '_' . $property['webPropertyId'] . '_' . $profile['id']; |
| 31 | $profile_label = $property['name'] . ' [' . $property['webPropertyId'] . '][' . $profile['id'] . ']'; |
| 32 | ?> |
| 33 | <option value="<?php echo esc_attr( $profile_value ); ?>" |
| 34 | <?php echo selected( $selected, $profile_value ); ?> |
| 35 | > |
| 36 | <?php echo esc_html( $profile_label ); ?> |
| 37 | </option> |
| 38 | <?php endforeach; ?> |
| 39 | <?php endforeach; ?> |
| 40 | </optgroup> |
| 41 | <?php |
| 42 | endforeach; |
| 43 | endif; |
| 44 | ?> |
| 45 | </select> |
| 46 | </div> |
| 47 | |
| 48 |