<?php
/*
 * @package Nova Photography Portfolio
 */

 function nova_photography_portfolio_admin_enqueue_scripts() {
    wp_enqueue_style( 'nova-photography-portfolio-admin-style', esc_url( get_template_directory_uri() ).'/getstart/getstart.css' );
}
add_action( 'admin_enqueue_scripts', 'nova_photography_portfolio_admin_enqueue_scripts' );

function nova_photography_portfolio_admin_notice_scripts( $hook ) {

	wp_enqueue_script(
		'nova-photography-portfolio-admin-notice',
		get_template_directory_uri() . '/js/admin-notice.js',
		array( 'jquery' ),
		'1.0',
		true
	);

	wp_localize_script(
		'nova-photography-portfolio-admin-notice',
		'nova_photography_portfolio_localize',
		array(
			'ajax_url' => admin_url( 'admin-ajax.php' ),
			'nonce'    => wp_create_nonce( 'nova_photography_portfolio_notice_nonce' ),
		)
	);
}
add_action( 'admin_enqueue_scripts', 'nova_photography_portfolio_admin_notice_scripts' );

function nova_photography_portfolio_deprecated_hook_admin_notice() {

	// Don't show if dismissed.
	if ( get_option( 'dismissed-get_started_notice', false ) ) {
		return;
	}

	$screen = get_current_screen();

	// Don't show on the Getting Started page.
	if ( $screen && 'appearance_page_nova-photography-portfolio' === $screen->id ) {
		return;
	}

	$nova_photography_portfolio_comments_theme = wp_get_theme();
	?>

	<div class="nova-photography-portfolio-notice-wrapper notice notice-get-started-class is-dismissible" data-notice="get_started_notice">
		<div class="nova-photography-portfolio-notice">
			<div class="nova-photography-portfolio-notice-content">
				<div class="nova-photography-portfolio-notice-heading">
					<h2 class="notice-title1"><?php echo esc_html__('Welcome! Thanks For Installing', 'nova-photography-portfolio' ); ?></h2>
					<h2 class="notice-title2"><?php echo esc_html( $nova_photography_portfolio_comments_theme ); ?> 🎉</h2>
					<p class="notice-text">
						<?php
						printf(
							/* translators: %s: Theme name */
							esc_html__( "You're all set to build something amazing.", 'nova-photography-portfolio' ),
						);
						?>
					</p>
				</div>
				<div class="diplay-flex-btn">
					<a class="button button-primary theme-install nova-photography-portfolio-get-started"
						href="<?php echo esc_url( admin_url( 'themes.php?page=nova-photography-portfolio' ) ); ?>">
						<?php echo esc_html__('GET STARTED', 'nova-photography-portfolio' ); ?>
					</a>

					<a class="button button-primary" target="_blank"
						href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_PREMIUM_PAGE ); ?>">
						<?php echo esc_html__('GO PRO', 'nova-photography-portfolio' ); ?>
					</a>

					<a class="button button-primary" target="_blank"
						href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_BUNDLE_PAGE ); ?>">
						<?php echo esc_html__('Get Bundle', 'nova-photography-portfolio' ); ?>
					</a>
				</div>
			</div>
			<div class="nova-photography-portfolio-notice-img">
				<img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/btm-bundle-img.png'); ?>" alt="<?php echo esc_attr('Logo', 'nova-photography-portfolio' ); ?>">
			</div>
		</div>
	</div>
	<?php
}
add_action( 'admin_notices', 'nova_photography_portfolio_deprecated_hook_admin_notice' );

// After switching theme, reset dismissed notice option
add_action('after_switch_theme', 'nova_photography_portfolio_after_switch_theme');
function nova_photography_portfolio_after_switch_theme() {
    update_option('dismissed-get_started_notice', FALSE);
}

function nova_photography_portfolio_dismiss_admin_notice() {
	check_ajax_referer( 'nova_photography_portfolio_notice_nonce', 'nonce' );
	update_option( 'dismissed-get_started_notice', true );
	wp_send_json_success();
}
add_action( 'wp_ajax_nova_photography_portfolio_dismiss_admin_notice', 'nova_photography_portfolio_dismiss_admin_notice' );

function nova_photography_portfolio_dismiss_quick_start_guide() {
	check_ajax_referer( 'nova_photography_portfolio_notice_nonce', 'nonce' );
	update_option( 'dismissed-quick_start_guide', true );
	wp_send_json_success();
}
add_action( 'wp_ajax_nova_photography_portfolio_dismiss_quick_start_guide', 'nova_photography_portfolio_dismiss_quick_start_guide' );

