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">
|
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
|
|
|
|
foreach ( $reports as $key => $report_group ) {
|
2016-04-22 17:08:44 +00:00
|
|
|
echo '<a href="' . admin_url( 'admin.php?page=wc-reports&tab=' . urlencode( $key ) ) . '" class="nav-tab ';
|
|
|
|
if ( $current_tab == $key ) {
|
|
|
|
echo 'nav-tab-active';
|
|
|
|
}
|
2016-08-27 03:23:21 +00:00
|
|
|
echo '">' . esc_html( $report_group['title'] ) . '</a>';
|
2013-06-22 10:37:59 +00:00
|
|
|
}
|
|
|
|
|
2016-02-23 08:33:11 +00:00
|
|
|
do_action( 'wc_reports_tabs' );
|
|
|
|
?>
|
2016-06-30 07:39:04 +00:00
|
|
|
</nav>
|
2013-06-22 10:37:59 +00:00
|
|
|
<?php if ( sizeof( $reports[ $current_tab ]['reports'] ) > 1 ) {
|
|
|
|
?>
|
|
|
|
<ul class="subsubsub">
|
|
|
|
<li><?php
|
|
|
|
|
|
|
|
$links = array();
|
|
|
|
|
|
|
|
foreach ( $reports[ $current_tab ]['reports'] as $key => $report ) {
|
|
|
|
|
2013-10-22 16:26:18 +00:00
|
|
|
$link = '<a href="admin.php?page=wc-reports&tab=' . urlencode( $current_tab ) . '&report=' . urlencode( $key ) . '" class="';
|
2013-06-22 10:37:59 +00:00
|
|
|
|
2016-04-22 17:08:44 +00:00
|
|
|
if ( $key == $current_report ) {
|
|
|
|
$link .= 'current';
|
|
|
|
}
|
2013-06-22 10:37:59 +00:00
|
|
|
|
|
|
|
$link .= '">' . $report['title'] . '</a>';
|
|
|
|
|
|
|
|
$links[] = $link;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-04-22 17:08:44 +00:00
|
|
|
echo implode( ' | </li><li>', $links );
|
2013-06-22 10:37:59 +00:00
|
|
|
|
|
|
|
?></li>
|
|
|
|
</ul>
|
|
|
|
<br class="clear" />
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
2016-08-27 03:23:21 +00:00
|
|
|
if ( isset( $reports[ $current_tab ]['reports'][ $current_report ] ) ) {
|
2013-06-22 10:37:59 +00:00
|
|
|
|
2016-08-27 03:23:21 +00:00
|
|
|
$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>
|