<?php
/**
 * The template to display Admin notices
 *
 * @package LAW OFFICE
 * @since LAW OFFICE 1.0.64
 */

$law_office_skins_url  = get_admin_url( null, 'admin.php?page=trx_addons_theme_panel#trx_addons_theme_panel_section_skins' );
$law_office_skins_args = get_query_var( 'law_office_skins_notice_args' );
?>
<div class="law_office_admin_notice law_office_skins_notice notice notice-info is-dismissible" data-notice="skins">
	<?php
	// Theme image
	$law_office_theme_img = law_office_get_file_url( 'screenshot.jpg' );
	if ( '' != $law_office_theme_img ) {
		?>
		<div class="law_office_notice_image"><img src="<?php echo esc_url( $law_office_theme_img ); ?>" alt="<?php esc_attr_e( 'Theme screenshot', 'law-office' ); ?>"></div>
		<?php
	}

	// Title
	?>
	<h3 class="law_office_notice_title">
		<?php esc_html_e( 'New skins available', 'law-office' ); ?>
	</h3>
	<?php

	// Description
	$law_office_total      = $law_office_skins_args['update'];	// Store value to the separate variable to avoid warnings from ThemeCheck plugin!
	$law_office_skins_msg  = $law_office_total > 0
							// Translators: Add new skins number
							? '<strong>' . sprintf( _n( '%d new version', '%d new versions', $law_office_total, 'law-office' ), $law_office_total ) . '</strong>'
							: '';
	$law_office_total      = $law_office_skins_args['free'];
	$law_office_skins_msg .= $law_office_total > 0
							? ( ! empty( $law_office_skins_msg ) ? ' ' . esc_html__( 'and', 'law-office' ) . ' ' : '' )
								// Translators: Add new skins number
								. '<strong>' . sprintf( _n( '%d free skin', '%d free skins', $law_office_total, 'law-office' ), $law_office_total ) . '</strong>'
							: '';
	$law_office_total      = $law_office_skins_args['pay'];
	$law_office_skins_msg .= $law_office_skins_args['pay'] > 0
							? ( ! empty( $law_office_skins_msg ) ? ' ' . esc_html__( 'and', 'law-office' ) . ' ' : '' )
								// Translators: Add new skins number
								. '<strong>' . sprintf( _n( '%d paid skin', '%d paid skins', $law_office_total, 'law-office' ), $law_office_total ) . '</strong>'
							: '';
	?>
	<div class="law_office_notice_text">
		<p>
			<?php
			// Translators: Add new skins info
			echo wp_kses_data( sprintf( __( "We are pleased to announce that %s are available for your theme", 'law-office' ), $law_office_skins_msg ) );
			?>
		</p>
	</div>
	<?php

	// Buttons
	?>
	<div class="law_office_notice_buttons">
		<?php
		// Link to the theme dashboard page
		?>
		<a href="<?php echo esc_url( $law_office_skins_url ); ?>" class="button button-primary"><i class="dashicons dashicons-update"></i> 
			<?php
			// Translators: Add theme name
			esc_html_e( 'Go to Skins manager', 'law-office' );
			?>
		</a>
	</div>
</div>
