2014-07-28 14:50:11 +00:00
< ? php
/**
2015-11-03 13:53:50 +00:00
* Admin View : Page - Reports
2014-07-28 14:50:11 +00:00
*/
2014-07-28 15:16:35 +00:00
if ( ! defined ( 'ABSPATH' ) ) {
2016-02-23 09:11:02 +00:00
exit ;
2014-07-28 15:16:35 +00:00
}
2014-07-28 14:50:11 +00:00
?>
2013-06-22 10:37:59 +00:00
< div class = " wrap woocommerce " >
2021-02-10 21:21:35 +00:00
< ? php if ( WC () -> is_wc_admin_active () ) { ?>
2021-01-14 13:25:26 +00:00
< div id = " message " class = " error inline " style = " margin-top:30px " >
2021-01-13 15:00:37 +00:00
< 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 >
2021-02-10 21:21:35 +00:00
< ? php } ?>
2016-06-30 07:39:04 +00:00
< nav class = " nav-tab-wrapper woo-nav-tab-wrapper " >
2013-06-22 10:37:59 +00:00
< ? php
2018-03-05 18:59:17 +00:00
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
}
2018-03-05 18:59:17 +00:00
echo '">' . esc_html ( $report_group [ 'title' ] ) . '</a>' ;
}
2013-06-22 10:37:59 +00:00
2018-03-05 18:59:17 +00:00
do_action ( 'wc_reports_tabs' );
2016-02-23 08:33:11 +00:00
?>
2016-06-30 07:39:04 +00:00
</ nav >
2018-03-05 18:59:17 +00:00
< ? php
2021-02-10 21:21:35 +00:00
if ( count ( $reports [ $current_tab ][ 'reports' ] ) > 1 ) {
2013-06-22 10:37:59 +00:00
?>
< ul class = " subsubsub " >
2018-03-05 18:59:17 +00:00
< li >
< ? php
2013-06-22 10:37:59 +00:00
2018-03-05 18:59:17 +00:00
$links = array ();
2013-06-22 10:37:59 +00:00
2018-03-05 18:59:17 +00:00
foreach ( $reports [ $current_tab ][ 'reports' ] as $key => $report ) {
$link = '<a href="admin.php?page=wc-reports&tab=' . urlencode ( $current_tab ) . '&report=' . urlencode ( $key ) . '" class="' ;
2013-06-22 10:37:59 +00:00
2018-03-05 18:59:17 +00:00
if ( $key == $current_report ) {
$link .= 'current' ;
}
2013-06-22 10:37:59 +00:00
2018-03-05 18:59:17 +00:00
$link .= '">' . $report [ 'title' ] . '</a>' ;
2013-06-22 10:37:59 +00:00
2018-03-05 18:59:17 +00:00
$links [] = $link ;
}
2013-06-22 10:37:59 +00:00
2018-03-05 18:59:17 +00:00
echo implode ( ' | </li><li>' , $links );
2013-06-22 10:37:59 +00:00
2018-03-05 18:59:17 +00:00
?>
</ li >
2013-06-22 10:37:59 +00:00
</ ul >
< br class = " clear " />
< ? php
}
2016-08-27 03:23:21 +00:00
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' ] ) {
2016-06-30 07:39:04 +00:00
echo '<h1>' . esc_html ( $report [ 'title' ] ) . '</h1>' ;
2016-02-18 16:38:16 +00:00
} else {
2016-06-30 07:39:04 +00:00
echo '<h1 class="screen-reader-text">' . esc_html ( $report [ 'title' ] ) . '</h1>' ;
2016-02-17 17:40:08 +00:00
}
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' ] ) ) ) {
2013-06-26 14:11:33 +00:00
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 >