Keine Beschreibung

html-admin-page-reports.php 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /**
  3. * Admin View: Page - Reports
  4. */
  5. if ( ! defined( 'ABSPATH' ) ) {
  6. exit;
  7. }
  8. ?>
  9. <div class="wrap woocommerce">
  10. <?php if ( WC()->is_wc_admin_active() ) { ?>
  11. <div id="message" class="error inline" style="margin-top:30px">
  12. <p>
  13. <strong>
  14. <?php
  15. /* translators: 1: Link URL */
  16. echo wp_kses_post( sprintf( __( 'With the release of WooCommerce 4.0, these reports are being replaced. There is a new and better Analytics section available for users running WordPress 5.3+. Head on over to the <a href="%1$s">WooCommerce Analytics</a> or learn more about the new experience in the <a href="https://docs.woocommerce.com/document/woocommerce-analytics/" target="_blank">WooCommerce Analytics documentation</a>.', 'woocommerce' ), esc_url( wc_admin_url( '&path=/analytics/overview' ) ) ) );
  17. ?>
  18. </strong>
  19. </p>
  20. </div>
  21. <?php } ?>
  22. <nav class="nav-tab-wrapper woo-nav-tab-wrapper">
  23. <?php
  24. foreach ( $reports as $key => $report_group ) {
  25. echo '<a href="' . admin_url( 'admin.php?page=wc-reports&tab=' . urlencode( $key ) ) . '" class="nav-tab ';
  26. if ( $current_tab == $key ) {
  27. echo 'nav-tab-active';
  28. }
  29. echo '">' . esc_html( $report_group['title'] ) . '</a>';
  30. }
  31. do_action( 'wc_reports_tabs' );
  32. ?>
  33. </nav>
  34. <?php
  35. if ( count( $reports[ $current_tab ]['reports'] ) > 1 ) {
  36. ?>
  37. <ul class="subsubsub">
  38. <li>
  39. <?php
  40. $links = array();
  41. foreach ( $reports[ $current_tab ]['reports'] as $key => $report ) {
  42. $link = '<a href="admin.php?page=wc-reports&tab=' . urlencode( $current_tab ) . '&amp;report=' . urlencode( $key ) . '" class="';
  43. if ( $key == $current_report ) {
  44. $link .= 'current';
  45. }
  46. $link .= '">' . $report['title'] . '</a>';
  47. $links[] = $link;
  48. }
  49. echo implode( ' | </li><li>', $links );
  50. ?>
  51. </li>
  52. </ul>
  53. <br class="clear" />
  54. <?php
  55. }
  56. if ( isset( $reports[ $current_tab ]['reports'][ $current_report ] ) ) {
  57. $report = $reports[ $current_tab ]['reports'][ $current_report ];
  58. if ( ! isset( $report['hide_title'] ) || true != $report['hide_title'] ) {
  59. echo '<h1>' . esc_html( $report['title'] ) . '</h1>';
  60. } else {
  61. echo '<h1 class="screen-reader-text">' . esc_html( $report['title'] ) . '</h1>';
  62. }
  63. if ( $report['description'] ) {
  64. echo '<p>' . $report['description'] . '</p>';
  65. }
  66. if ( $report['callback'] && ( is_callable( $report['callback'] ) ) ) {
  67. call_user_func( $report['callback'], $current_report );
  68. }
  69. }
  70. ?>
  71. </div>