stats_configuration_screen

Stats Configuration Screen.

Description

stats_configuration_screen(); 

Usage

  1. if ( !function_exists( 'stats_configuration_screen' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/stats.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = stats_configuration_screen(); 
  7.  

Defined (1)

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

/modules/stats.php  
  1. function stats_configuration_screen() { 
  2. $options = stats_get_options(); 
  3. ?> 
  4. <div class="narrow"> 
  5. <p><?php printf( __( 'Visit <a href="%s">Site Stats</a> to see your stats.', jetpack ), esc_url( menu_page_url( 'stats', false ) ) ); ?></p> 
  6. <form method="post"> 
  7. <input type='hidden' name='action' value='save_options' /> 
  8. <?php wp_nonce_field( 'stats' ); ?> 
  9. <table id="menu" class="form-table"> 
  10. <tr valign="top"><th scope="row"><label for="admin_bar"><?php _e( 'Admin bar' , jetpack ); ?></label></th> 
  11. <td><label><input type='checkbox'<?php checked( $options['admin_bar'] ); ?> name='admin_bar' id='admin_bar' /> <?php _e( "Put a chart showing 48 hours of views in the admin bar.", jetpack ); ?></label></td></tr> 
  12. <tr valign="top"><th scope="row"><?php _e( 'Registered users', jetpack ); ?></th> 
  13. <td> 
  14. <?php _e( "Count the page views of registered users who are logged in.", jetpack ); ?><br/> 
  15. <?php 
  16. $count_roles = stats_get_option( 'count_roles' ); 
  17. foreach ( get_editable_roles() as $role => $details ) { 
  18. ?> 
  19. <label><input type='checkbox' name='count_role_<?php echo $role; ?>'<?php checked( in_array( $role, $count_roles ) ); ?> /> <?php echo translate_user_role( $details['name'] ); ?></label><br/> 
  20. <?php 
  21. ?> 
  22. </td></tr> 
  23. <tr valign="top"><th scope="row"><?php _e( 'Smiley' , jetpack ); ?></th> 
  24. <td><label><input type='checkbox'<?php checked( isset( $options['hide_smile'] ) && $options['hide_smile'] ); ?> name='hide_smile' id='hide_smile' /> <?php _e( 'Hide the stats smiley face image.', jetpack ); ?></label><br /> <span class="description"><?php _e( 'The image helps collect stats and <strong>makes the world a better place</strong> but should still work when hidden', jetpack ); ?> <img class="stats-smiley" alt="<?php esc_attr_e( 'Smiley face', jetpack ); ?>" src="<?php echo esc_url( plugins_url( 'images/stats-smiley.gif', dirname( __FILE__ ) ) ); ?>" width="6" height="5" /></span></td></tr> 
  25. <tr valign="top"><th scope="row"><?php _e( 'Report visibility' , jetpack ); ?></th> 
  26. <td> 
  27. <?php _e( 'Select the roles that will be able to view stats reports.', jetpack ); ?><br/> 
  28. <?php 
  29. $stats_roles = stats_get_option( 'roles' ); 
  30. foreach ( get_editable_roles() as $role => $details ) { 
  31. ?> 
  32. <label><input type='checkbox' <?php if ( $role == 'administrator' ) echo "disabled='disabled' "; ?>name='role_<?php echo $role; ?>'<?php checked( $role == 'administrator' || in_array( $role, $stats_roles ) ); ?> /> <?php echo translate_user_role( $details['name'] ); ?></label><br/> 
  33. <?php 
  34. ?> 
  35. </td></tr> 
  36. </table> 
  37. <p class="submit"><input type='submit' class='button-primary' value='<?php echo esc_attr( __( 'Save configuration', jetpack ) ); ?>' /></p> 
  38. </form> 
  39. </div> 
  40. <?php