Plugin Directory


Ignore:
Timestamp:
02/02/2010 01:30:13 PM (16 years ago)
Author:
ShaneF
Message:

subdomain jQuery fix, added soap test when viewing analytics page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • woopra/trunk/inc/analytics.php

    r200971 r201033  
    1111 */
    1212class 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       
    2114    /**
    2215     * Display a notice telling the user to fill in their Woopra details
    2316     * @since 1.4.1
    24      * @param object $item
     17     * @param mixed $item
     18     * @param string $item
    2519     * @return none
    2620     */
    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       
    2929        echo $message[$item];
    3030    }
     
    4545     * @constructor
    4646     */
    47     function __construct() {
     47    function __construct($_woopra_tests) {
    4848        WoopraAdmin::__construct();
    4949        Woopra::__construct();
    5050                   
    5151        //  Load the API key into this Class
    52         $this->api_key = $this->get_option('api_key');
     52        $api_key = $this->get_option('api_key');
    5353       
    5454        ?>
     
    5858        <?php
    5959       
    60         if (empty($this->api_key)) {
     60        if (empty($api_key)) {
    6161            $this->analytics_warn(0);
     62        } else if ( is_wp_error($_woopra_tests) ) {
     63            $this->analytics_warn(false, $_woopra_tests->get_error_messages('soap-needed'));
    6264        } else {
    6365            /** HTML CODE START **/
Note: See TracChangeset for help on using the changeset viewer.