gglnltcs_main_func

The BestWebSoft Google Analytics gglnltcs main func function.

Description

gglnltcs_main_func( $analytics, $client ); 

Parameters (2)

0. $analytics
The analytics.
1. $client
The client.

Usage

  1. if ( !function_exists( 'gglnltcs_main_func' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bestwebsoft-google-analytics/bws-google-analytics.php'; 
  3.  
  4. // The analytics. 
  5. $analytics = null; 
  6.  
  7. // The client. 
  8. $client = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = gglnltcs_main_func($analytics, $client); 
  12.  

Defined (1)

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

/bws-google-analytics.php  
  1. function gglnltcs_main_func( $analytics, $client ) {  
  2. global $gglnltcs_options; 
  3. $message = $error = ''; 
  4. if ( isset( $_POST['gglnltcs_form_submit'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'gglnltcs_nonce_name' ) ) { 
  5. $gglnltcs_options_submit['add_tracking_code'] = isset( $_POST['gglnltcs_add_tracking_code'] ) ? 1 : 0; 
  6. $gglnltcs_options_submit['tracking_id'] = isset( $_POST['gglnltcs_tracking_id'] ) ? stripslashes( esc_html( $_POST['gglnltcs_tracking_id'] ) ) : ''; 
  7. if ( $gglnltcs_options_submit['add_tracking_code'] == 1 && $gglnltcs_options_submit['tracking_id'] == '' ) { 
  8. $error .= __( "Tracking code is empty. You must enter a tracking code to add it to your blog.", 'gglnltcs' ); 
  9. if ( empty( $error ) ) { 
  10. $gglnltcs_options = array_merge( $gglnltcs_options, $gglnltcs_options_submit ); 
  11. update_option( 'gglnltcs_options', $gglnltcs_options ); 
  12. $message .= __( "Settings saved.", 'gglnltcs' ); 
  13. } else { 
  14. $error .= ' ' . __( "Settings are not saved.", 'gglnltcs' ); 
  15. /** Print Tab Navigation */?> 
  16. <h2 class="nav-tab-wrapper"> 
  17. <a id="gglnltcs-line-nav-tab" class="nav-tab<?php if ( ! isset( $_GET['action'] ) ) echo ' nav-tab-active'; ?>" href="admin.php?page=bws-google-analytics.php"><?php _e( 'Line Chart', 'gglnltcs' ); ?></a> 
  18. <a id="gglnltcs-table-nav-tab" class="nav-tab<?php if ( isset( $_GET['action'] ) && 'table-tab' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="admin.php?page=bws-google-analytics.php&action=table-tab"><?php _e( 'Table Chart', 'gglnltcs' ); ?></a> 
  19. <a id="gglnltcs-tracking-code-nav-tab" class="nav-tab<?php if ( isset( $_GET['action'] ) && 'tracking-code-tab' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="admin.php?page=bws-google-analytics.php&action=tracking-code-tab"><?php _e( 'Tracking Code & Reset', 'gglnltcs' ); ?></a> 
  20. <a id="gglnltcs-faq" class="nav-tab" href="http://bestwebsoft.com/products/bws-google-analytics/faq/" target="_blank"><?php _e( 'FAQ', 'gglnltcs' ); ?></a> 
  21. </h2> 
  22. <div id="gglnltcs-settings-message" class="updated fade" <?php if ( empty( $message ) ) echo "style=\"display:none\""; ?>><p><strong><?php echo $message; ?></strong></p></div> 
  23. <div id="gglnltcs-settings-error" class="error" <?php if ( empty( $error ) ) echo "style=\"display:none\""; ?>><p><strong><?php echo $error; ?></strong></p></div> 
  24. <div id="gglnltcs-settings-notice" class="updated fade" style="display:none"><p><strong><?php _e( "Notice", 'gglnltcs' ); ?>:</strong> <?php _e( "The plugin's settings have been changed. In order to save them please don't forget to click the 'Save Changes' button.", 'gglnltcs' ); ?></p></div> 
  25. <div id="gglnltcs-main-content"><?php 
  26. /** Line Chart Tab */ 
  27. if ( ! isset( $_GET['action'] ) ) { 
  28. gglnltcs_line_chart_tab( $analytics ); 
  29. /** Table Chart Tab */ 
  30. if ( isset( $_GET['action'] ) && 'table-tab' == $_GET['action'] ) { 
  31. gglnltcs_table_chart_tab( $analytics ); 
  32. /** Tracking Code & Reset Tab */ 
  33. if ( isset( $_GET['action'] ) && 'tracking-code-tab' == $_GET['action'] ) { 
  34. } ?> 
  35. </div><?php