gglnltcs_print_tab_content

The BestWebSoft Google Analytics gglnltcs print tab content function.

Description

gglnltcs_print_tab_content(); 

Usage

  1. if ( !function_exists( 'gglnltcs_print_tab_content' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bestwebsoft-google-analytics/bws-google-analytics.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gglnltcs_print_tab_content(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bws-google-analytics.php  
  1. function gglnltcs_print_tab_content() { 
  2. global $gglnltcs_options; 
  3. /** check ajax value */ 
  4. check_ajax_referer( 'gglnltcs_ajax_nonce_value', 'gglnltcs_nonce' ); 
  5. /** Get options from the database and set them to the global array */ 
  6. /** Get access token from the global array */ 
  7. $access_token = $gglnltcs_options['token']; 
  8. /** Google Client Stuff */ 
  9. require_once 'google-api-php-client/api-code/Google_Client.php'; 
  10. require_once 'google-api-php-client/api-code/contrib/Google_AnalyticsService.php'; 
  11. $client = new Google_Client(); 
  12. $client->setApplicationName( 'BestWebSoft Google Analytics' ); 
  13. $client->setClientId( '714548546682-ai821bsdfn2th170q8ofprgfmh5ch7cn.apps.googleusercontent.com' ); 
  14. $client->setClientSecret( 'pyBXulcOqPhQGzKiW4kehZZB' ); 
  15. $client->setRedirectUri( 'urn:ietf:wg:oauth:2.0:oob' ); 
  16. $client->setDeveloperKey( 'AIzaSyDA7L2CZgY4ud4vv6rw0Yu4GUDyfbRw0f0' ); 
  17. $client->setScopes( array( 'https://www.googleapis.com/auth/analytics.readonly' ) ); 
  18. $client->setUseObjects( true );  
  19. $client->setAccessToken( $access_token ); 
  20. /** Create Analytics Object */ 
  21. $analytics = new Google_AnalyticsService( $client ); 
  22. if ( $_POST['tab'] == 'line_chart' ) { 
  23. gglnltcs_line_chart_tab( $analytics ); /** Line Chart Tab.*/ 
  24. } else if ( $_POST['tab'] == 'table_chart' ) { 
  25. gglnltcs_table_chart_tab( $analytics ); /** Table Chart Tab.*/ 
  26. } else if ( $_POST['tab'] == 'tracking_code' ) { 
  27. gglnltcs_tracking_code_tab( true ); /** Tracking Code & Reset Tab.*/ 
  28. die();