Changeset 407210
- Timestamp:
- 07/09/2011 01:44:13 AM (15 years ago)
- Location:
- google-analyticator/trunk
- Files:
-
- 2 edited
-
google-analyticator.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
google-analyticator/trunk/google-analyticator.php
r407202 r407210 732 732 <td> 733 733 <?php 734 // sort the $ga_accounts array by ga:accountName and then title 735 $sorted_ga_accounts = array(); 736 foreach ($ga_accounts as $ga_account) { 737 $sorted_ga_accounts[$ga_account['ga:accountName']][] = $ga_account; 738 } 739 foreach( $sorted_ga_accounts as $id => $sorted_ga_account) { 740 usort($sorted_ga_accounts[$id], 'ga_sort_account_list'); 741 } 742 734 743 # Create a select box 735 744 echo '<select name="' . key_ga_uid . '" id="' . key_ga_uid . '">'; … … 737 746 738 747 # The list of accounts 739 foreach ( $ga_accounts AS $account ) { 740 $select = ( get_option(key_ga_uid) == $account['ga:webPropertyId'] ) ? ' selected="selected"' : ''; 741 echo '<option value="' . $account['ga:webPropertyId'] . '"' . $select . '>' . $account['title'] . '</option>'; 748 foreach ( $sorted_ga_accounts AS $account_name => $account_list ) { 749 echo "<optgroup label='".htmlentities($account_name)."'>\n"; 750 foreach( $account_list as $account) { 751 $select = ( get_option(key_ga_uid) == $account['ga:webPropertyId'] ) ? ' selected="selected"' : ''; 752 echo '<option value="' . $account['ga:webPropertyId'] . '"' . $select . '>' . $account['title'] . '</option>'; 753 } 754 echo "</optgroup>\n"; 742 755 } 743 756 … … 751 764 } 752 765 die(); 766 } 767 768 function ga_sort_account_list($a, $b) { 769 return strcmp($a['title'],$b['title']); 753 770 } 754 771 -
google-analyticator/trunk/readme.txt
r407202 r407210 52 52 53 53 = 6.2 = 54 * Adds a new option for site speed tracking (enabled by default) 55 * Replaces deprecated tracking code _setVar with _setCustomVar 54 * Adds a new option for site speed tracking (enabled by default). 55 * Replaces deprecated tracking code _setVar with _setCustomVar. 56 * Improves the account select dropdown by organizing the accounts. Props bluntly. 56 57 57 58 = 6.1.3 =
Note: See TracChangeset
for help on using the changeset viewer.