Changeset 201033 for woopra/trunk/inc/analytics.php
- Timestamp:
- 02/02/2010 01:30:13 PM (16 years ago)
- File:
-
- 1 edited
-
woopra/trunk/inc/analytics.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woopra/trunk/inc/analytics.php
r200971 r201033 11 11 */ 12 12 class WoopraAnalytics extends WoopraAdmin { 13 14 /** 15 * Your Site API Key 16 * @since 1.4.1 17 * @var string 18 */ 19 var $api_key; 20 13 21 14 /** 22 15 * Display a notice telling the user to fill in their Woopra details 23 16 * @since 1.4.1 24 * @param object $item 17 * @param mixed $item 18 * @param string $item 25 19 * @return none 26 20 */ 27 function analytics_warn($item) { 28 $message[0] = '<div class="error"><p>' . sprintf( __( 'You must fill in your API Key in order to view Analytics. Please fill it out on the <a href="%s">settings page</a> in order for you to view your analytics.', 'woopra' ), admin_url('options-general.php?page=woopra') ) . "</p></div>\n"; 21 function analytics_warn($item, $custom = '') { 22 if ($item == false) { 23 echo '<div class="error"><p>' . $custom[0] . "</p></div>\n"; 24 return; 25 } else { 26 $message[0] = '<div class="error"><p>' . sprintf( __( 'You must fill in your API Key in order to view Analytics. Please fill it out on the <a href="%s">settings page</a> in order for you to view your analytics.', 'woopra' ), admin_url('options-general.php?page=woopra') ) . "</p></div>\n"; 27 } 28 29 29 echo $message[$item]; 30 30 } … … 45 45 * @constructor 46 46 */ 47 function __construct( ) {47 function __construct($_woopra_tests) { 48 48 WoopraAdmin::__construct(); 49 49 Woopra::__construct(); 50 50 51 51 // Load the API key into this Class 52 $ this->api_key = $this->get_option('api_key');52 $api_key = $this->get_option('api_key'); 53 53 54 54 ?> … … 58 58 <?php 59 59 60 if (empty($ this->api_key)) {60 if (empty($api_key)) { 61 61 $this->analytics_warn(0); 62 } else if ( is_wp_error($_woopra_tests) ) { 63 $this->analytics_warn(false, $_woopra_tests->get_error_messages('soap-needed')); 62 64 } else { 63 65 /** HTML CODE START **/
Note: See TracChangeset
for help on using the changeset viewer.