2017-04-21 12:05:44 +00:00
< ? php defined ( 'ABSPATH' ) or exit (); ?>
2017-05-30 16:46:26 +00:00
< div class = " wrap woocommerce wc_addons_wrap wc-helper " >
2017-05-30 19:26:33 +00:00
< ? php include ( WC_Helper :: get_view_filename ( 'html-section-nav.php' ) ); ?>
< h1 class = " screen-reader-text " >< ? php _e ( 'WooCommerce Extensions' , 'woocommerce' ); ?> </h1>
2017-04-21 12:05:44 +00:00
< ? php include ( WC_Helper :: get_view_filename ( 'html-section-notices.php' ) ); ?>
2017-06-14 13:12:53 +00:00
< div class = " subscriptions-header " >
< h2 >< ? php _e ( 'Subscriptions' , 'woocommerce' ); ?> </h2>
< ? php include ( WC_Helper :: get_view_filename ( 'html-section-account.php' ) ); ?>
< p >< ? php _e ( 'Below is a list of products available on your WooCommerce.com account. To receive plugin updates please make sure the product is installed, activated and connected to your WooCommerce.com account.' , 'woocommerce' ); ?> </p>
</ div >
2017-04-21 12:05:44 +00:00
2017-05-30 17:50:14 +00:00
< table class = " wp-list-table widefat fixed striped " >
2017-04-21 12:05:44 +00:00
< ? php if ( ! empty ( $subscriptions ) ) : ?>
< ? php foreach ( $subscriptions as $subscription ) : ?>
2017-05-30 17:50:14 +00:00
< tbody >
< tr class = " wp-list-table__row is-ext-header " >
2017-06-14 13:12:53 +00:00
< td class = " wp-list-table__ext-details " >
2017-05-30 17:50:14 +00:00
< div class = " wp-list-table__ext-title " >
< a href = " <?php echo esc_url( $subscription['product_url'] ); ?> " target = " _blank " >< ? php
echo esc_html ( $subscription [ 'product_name' ] ); ?> </a>
</ div >
< div class = " wp-list-table__ext-description " >
< ? php if ( $subscription [ 'expired' ] ) : ?>
< span class = " renews " >
< strong >< ? php _e ( 'Expired :(' , 'woocommerce' ); ?> </strong>
< ? php echo date_i18n ( 'F jS, Y' , $subscription [ 'expires' ] ); ?>
</ span >
< ? php elseif ( $subscription [ 'autorenew' ] ) : ?>
< span class = " renews " >
< ? php _e ( 'Auto renews on:' , 'woocommerce' ); ?>
< ? php echo date_i18n ( 'F jS, Y' , $subscription [ 'expires' ] ); ?>
</ span >
< ? php elseif ( $subscription [ 'expiring' ] ) : ?>
< span class = " renews " >
< strong >< ? php _e ( 'Expiring soon!' , 'woocommerce' ); ?> </strong>
< ? php echo date_i18n ( 'F jS, Y' , $subscription [ 'expires' ] ); ?>
</ span >
< ? php else : ?>
< span class = " renews " >
< ? php _e ( 'Expires on:' , 'woocommerce' ); ?>
< ? php echo date_i18n ( 'F jS, Y' , $subscription [ 'expires' ] ); ?>
</ span >
< ? php endif ; ?>
2017-04-21 12:05:44 +00:00
2017-05-30 17:50:14 +00:00
< br />
< span class = " subscription " >
< ? php
2017-06-21 14:50:34 +00:00
if ( ! $subscription [ 'active' ] && $subscription [ 'maxed' ] ) {
/* translators: %1$d: sites active, %2$d max sites active */
2017-06-22 14:17:49 +00:00
printf ( __ ( 'Subscription: Not available - %1$d of %2$d already in use' , 'woocommerce' ), absint ( $subscription [ 'sites_active' ] ), absint ( $subscription [ 'sites_max' ] ) );
2017-06-21 14:50:34 +00:00
} elseif ( $subscription [ 'sites_max' ] > 0 ) {
2017-05-30 17:50:14 +00:00
/* translators: %1$d: sites active, %2$d max sites active */
2017-06-22 14:17:49 +00:00
printf ( __ ( 'Subscription: Using %1$d of %2$d sites available' , 'woocommerce' ), absint ( $subscription [ 'sites_active' ] ), absint ( $subscription [ 'sites_max' ] ) );
2017-05-30 17:50:14 +00:00
} else {
_e ( 'Subscription: Unlimited' , 'woocommerce' );
}
2017-06-21 14:45:41 +00:00
if ( isset ( $subscription [ 'master_user_email' ] ) ) {
2017-06-22 13:49:10 +00:00
printf ( '</br>' . __ ( 'Shared by %s' , 'woocommerce' ), esc_html ( $subscription [ 'master_user_email' ] ) );
2017-06-21 14:45:41 +00:00
}
2017-05-30 17:50:14 +00:00
?>
</ span >
</ div >
</ td >
< td class = " wp-list-table__ext-actions " >
2017-06-14 13:12:53 +00:00
< ? php if ( ! $subscription [ 'active' ] && $subscription [ 'maxed' ] ) : ?>
< a class = " button " href = " https://woocommerce.com/my-account/my-subscriptions/ " target = " _blank " >< ? php _e ( 'Upgrade' , 'woocommerce' ); ?> </a>
< ? php elseif ( ! $subscription [ 'local' ][ 'installed' ] && ! $subscription [ 'expired' ] ) : ?>
2017-06-22 13:59:39 +00:00
< a class = " button <?php echo empty( $subscription['download_primary'] ) ? 'button-secondary' : ''; ?> " href = " <?php echo esc_url( $subscription['download_url'] ); ?> " target = " _blank " >< ? php _e ( 'Download' , 'woocommerce' ); ?> </a>
2017-06-14 13:12:53 +00:00
< ? php elseif ( $subscription [ 'active' ] ) : ?>
2017-06-01 11:51:45 +00:00
< span class = " form-toggle__wrapper " >
2017-06-02 10:22:48 +00:00
< a href = " <?php echo esc_url( $subscription['deactivate_url'] ); ?> " class = " form-toggle active is-compact " role = " link " aria - checked = " true " >< ? php _e ( 'Active' , 'woocommerce' ); ?> </a>
2017-06-01 11:51:45 +00:00
< label class = " form-toggle__label " for = " activate-extension " >
< span class = " form-toggle__label-content " >
< label for = " activate-extension " >< ? php _e ( 'Active' , 'woocommerce' ); ?> </label>
</ span >
< span class = " form-toggle__switch " ></ span >
</ label >
</ span >
2017-05-30 17:50:14 +00:00
< ? php elseif ( ! $subscription [ 'expired' ] ) : ?>
2017-06-01 11:51:45 +00:00
< span class = " form-toggle__wrapper " >
< a href = " <?php echo esc_url( $subscription['activate_url'] ); ?> " class = " form-toggle is-compact " role = " link " aria - checked = " false " >< ? php _e ( 'Inactive' , 'woocommerce' ); ?> </a>
< label class = " form-toggle__label " for = " activate-extension " >
< span class = " form-toggle__label-content " >
< label for = " activate-extension " >< ? php _e ( 'Inactive' , 'woocommerce' ); ?> </label>
</ span >
< span class = " form-toggle__switch " ></ span >
</ label >
</ span >
2017-05-30 17:50:14 +00:00
< ? php else : ?>
2017-06-01 11:51:45 +00:00
< span class = " form-toggle__wrapper " >
2017-06-02 10:22:48 +00:00
< span class = " form-toggle disabled is-compact " >< ? php _e ( 'Inactive' , 'woocommerce' ); ?> </span>
2017-06-01 11:51:45 +00:00
< label class = " form-toggle__label " for = " activate-extension " >
< span class = " form-toggle__label-content " >
< label for = " activate-extension " >< ? php _e ( 'Inactive' , 'woocommerce' ); ?> </label>
</ span >
</ label >
</ span >
2017-04-21 12:05:44 +00:00
< ? php endif ; ?>
2017-05-30 17:50:14 +00:00
</ td >
</ tr >
2017-04-21 12:05:44 +00:00
2017-06-14 13:12:53 +00:00
< ? php foreach ( $subscription [ 'actions' ] as $action ) : ?>
2017-05-30 17:50:14 +00:00
< tr class = " wp-list-table__row wp-list-table__ext-updates " >
2017-06-14 13:12:53 +00:00
< td class = " wp-list-table__ext-status <?php echo sanitize_html_class( $action['status'] ); ?> " >
< p >< span class = " dashicons <?php echo sanitize_html_class( $action['icon'] ); ?> " ></ span >
< ? php echo $action [ 'message' ]; ?>
2017-05-30 17:50:14 +00:00
</ p >
</ td >
< td class = " wp-list-table__ext-actions " >
2017-06-22 08:26:26 +00:00
< ? php if ( ! empty ( $action [ 'button_label' ] ) && ! empty ( $action [ 'button_url' ] ) ) : ?>
2017-06-22 13:59:39 +00:00
< a class = " button <?php echo empty( $action['primary'] ) ? 'button-secondary' : ''; ?> " href = " <?php echo esc_url( $action['button_url'] ); ?> " >< ? php echo esc_html ( $action [ 'button_label' ] ); ?> </a>
2017-04-21 12:05:44 +00:00
< ? php endif ; ?>
2017-05-30 17:50:14 +00:00
</ td >
</ tr >
2017-06-14 13:12:53 +00:00
< ? php endforeach ; ?>
2017-04-21 12:05:44 +00:00
2017-05-30 17:50:14 +00:00
</ tbody >
2017-04-21 12:05:44 +00:00
< ? php endforeach ; ?>
< ? php else : ?>
< tr >
2017-04-26 15:36:20 +00:00
< td colspan = " 3 " >< em >< ? php _e ( 'Could not find any subscriptions on your WooCommerce.com account' , 'woocommerce' ); ?> </td>
2017-04-21 12:05:44 +00:00
</ tr >
< ? php endif ; ?>
2017-05-30 17:50:14 +00:00
</ tbody >
2017-04-21 12:05:44 +00:00
</ table >
< ? php if ( ! empty ( $no_subscriptions ) ) : ?>
2017-05-30 17:50:14 +00:00
< h2 >< ? php _e ( 'Installed Extensions without a Subscription' , 'woocommerce' ); ?> </h2>
< p > Below is a list of WooCommerce . com products available on your site - but are either out - dated or do not have a valid subscription .</ p >
2017-04-21 12:05:44 +00:00
2017-05-30 17:50:14 +00:00
< table class = " wp-list-table widefat fixed striped " >
2017-04-21 12:05:44 +00:00
< ? php /* Extensions without a subscription. */ ?>
< ? php foreach ( $no_subscriptions as $filename => $data ) : ?>
2017-05-30 17:50:14 +00:00
< tbody >
< tr class = " wp-list-table__row is-ext-header " >
< td class = " wp-list-table__ext-details color-bar autorenews " >
< div class = " wp-list-table__ext-title " >
2017-06-14 13:12:53 +00:00
< a href = " <?php echo esc_url( $data['_product_url'] ); ?> " target = " _blank " >< ? php echo esc_html ( $data [ 'Name' ] ); ?> </a>
2017-05-30 17:50:14 +00:00
</ div >
< div class = " wp-list-table__ext-description " >
</ div >
</ td >
< td class = " wp-list-table__ext-actions " >
< span class = " form-toggle__wrapper " >
2017-06-02 10:22:48 +00:00
< span class = " form-toggle disabled is-compact " >< ? php _e ( 'Inactive' , 'woocommerce' ); ?> </span>
< label class = " form-toggle__label " for = " activate-extension " >
2017-05-30 17:50:14 +00:00
< span class = " form-toggle__label-content " >
2017-06-02 10:22:48 +00:00
< label for = " activate-extension " >< ? php _e ( 'Inactive' , 'woocommerce' ); ?> </label>
2017-05-30 17:50:14 +00:00
</ span >
</ label >
</ span >
</ td >
</ tr >
2017-06-14 13:12:53 +00:00
< ? php foreach ( $data [ '_actions' ] as $action ) : ?>
2017-05-30 17:50:14 +00:00
< tr class = " wp-list-table__row wp-list-table__ext-updates " >
2017-06-14 13:12:53 +00:00
< td class = " wp-list-table__ext-status <?php echo sanitize_html_class( $action['status'] ); ?> " >
< p >< span class = " dashicons <?php echo sanitize_html_class( $action['icon'] ); ?> " ></ span >
< ? php echo $action [ 'message' ]; ?>
2017-05-30 17:50:14 +00:00
</ p >
</ td >
< td class = " wp-list-table__ext-actions " >
2017-06-14 13:12:53 +00:00
< a class = " button " href = " <?php echo esc_url( $action['button_url'] ); ?> " target = " _blank " >< ? php echo esc_html ( $action [ 'button_label' ] ); ?> </a>
2017-05-30 17:50:14 +00:00
</ td >
</ tr >
2017-06-14 13:12:53 +00:00
< ? php endforeach ; ?>
2017-05-30 17:50:14 +00:00
</ tbody >
2017-04-21 12:05:44 +00:00
< ? php endforeach ; ?>
</ table >
< ? php endif ; ?>
</ div >