<?php
/**
 * Getting Started Page.
 *
 * @package roof_water_proofing
 */


if( ! function_exists( 'roof_water_proofing_getting_started_menu' ) ) :
/**
 * Adding Getting Started Page in admin menu
 */
function roof_water_proofing_getting_started_menu(){	
	add_theme_page(
		__( 'Getting Started', 'roof-water-proofing' ),
		__( 'Getting Started', 'roof-water-proofing' ),
		'manage_options',
		'roof-water-proofing-getting-started',
		'roof_water_proofing_getting_started_page'
	);
}
endif;
add_action( 'admin_menu', 'roof_water_proofing_getting_started_menu' );

if( ! function_exists( 'roof_water_proofing_getting_started_admin_scripts' ) ) :
/**
 * Load Getting Started styles in the admin
 */
function roof_water_proofing_getting_started_admin_scripts( $hook ){
	// Load styles only on our page
	if( 'appearance_page_roof-water-proofing-getting-started' != $hook ) return;

    wp_enqueue_style( 'roof-water-proofing-getting-started', get_template_directory_uri() . '/resource/css/getting-started.css', false, ROOF_WATER_PROOFING_THEME_VERSION );

    wp_enqueue_script( 'roof-water-proofing-getting-started', get_template_directory_uri() . '/resource/js/getting-started.js', array( 'jquery' ), ROOF_WATER_PROOFING_THEME_VERSION, true );
}
endif;
add_action( 'admin_enqueue_scripts', 'roof_water_proofing_getting_started_admin_scripts' );

if( ! function_exists( 'roof_water_proofing_getting_started_page' ) ) :
/**
 * Callback function for admin page.
*/
function roof_water_proofing_getting_started_page(){ 
	$roof_water_proofing_theme = wp_get_theme();?>
	<div class="wrap getting-started container">
		<div class="getting-info">
			<div class="theme-intro">
				<div class="intro-wrap">
					<div class="intro cointaner">
						<div class="intro-content">
							<h3><?php echo esc_html( 'Welcome to', 'roof-water-proofing' );?> <span class="theme-name"><?php echo esc_html( ROOF_WATER_PROOFING_THEME_NAME ); ?></span></h3>
							<p class="about-text">
								<?php
								// Remove last sentence of description.
								$roof_water_proofing_description = explode( '. ', $roof_water_proofing_theme->get( 'Description' ) );

								$roof_water_proofing_description = implode( '. ', $roof_water_proofing_description );

								echo esc_html( $roof_water_proofing_description . '' );
							?></p>
							<div class="btns-getstart">
								<a href="<?php echo esc_url( ROOF_WATER_PROOFING_PREMIUM_PAGE ); ?>" target="_blank" class="button button-primary"><?php esc_html_e( 'Get Premium', 'roof-water-proofing' ); ?></a>
								<a href="<?php echo esc_url( ROOF_WATER_PROOFING_PRO_DEMO ); ?>" target="_blank" class="button button-primary"><?php esc_html_e( 'Live Demo', 'roof-water-proofing' ); ?></a>
								<a href="<?php echo esc_url( admin_url( 'customize.php' ) ); ?>" target="_blank" class="button button-primary"><?php esc_html_e( 'Customize Theme', 'roof-water-proofing' ); ?></a>
							</div>
							<div class="btns-wizard">
                                <?php if ( ! get_option('is-demo-imported') ) : ?>
                                    <a class="wizard" href="<?php echo esc_url( admin_url( 'themes.php?page=roofwaterproofing-wizard' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Import Theme Demo', 'roof-water-proofing' ); ?></a>
                                <?php else : ?>
                                    <a target="_blank" href="<?php echo esc_url( home_url() ); ?>" class="button button-primary view-site">
                                        <?php esc_html_e( 'Visit Your Website', 'roof-water-proofing' ); ?>
                                    </a>
                                <?php endif; ?>
  							</div>
						</div>
						<div class="intro-img">
							<img src="<?php echo esc_url(get_template_directory_uri()) .'/theme-library/getting-started/images/bundle.png'; ?>" />										
							<br>
							<h4 class="bundle-text"><?php esc_html_e( 'WP Theme Bundle', 'roof-water-proofing' ); ?></h4>
							<p class="about-text"><?php esc_html_e('Get access to a collection of premium WordPress themes in one bundle. Enjoy effortless website building, full customization, and dedicated customer support for a smooth, professional web experience.', 'roof-water-proofing'); ?></p>
							<a class="button button-primary" href="<?php echo esc_url( ROOF_WATER_PROOFING_BUNDLE_PAGE ); ?>" title="<?php esc_attr_e( 'Go Pro', 'roof-water-proofing' ); ?>" target="_blank">
								<?php esc_html_e( 'Exclusive Theme Bundle - $79', 'roof-water-proofing' ); ?>
							</a>
						</div>
					</div>
				</div>
				<div class="cointaner panels">
					<ul class="inline-list">
						<li class="current">
							<a id="help" href="javascript:void(0);">
								<?php esc_html_e( 'Getting Started', 'roof-water-proofing' ); ?>
							</a>
						</li>
						<li>
							<a id="free-pro-panel" href="javascript:void(0);">
								<?php esc_html_e( 'Free Vs Pro', 'roof-water-proofing' ); ?>
							</a>
						</li>
					</ul>
					<div id="panel" class="panel">
						<?php require get_template_directory() . '/theme-library/getting-started/tabs/help-panel.php'; ?>
						<?php require get_template_directory() . '/theme-library/getting-started/tabs/free-vs-pro-panel.php'; ?>
						<?php require get_template_directory() . '/theme-library/getting-started/tabs/link-panel.php'; ?>
					</div>
				</div>
			</div>
			<div class="icons-info">
				<div class="icon-img">									
					<a href="<?php echo esc_url( ROOF_WATER_PROOFING_REVIEW ); ?>" title="<?php esc_attr_e( 'Review Theme', 'roof-water-proofing' ); ?>" target="_blank">
						<img src="<?php echo esc_url(get_template_directory_uri()) .'/theme-library/getting-started/images/icon1.png'; ?>" />	
						<?php esc_html_e( 'Review Theme', 'roof-water-proofing' ); ?>
					</a>
				</div>
				<div class="icon-img">									
					<a href="<?php echo esc_url( ROOF_WATER_PROOFING_SUPPORT ); ?>" title="<?php esc_attr_e( 'Contact Support', 'roof-water-proofing' ); ?>" target="_blank">
						<img src="<?php echo esc_url(get_template_directory_uri()) .'/theme-library/getting-started/images/icon2.png'; ?>" />	
						<?php esc_html_e( 'Contact Support', 'roof-water-proofing' ); ?>
					</a>
				</div>
				<div class="icon-img">									
					<a href="<?php echo esc_url( ROOF_WATER_PROOFING_THEME_DOCUMENTATION ); ?>" title="<?php esc_attr_e( 'Free Theme Documentation', 'roof-water-proofing' ); ?>" target="_blank">
						<img src="<?php echo esc_url(get_template_directory_uri()) .'/theme-library/getting-started/images/icon3.png'; ?>" />	
						<?php esc_html_e( 'Free Theme Documentation', 'roof-water-proofing' ); ?>
					</a>
				</div>
			</div>	
		</div>	
	</div>
	<?php
}
endif;