function nova_photography_portfolio_theme_info_menu_link() {
    $nova_photography_portfolio_theme = wp_get_theme();
    add_theme_page(
        /* translators: 1: Theme name. */
        sprintf( esc_html__( 'Welcome to %1$s', 'nova-photography-portfolio' ), $nova_photography_portfolio_theme->get( 'Name' )),
        esc_html__( 'Getting Started', 'nova-photography-portfolio' ),
        'edit_theme_options',
        'nova-photography-portfolio',
        'nova_photography_portfolio_theme_info_page'
    );
}
add_action( 'admin_menu', 'nova_photography_portfolio_theme_info_menu_link' );

function nova_photography_portfolio_theme_info_page() {
    $nova_photography_portfolio_theme = wp_get_theme();
    ?>
    <div class="getstarted-info">
        <!-- quick start guide -->
       <?php if ( ! get_option( 'dismissed-quick_start_guide', false ) ) : ?>
       <div class="quick-start-guide" data-notice="quick_start_guide">
         <div class="left-info">
            <i class="dashicons dashicons-store gradient-text"></i>
            <p><?php echo esc_html__('New here? Check our quick start guide to launch your website in minutes.','nova-photography-portfolio'); ?></p>
         </div>
         <div class="right-info">
            <a class="gradient-text" href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_THEME_DOCUMENTATION ); ?>" target="_blank"><?php echo esc_html__('View Quick Start Guide','nova-photography-portfolio'); ?><i class="dashicons dashicons-arrow-right-alt"></i></a>
            <button class="quick-start-guide-dismiss" aria-label="<?php esc_attr_e( 'Dismiss', 'nova-photography-portfolio' ); ?>">&times;</button>
         </div>
       </div>
       <?php endif; ?>
       <!-- getstart banner -->
        <div class="getstart-banner">
            <div class="left-banner-info">
                <h4><?php echo esc_html__('Unlock the Full Power of','nova-photography-portfolio'); ?></h4>
                <h2><i class="dashicons dashicons-star-filled"></i><?php echo esc_html__('Nova Themes','nova-photography-portfolio'); ?></h2>
                <div class="information">
                    <div class="theme-info">
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Premium Starter Sites','nova-photography-portfolio'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Advanced Theme Options','nova-photography-portfolio'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Priority Support & Updates','nova-photography-portfolio'); ?></p>
                    </div>
                    <div class="theme-info">
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Custom Templates & Parts','nova-photography-portfolio'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('WooCommerce Compatible','nova-photography-portfolio'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Regular Updates & Support','nova-photography-portfolio'); ?></p>
                    </div>
                </div>
                <div class="left-btn">
                    <a href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_PREMIUM_PAGE ); ?>" target="_blank"><?php echo esc_html__('Upgrade To Premium at $45 ','nova-photography-portfolio'); ?><i class="dashicons dashicons-arrow-right-alt"></i></a>
                    <a href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_PRO_DEMO ); ?>" target="_blank"><?php echo esc_html__('Live Demo','nova-photography-portfolio'); ?></a>
                </div>
            </div>
            <div class="middle-banner-info">
                <div class="bundle-image">
                    <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/mid-bundle-img.png'); ?>" alt="<?php echo esc_attr( 'bundle image', 'nova-photography-portfolio'); ?>"/>
                </div>
            </div>
            <div class="right-banner-info">
                <div class="right-info">
                    <div class="theme-bundle">
                        <div class="save-tag"><?php echo esc_html__('SAVE BIG!','nova-photography-portfolio'); ?></div>
                        <h4><?php echo esc_html__('Get Theme Bundle','nova-photography-portfolio'); ?></h4>
                        <h2><span class="text"><?php echo esc_html__('For','nova-photography-portfolio'); ?></span><?php echo esc_html__('$79','nova-photography-portfolio'); ?><span class="value"><?php echo esc_html__('$3799','nova-photography-portfolio'); ?></span></h2>
                        <div class="right-btn">
                            <a href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_BUNDLE_PAGE ); ?>" target="_blank"><?php echo esc_html__('Get Bundle Now','nova-photography-portfolio'); ?></a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- getstart Info -->
         <div class="getstart-info">
            <div class="left-getstart-info">
                <!-- About Theme -->
                 <div class="about-desc">
                    <div class="about-info">
                        <div class="names">
                            <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/logo.png'); ?>" alt="<?php echo esc_attr( 'Logo', 'nova-photography-portfolio'); ?>"/>
                            <h2><?php echo esc_html__('About Nova Themes','nova-photography-portfolio'); ?></h2>
                        </div>
                        <p><?php echo esc_html__('Nova Themes is dedicated to creating modern, fast, and flexible WordPress themes that help you build stunning websites with ease. Our themes are perfect for any business, blog, portfolio, or online store.','nova-photography-portfolio'); ?></p>
                        <div class="icon-info">
                            <div class="icon-structure">
                                <i class="dashicons dashicons-search gradient-text"></i>
                                <p><?php echo esc_html__('Lightning Fast','nova-photography-portfolio'); ?></p>
                            </div>
                            <div class="icon-structure"><span class=""></span>
                                <i class="dashicons dashicons-smartphone gradient-text"></i>
                                <p><?php echo esc_html__('SEO Optimized','nova-photography-portfolio'); ?></p>
                            </div>
                            <div class="icon-structure">
                                <i class="dashicons dashicons-admin-customizer gradient-text"></i>
                                <p><?php echo esc_html__('Mobile Friendly','nova-photography-portfolio'); ?></p>
                            </div>
                            <div class="icon-structure">
                                <i class="dashicons dashicons-layout gradient-text"></i>
                                <p><?php echo esc_html__('Easy to Customize','nova-photography-portfolio'); ?></p>
                            </div>
                        </div>
                    </div>
                    <div class="about-image">
                        <img src="<?php echo esc_url( $nova_photography_portfolio_theme->get_screenshot() ); ?>" alt="<?php echo esc_attr( 'screenshot', 'nova-photography-portfolio'); ?>"/>
                    </div>
                 </div>
                <!-- Important Links -->
                <div class="important-info">
                    <h3><?php echo esc_html__('Important Links','nova-photography-portfolio'); ?></h4>
                    <div class="links-cards">
                        <div class="links-card first-card">
                            <i class="dashicons dashicons-admin-appearance"></i>
                            <h4><?php echo esc_html__( 'Site Editor', 'nova-photography-portfolio' ); ?></h4>
                            <p><?php echo esc_html__( 'Edit templates, patterns, and styles easily with the WordPress Site Editor.', 'nova-photography-portfolio' ); ?></p>
                            <br>
                            <a href="<?php echo esc_url( admin_url( 'site-editor.php' ) ); ?>" target="_blank"><?php echo esc_html__( 'Go to Editor', 'nova-photography-portfolio' ); ?></a>
                        </div>
                        <div class="links-card second-card">
                            <i class="dashicons dashicons-admin-users"></i>
                            <h4><?php echo esc_html__('Need Help?','nova-photography-portfolio'); ?></h4>
                            <p><?php echo esc_html__('Visit our support center for docs, tutorials and frequently asked questions.','nova-photography-portfolio'); ?></p>
                            <br>
                            <a href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_SUPPORT ); ?>" target="_blank"><?php echo esc_html__('Get Support','nova-photography-portfolio'); ?></a>
                        </div>
                        <div class="links-card first-card">
                            <i class="dashicons dashicons-star-filled"></i>
                            <h4><?php echo esc_html__('Leave a Review','nova-photography-portfolio'); ?></h4>
                            <p><?php echo esc_html__('Love our theme? Please consider leaving a review. It means a lot to us!','nova-photography-portfolio'); ?></p>
                            <br>
                            <a href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_REVIEW ); ?>" target="_blank"><?php echo esc_html__('Rate Us','nova-photography-portfolio'); ?></a>
                        </div>
                    </div>
                </div>
                <!-- Premium Sec -->
                 <div class="premium-sec">
                    <div class="premium-left-sec">
                        <h3><?php echo esc_html__('Why Go For Premium?','nova-photography-portfolio'); ?></h3>
                        <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/premium-img.png'); ?>" alt="<?php echo esc_attr( 'premium image', 'nova-photography-portfolio'); ?>"/>
                    </div>
                    <div class="premium-right-sec">
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Premium Starter Sites','nova-photography-portfolio'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Advanced Theme Options','nova-photography-portfolio'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('WooCommerce Ready','nova-photography-portfolio'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Priority Support','nova-photography-portfolio'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Regular Updates','nova-photography-portfolio'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('And Much More...','nova-photography-portfolio'); ?></p>
                    </div>
                 </div>
            </div>
            <div class="right-getstart-info">
              <div class="right-premium-info">
                <h3><?php echo esc_html__('👑 Go Premium','nova-photography-portfolio'); ?></h3>
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/premium-img1.png'); ?>" alt="<?php echo esc_attr( 'bundle image', 'nova-photography-portfolio'); ?>"/>
                <div class="info-list">
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('Access to All Premium Themes','nova-photography-portfolio'); ?></p>
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('One Click Demo Import','nova-photography-portfolio'); ?></p>
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('Advanced Customization','nova-photography-portfolio'); ?></p>
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('Premium Support','nova-photography-portfolio'); ?></p>
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('Lifetime Updates','nova-photography-portfolio'); ?></p>
                </div>
                <h4><?php echo esc_html__('Save Big! ','nova-photography-portfolio'); ?><span class="color-word gradient-text"><?php echo esc_html__('Extra 20% OFF','nova-photography-portfolio'); ?></span><span class="small-word"></span><?php echo esc_html__(' on','nova-photography-portfolio'); ?></h4>
                <h5><?php echo esc_html__('All Premium Themes','nova-photography-portfolio'); ?></h5>
                <h5><?php echo esc_html__('Use Code: ','nova-photography-portfolio'); ?><strong><?php echo esc_html__('FLAT20','nova-photography-portfolio'); ?></strong></h5>
                <div class="premium-info-btn">
                 <a href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_PREMIUM_PAGE ); ?>" target="_blank">
                    <h5><?php echo esc_html__('Upgrade To Pro','nova-photography-portfolio'); ?></h5>
                    <h6><?php echo esc_html__('Just ','nova-photography-portfolio'); ?><span class="reg-price"><?php echo esc_html__('$59.00','nova-photography-portfolio'); ?></span><span class="sel-price"><?php echo esc_html__('$45.00','nova-photography-portfolio'); ?></span></h6>
                 </a>
                </div>
              </div>
              <div class="right-info-desc">
                <h3><?php echo esc_html__('Explore Our Themes','nova-photography-portfolio'); ?></h3>
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/btm-bundle-img.png'); ?>" alt="<?php echo esc_attr( 'bundle image', 'nova-photography-portfolio'); ?>"/><br><br>
                <h5><?php echo esc_html__('Beautiful, Fast & Reliable','nova-photography-portfolio'); ?></h5>
                <h5><?php echo esc_html__('WordPress Themes','nova-photography-portfolio'); ?></h5><br>
                <div class="theme-btn">
                 <a href="<?php echo esc_url( NOVA_PHOTOGRAPHY_PORTFOLIO_COLLECTION_PAGE ); ?>" class="gradient-text" target="_blank"><?php echo esc_html__('View All Themes','nova-photography-portfolio'); ?></a>
                </div>
              </div>
            </div>
         </div>
        <!-- Icons Info -->
        <div class="icon-cards">
            <div class="icon-card">
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/card-img1.png'); ?>" alt="<?php echo esc_attr( 'Card Image', 'nova-photography-portfolio'); ?>"/>
                <div class="icon-desc">
                    <h4><?php echo esc_html__('Trusted by Thousands','nova-photography-portfolio'); ?></h4>
                    <p><?php echo esc_html__('Join thousands of happy customers using Nova Themes.','nova-photography-portfolio'); ?></p>
                </div>
            </div>
            <div class="icon-card">
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/card-img2.png'); ?>" alt="<?php echo esc_attr( 'Card Image', 'nova-photography-portfolio'); ?>"/>
                <div class="icon-desc">
                    <h4><?php echo esc_html__('Regular Updates','nova-photography-portfolio'); ?></h4>
                    <p><?php echo esc_html__('We update our themes regularly with new features.','nova-photography-portfolio'); ?></p>
                </div>
            </div>
            <div class="icon-card">
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/card-img3.png'); ?>" alt="<?php echo esc_attr( 'Card Image', 'nova-photography-portfolio'); ?>"/>
                <div class="icon-desc">
                    <h4><?php echo esc_html__('Secure & Reliable','nova-photography-portfolio'); ?></h4>
                    <p><?php echo esc_html__('Clean code, secure & built with best practices.','nova-photography-portfolio'); ?></p>
                </div>
            </div>
            <div class="icon-card">
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/card-img4.png'); ?>" alt="<?php echo esc_attr( 'Card Image', 'nova-photography-portfolio'); ?>"/>
                <div class="icon-desc">
                    <h4><?php echo esc_html__('Dedicated Support','nova-photography-portfolio'); ?></h4>
                    <p><?php echo esc_html__('We\'re here to help you succeed. Anytime.','nova-photography-portfolio'); ?></p>
                </div>
            </div>
        </div>
    </div>
<?php
}
?>