/wp-content/plugins/p3-profiler/templates/template.php

https://github.com/Canuckaholic/Pop-Digital · PHP · 112 lines · 99 code · 12 blank · 1 comment · 13 complexity · d16e8751029192f1959d25642544162e MD5 · raw file

  1. <?php
  2. $button_current_checked = '';
  3. $button_history_checked = '';
  4. $button_help_checked = '';
  5. if ( 'current-scan' == self::$action || !empty( $_REQUEST['current_scan'] ) ) {
  6. $button_current_checked = 'checked="checked"';
  7. } elseif ( 'help' == self::$action ) {
  8. $button_help_checked = 'checked="checked"';
  9. } else {
  10. $button_history_checked = 'checked="checked"';
  11. }
  12. ?>
  13. <script type="text/javascript">
  14. jQuery( document ).ready( function( $) {
  15. $( "#button-current-scan" ).click( function() {
  16. location.href = "<?php echo add_query_arg( array( 'p3_action' => 'current-scan', 'name' => null, 'current_scan' => null ) ); ?>";
  17. });
  18. $( "#button-history-scans" ).click( function() {
  19. location.href = "<?php echo add_query_arg( array( 'p3_action' => 'list-scans', 'name' => null, 'current_scan' => null ) ); ?>";
  20. });
  21. $( "#button-help" ).click( function() {
  22. location.href = "<?php echo add_query_arg( array( 'p3_action' => 'help', 'name' => null, 'current_scan' => null ) ); ?>";
  23. })
  24. $( ".p3-button" ).button();
  25. $( "#p3-navbar" ).buttonset();
  26. $( "#p3-navbar" ).corner( "round 8px" );
  27. $( ".p3-big-button" ).buttonset();
  28. $( "#p3-results-table tr:even" ).addClass( "even" );
  29. $( "td div.row-actions-visible" ).hide();
  30. $( "table.wp-list-table td" ).mouseover( function() {
  31. $( "div.row-actions-visible", $( this ) ).show();
  32. }).mouseout( function() {
  33. $( "div.row-actions-visible", $( this ) ).hide();
  34. });
  35. $( ".qtip-tip" ).each( function() {
  36. $( this ).qtip({
  37. content: $( this ).attr( "title" ),
  38. position: {
  39. my: 'top center',
  40. at: 'bottom center'
  41. },
  42. style: {
  43. classes: 'ui-tooltip-blue ui-tooltip-shadow'
  44. }
  45. });
  46. });
  47. // Callouts
  48. $( "div#p3-reminder-wrapper" )
  49. .corner( "round 8px" )
  50. .parent()
  51. .css( "padding", "4px" )
  52. .corner( "round 10px" );
  53. });
  54. </script>
  55. <div class="wrap">
  56. <!-- Header icon / title -->
  57. <div id="icon-plugins" class="icon32"><br/></div>
  58. <h2 class="plugin-name"><?php _e( 'P3 - Plugin Performance Profiler', 'p3-profiler' ); ?></h2>
  59. <!-- Header navbar -->
  60. <div class="ui-widget-header" id="p3-navbar">
  61. <div>
  62. <input type="radio" name="p3-nav" id="button-current-scan" <?php echo $button_current_checked; ?> />
  63. <label for="button-current-scan" class="current-tab"><?php _e( 'Current', 'p3-profiler' ); ?></label>
  64. <input type="radio" name="p3-nav" id="button-history-scans" <?php echo $button_history_checked; ?> />
  65. <label for="button-history-scans" class="history-tab"><?php _e( 'History', 'p3-profiler' ); ?></label>
  66. <input type="radio" name="p3-nav" id="button-help" <?php echo $button_help_checked; ?> /><label for="button-help" class="help-tab"><?php _e( 'Help', 'p3-profiler' ); ?></label>
  67. </div>
  68. <div id="p3-scan-label">
  69. <?php if ( !empty( self::$profile ) ) : ?>
  70. <?php _e( 'Scan name:', 'p3-profiler' ); ?> <?php echo self::$profile->profile_name; ?>
  71. <?php endif; ?>
  72. </div>
  73. </div>
  74. <!-- Start / stop button and callouts -->
  75. <?php require_once P3_PATH . '/templates/callouts.php'; ?>
  76. <!-- View scan or show a list of scans -->
  77. <?php if ( ( 'current-scan' == self::$action && !empty( self::$scan ) ) || 'view-scan' == self::$action ) { ?>
  78. <?php require_once P3_PATH . '/templates/view-scan.php'; ?>
  79. <?php } elseif ( 'help' == self::$action ) { ?>
  80. <?php require_once P3_PATH . '/templates/help.php'; ?>
  81. <?php } else { ?>
  82. <?php require_once P3_PATH . '/templates/list-scans.php'; ?>
  83. <?php } ?>
  84. </div>
  85. <div id="p3-footer-wrapper">
  86. <div id="p3-reminder">
  87. <div id="p3-reminder-wrapper">
  88. <?php _e( 'Do you like this plugin?', 'p3-profiler' ); ?>
  89. <ul>
  90. <li><a href="http://twitter.com/home?status=<?php echo rawurlencode( sprintf( __( 'I just optimized my WordPress site with %1$s %2$s', 'p3-profiler' ), '#p3plugin', 'http://wordpress.org/extend/plugins/p3-profiler/') ); ?>" target="_blank"><?php _e( 'Tweet about it', 'p3-profiler' ); ?></a></li>
  91. <li><a href="http://wordpress.org/extend/plugins/p3-profiler/" target="_blank"><?php _e( 'Rate it on the repository', 'p3-profiler' ); ?></a></li>
  92. </ul>
  93. </div>
  94. </div>
  95. <div id="p3-copyright">
  96. <img src="<?php echo plugins_url() . '/p3-profiler/css/logo.png'; ?>" alt="<?php esc_attr_e( 'Logo', 'p3-profiler' ); ?>" title="<?php esc_attr_e( 'Logo', 'p3-profiler' ); ?>" />
  97. <br />
  98. <?php printf( __( 'P3 (Plugin Performance Profiler) is Copyright &copy; %1$s - %2$s <a href="%3$s" target="_blank">GoDaddy.com</a>. All rights reserved.', 'p3-profiler' ), 2011, date( 'Y' ), 'http://www.godaddy.com/' ); ?>
  99. </div>
  100. </div>