| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: Page - Status |
| 4 |
*/ |
| 5 |
|
| 6 |
if ( ! defined( 'ABSPATH' ) ) { |
| 7 |
exit; |
| 8 |
} |
| 9 |
|
| 10 |
$current_tab = ! empty( $_REQUEST['tab'] ) ? sanitize_title( $_REQUEST['tab'] ) : 'status'; |
| 11 |
$tabs = array( |
| 12 |
'status' => __( 'System status', 'userswp' ), |
| 13 |
'tools' => __( 'Tools', 'userswp' ), |
| 14 |
); |
| 15 |
$tabs = apply_filters( 'uwp_admin_status_tabs', $tabs ); |
| 16 |
?> |
| 17 |
<div class="wrap userswp"> |
| 18 |
<nav class="nav-tab-wrapper uwp-nav-tab-wrapper"> |
| 19 |
<?php |
| 20 |
foreach ( $tabs as $name => $label ) { |
| 21 |
echo '<a href="' . admin_url( 'admin.php?page=uwp_status&tab=' . $name ) . '" class="nav-tab '; |
| 22 |
if ( $current_tab == $name ) { |
| 23 |
echo 'nav-tab-active'; |
| 24 |
} |
| 25 |
echo '">' . $label . '</a>'; |
| 26 |
} |
| 27 |
?> |
| 28 |
</nav> |
| 29 |
<h1 class="screen-reader-text"><?php echo esc_html( $tabs[ $current_tab ] ); ?></h1> |
| 30 |
<?php |
| 31 |
switch ( $current_tab ) { |
| 32 |
case "tools" : |
| 33 |
UsersWP_Tools::output(); |
| 34 |
break; |
| 35 |
default : |
| 36 |
if ( array_key_exists( $current_tab, $tabs ) && has_action( 'uwp_admin_status_content_' . $current_tab ) ) { |
| 37 |
do_action( 'uwp_admin_status_content_' . $current_tab ); |
| 38 |
} else { |
| 39 |
UsersWP_Status::status_report(); |
| 40 |
} |
| 41 |
break; |
| 42 |
} |
| 43 |
?> |
| 44 |
</div> |
| 45 |
|