woocommerce/includes/admin/views/html-admin-page-reports.php

84 lines
2.3 KiB
PHP
Raw Normal View History

<?php
/**
2015-11-03 13:53:50 +00:00
* Admin View: Page - Reports
*/
if ( ! defined( 'ABSPATH' ) ) {
2016-02-23 09:11:02 +00:00
exit;
}
?>
2013-06-22 10:37:59 +00:00
<div class="wrap woocommerce">
2021-01-14 13:25:26 +00:00
<div id="message" class="error inline" style="margin-top:30px">
<p>
<strong>
<?php
/* translators: 1: Link URL */
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' ) ) ) );
?>
</strong>
</p>
</div>
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
2013-06-22 10:37:59 +00:00
<?php
foreach ( $reports as $key => $report_group ) {
echo '<a href="' . admin_url( 'admin.php?page=wc-reports&tab=' . urlencode( $key ) ) . '" class="nav-tab ';
if ( $current_tab == $key ) {
echo 'nav-tab-active';
2013-06-22 10:37:59 +00:00
}
echo '">' . esc_html( $report_group['title'] ) . '</a>';
}
2013-06-22 10:37:59 +00:00
do_action( 'wc_reports_tabs' );
?>
</nav>
<?php
if ( sizeof( $reports[ $current_tab ]['reports'] ) > 1 ) {
2013-06-22 10:37:59 +00:00
?>
<ul class="subsubsub">
<li>
<?php
2013-06-22 10:37:59 +00:00
$links = array();
2013-06-22 10:37:59 +00:00
foreach ( $reports[ $current_tab ]['reports'] as $key => $report ) {
$link = '<a href="admin.php?page=wc-reports&tab=' . urlencode( $current_tab ) . '&amp;report=' . urlencode( $key ) . '" class="';
2013-06-22 10:37:59 +00:00
if ( $key == $current_report ) {
$link .= 'current';
}
2013-06-22 10:37:59 +00:00
$link .= '">' . $report['title'] . '</a>';
2013-06-22 10:37:59 +00:00
$links[] = $link;
}
2013-06-22 10:37:59 +00:00
echo implode( ' | </li><li>', $links );
2013-06-22 10:37:59 +00:00
?>
</li>
2013-06-22 10:37:59 +00:00
</ul>
<br class="clear" />
<?php
}
if ( isset( $reports[ $current_tab ]['reports'][ $current_report ] ) ) {
$report = $reports[ $current_tab ]['reports'][ $current_report ];
2013-06-22 10:37:59 +00:00
2016-09-09 00:14:28 +00:00
if ( ! isset( $report['hide_title'] ) || true != $report['hide_title'] ) {
echo '<h1>' . esc_html( $report['title'] ) . '</h1>';
} else {
echo '<h1 class="screen-reader-text">' . esc_html( $report['title'] ) . '</h1>';
}
2013-06-22 10:37:59 +00:00
2016-04-22 17:08:44 +00:00
if ( $report['description'] ) {
2013-06-22 10:37:59 +00:00
echo '<p>' . $report['description'] . '</p>';
2016-04-22 17:08:44 +00:00
}
2013-06-22 10:37:59 +00:00
2016-04-22 17:08:44 +00:00
if ( $report['callback'] && ( is_callable( $report['callback'] ) ) ) {
call_user_func( $report['callback'], $current_report );
2016-04-22 17:08:44 +00:00
}
2013-06-22 10:37:59 +00:00
}
?>
2015-11-03 13:31:20 +00:00
</div>