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

70 lines
1.8 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">
<div class="icon32 icon32-woocommerce-reports" id="icon-woocommerce"><br /></div>
<h1><?php echo sprintf( esc_html__( '%s Report' ), $reports[ $current_tab ]['title'] ); ?></h1>
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
2013-06-22 10:37:59 +00:00
<?php
foreach ( $reports as $key => $report_group ) {
2013-10-22 16:26:18 +00:00
echo '<a href="'.admin_url( 'admin.php?page=wc-reports&tab=' . urlencode( $key ) ).'" class="nav-tab ';
2013-06-22 10:37:59 +00:00
if ( $current_tab == $key ) echo 'nav-tab-active';
echo '">' . esc_html( $report_group[ 'title' ] ) . '</a>';
}
do_action( 'wc_reports_tabs' );
?>
</h2>
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 ) . '&amp;report=' . urlencode( $key ) . '" class="';
2013-06-22 10:37:59 +00:00
if ( $key == $current_report ) $link .= 'current';
$link .= '">' . $report['title'] . '</a>';
$links[] = $link;
}
echo implode(' | </li><li>', $links);
?></li>
</ul>
<br class="clear" />
<?php
}
if ( isset( $reports[ $current_tab ][ 'reports' ][ $current_report ] ) ) {
$report = $reports[ $current_tab ][ 'reports' ][ $current_report ];
if ( ! isset( $report['hide_title'] ) || $report['hide_title'] != true ) {
echo '<h2>' . esc_html( $report['title'] ) . '</h2>';
} else {
echo '<h2 class="screen-reader-text">' . esc_html( $report['title'] ) . '</h2>';
}
2013-06-22 10:37:59 +00:00
if ( $report['description'] )
echo '<p>' . $report['description'] . '</p>';
if ( $report['callback'] && ( is_callable( $report['callback'] ) ) )
call_user_func( $report['callback'], $current_report );
2013-06-22 10:37:59 +00:00
}
?>
2015-11-03 13:31:20 +00:00
</div>