<?php
/**
 * The template to display Admin notices
 *
 * @package TOURIMO
 * @since TOURIMO 1.0.1
 */

$tourimo_theme_slug = get_option( 'template' );
$tourimo_theme_obj  = wp_get_theme( $tourimo_theme_slug );
?>
<div class="tourimo_admin_notice tourimo_welcome_notice update-nag">
	<?php
	// Theme image
	$tourimo_theme_img = tourimo_get_file_url( 'screenshot.jpg' );
	if ( '' != $tourimo_theme_img ) {
		?>
		<div class="tourimo_notice_image"><img src="<?php echo esc_url( $tourimo_theme_img ); ?>" alt="<?php esc_attr_e( 'Theme screenshot', 'tourimo' ); ?>"></div>
		<?php
	}

	// Title
	?>
	<h3 class="tourimo_notice_title">
		<?php
		echo esc_html(
			sprintf(
				// Translators: Add theme name and version to the 'Welcome' message
				__( 'Welcome to %1$s v.%2$s', 'tourimo' ),
				$tourimo_theme_obj->get( 'Name' ) . ( TOURIMO_THEME_FREE ? ' ' . __( 'Free', 'tourimo' ) : '' ),
				$tourimo_theme_obj->get( 'Version' )
			)
		);
		?>
	</h3>
	<?php

	// Description
	?>
	<div class="tourimo_notice_text">
		<p class="tourimo_notice_text_description">
			<?php
			echo str_replace( '. ', '.<br>', wp_kses_data( $tourimo_theme_obj->description ) );
			?>
		</p>
		<p class="tourimo_notice_text_info">
			<?php
			echo wp_kses_data( __( 'Attention! Plugin "ThemeREX Addons" is required! Please, install and activate it!', 'tourimo' ) );
			?>
		</p>
	</div>
	<?php

	// Buttons
	?>
	<div class="tourimo_notice_buttons">
		<?php
		// Link to the page 'About Theme'
		?>
		<a href="<?php echo esc_url( admin_url() . 'themes.php?page=tourimo_about' ); ?>" class="button button-primary"><i class="dashicons dashicons-nametag"></i> 
			<?php
			echo esc_html__( 'Install plugin "ThemeREX Addons"', 'tourimo' );
			?>
		</a>
		<?php		
		// Dismiss this notice
		?>
		<a href="#" data-notice="admin" class="tourimo_hide_notice"><i class="dashicons dashicons-dismiss"></i> <span class="tourimo_hide_notice_text"><?php esc_html_e( 'Dismiss', 'tourimo' ); ?></span></a>
	</div>
</div>
