| 1 |
<?php |
| 2 |
/** |
| 3 |
* Represents the view for the administration dashboard. |
| 4 |
* |
| 5 |
* This includes the header, options, and other information that should provide |
| 6 |
* The User Interface to the end user. |
| 7 |
*/ |
| 8 |
?> |
| 9 |
<div class="wrap"> |
| 10 |
|
| 11 |
<?php if ( floatval( get_bloginfo( 'version' ) ) <= 3.9 ) screen_icon(); ?> |
| 12 |
<h2<?php if ( floatval( get_bloginfo( 'version' ) ) >= 3.9 ) { |
| 13 |
echo ' class="ujc-admin-tit"'; |
| 14 |
} ?>><?php echo esc_html( get_admin_page_title() ); ?></h2> |
| 15 |
|
| 16 |
<?php |
| 17 |
$active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'tab_ujic_list'; |
| 18 |
!empty($_GET['_wp_http_referer']) && false !== strpos($_GET['_wp_http_referer'], 'tab_ujic_news') ? $active_tab = 'tab_ujic_news' : null; |
| 19 |
|
| 20 |
$add_tab = __( 'Add New Style', 'uji-countdown' ); |
| 21 |
|
| 22 |
if ( isset( $_GET['tab'] ) ) |
| 23 |
{ |
| 24 |
$active_tab = $_GET['tab']; |
| 25 |
$add_tab = ( 'tab_ujic_new' == $_GET['tab'] && isset( $_GET['edit'] ) ) ? __( 'Edit style', 'uji-countdown' ) : $add_tab; |
| 26 |
} |
| 27 |
|
| 28 |
$tab_view = '<h2 class="nav-tab-wrapper">'; |
| 29 |
$tab_view.= '<a href="?page=ujicountdown&tab=tab_ujic_list" class="nav-tab '.($active_tab == 'tab_ujic_list' ? 'nav-tab-active' : '').'"><i class="dashicons dashicons-menu ujic-mico"></i>'. __( 'Timer Styles', 'uji-countdown' ).'</a>'; |
| 30 |
$tab_view.= '<a href="?page=ujicountdown&tab=tab_ujic_new" class="nav-tab '.($active_tab == 'tab_ujic_new' ? 'nav-tab-active' : '').'"><i class="dashicons dashicons-clock ujic-mico"></i>'.$add_tab.'</a>'; |
| 31 |
|
| 32 |
echo $tab_view; |
| 33 |
|
| 34 |
do_action( 'admin_custom_tab' ); |
| 35 |
|
| 36 |
|
| 37 |
?> |
| 38 |
<a href="?page=ujicountdown&tab=tab_ujic_shortcode" class="nav-tab <?php echo $active_tab == 'tab_ujic_shortcode' ? 'nav-tab-active' : ''; ?>"><i class="dashicons dashicons-shortcode ujic-mico"></i><?php _e( 'Shortcode', 'uji-countdown' ); ?></a> |
| 39 |
<a href="?page=ujicountdown&tab=tab_ujic_set" class="nav-tab <?php echo $active_tab == 'tab_ujic_set' ? 'nav-tab-active' : ''; ?>"><i class="dashicons dashicons-admin-tools ujic-mico"></i><?php _e( 'Settings', 'uji-countdown' ); ?></a> |
| 40 |
<a href="http://www.wpmanage.com/uji-countdown" target="_blank" class="nav-tab nav-tab-pro"><i class="dashicons dashicons-plus ujic-mico"></i><?php _e( 'Add-ons', 'uji-countdown' ); ?></a> |
| 41 |
</h2> |
| 42 |
|
| 43 |
<?php |
| 44 |
|
| 45 |
|
| 46 |
$ujicount = new Uji_Countdown(); |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
if ( $active_tab == 'tab_ujic_list' ) { |
| 51 |
$ujicount->admin_tablelist(); |
| 52 |
} |
| 53 |
|
| 54 |
if ( $active_tab == 'tab_ujic_new' ) { |
| 55 |
$ujicount->admin_countdown(); |
| 56 |
} |
| 57 |
|
| 58 |
if ( $active_tab == 'tab_ujic_shortcode' ) { |
| 59 |
$ujicount->admin_shortcode(); |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
//Add custom tab |
| 64 |
do_action( 'admin_custom_tab_funct' ); |
| 65 |
|
| 66 |
|
| 67 |
if ( $active_tab == 'tab_ujic_set' ) { |
| 68 |
$ujicount->admin_timerset(); |
| 69 |
} |
| 70 |
?> |
| 71 |
|
| 72 |
</div> |