PluginProbe
Awesome Support – WordPress HelpDesk & Support Plugin / trunk
Awesome Support – WordPress HelpDesk & Support Plugin vtrunk
6.4.0 trunk 3.0.0 3.0.1 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 All 95 releases
awesome-support / includes / admin / views / status.php

status.php in Awesome Support – WordPress HelpDesk & Support Plugin trunk, at includes/admin/views/status.php

68 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 $tools_tabs['status'] = array( 'name' => __('System Status', 'awesome-support') );
4 if( current_user_can( 'administrator' ) ) {
5 $tools_tabs['logs'] = array( 'name' => __('Log Viewer', 'awesome-support') );
6 }
7 $tools_tabs['tools'] = array( 'name' => __('Cleanup', 'awesome-support') );
8 $tools_tabs = apply_filters( 'wpas_system_tabls', $tools_tabs );
9
10 /*$tools_tabs = apply_filters( 'wpas_system_tabls', array(
11 'status' => array(
12 'name' => 'System Status'
13 ),
14 'logs' => array(
15 'name' => 'Log Viewer'
16 ),
17 'tools' => array(
18 'name' => 'Cleanup'
19 )
20 ) );
21 */
22
23 /* Remove some items if running in SAAS mode AND in a multi-site environment - do not allow the user to see the LOG viewer and the SYSTEM STATUS screen! */
24 if ( defined( 'WPAS_SAAS' ) && true === WPAS_SAAS ) {
25 if ( true === is_multisite() && 1 <> get_current_blog_id() && 0 <> get_current_blog_id() ) {
26 unset($tools_tabs['logs']);
27 unset($tools_tabs['status']);
28 }
29 }
30
31
32 if(!empty( $tools_tabs )) {
33 ?>
34
35
36 <div class="wrap">
37
38 <h2 class="nav-tab-wrapper">
39 <?php
40
41 $active_tab = isset( $_GET['tab'] ) && in_array( $_GET['tab'], array_keys( $tools_tabs ) ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'status';
42
43 foreach($tools_tabs as $t_tab_key => $t_tab) {
44 $link = add_query_arg( array( 'post_type' => 'ticket', 'page' => 'wpas-status', 'tab' => $t_tab_key ), admin_url( 'edit.php' ) );
45
46 $active_class = ( $t_tab_key === $active_tab ) ? 'nav-tab-active' : '';
47
48 echo '<a href="' . esc_url( $link ) . '" class="nav-tab ' . esc_attr( $active_class ) . '">'. esc_html( $t_tab['name'] ) .'</a>';
49 }
50 ?>
51
52 </h2>
53
54 <?php
55
56
57
58 $tab_view = isset( $tools_tabs[ $active_tab ]['view_path'] ) ? $tools_tabs[ $active_tab ]['view_path'] : WPAS_PATH . 'includes/admin/views/system-'.$active_tab.'.php';
59 require_once( $tab_view );
60
61 ?>
62
63 </div>
64
65 <?php
66 }
67 ?>
68