<?php

add_action( 'admin_menu', 'video_streaming_gettingstarted' );
function video_streaming_gettingstarted() {    	
	add_theme_page( esc_html__('About Theme', 'video-streaming'), esc_html__('Theme Demo Import', 'video-streaming'), 'edit_theme_options', 'video-streaming-guide-page', 'video_streaming_guide');   
}

function video_streaming_admin_theme_style() {
   wp_enqueue_style('video-streaming-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('video-streaming-tab', esc_url( get_template_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');

   // Admin notice code START
	wp_register_script('video-streaming-notice', esc_url(get_template_directory_uri()) . '/inc/dashboard/js/notice.js', array('jquery'), time(), true);
	wp_enqueue_script('video-streaming-notice');
	// Admin notice code END
}
add_action('admin_enqueue_scripts', 'video_streaming_admin_theme_style');

// Notice after Theme Activation
add_action('admin_notices', 'video_streaming_notice');

function video_streaming_notice(){
    // Hide permanently if dismissed
    if ( get_option('video_streaming_admin_notice') == 1 ) {
        return;
    }
    // Hide ONLY on Get Started page
    if ( isset($_GET['page']) && $_GET['page'] === 'video-streaming-guide-page' ) {
        return;
    }  {?>
    <div id="video-streaming-welcome-notice" class="notice notice-success is-dismissible getting_started activation-notice">
		<div class="notice-info">
			<div class="notice-image">
				<img style="width: 100%;max-width: 320px;line-height: 40px;display: inline-block;vertical-align: top;" src="<?php echo esc_url(get_stylesheet_directory_uri()) .'/screenshot.png'; ?>" />
			</div>
			<div class="notice-content">
				<h2><?php esc_html_e( 'Thanks For Installing Video Streaming, You Rock!', 'video-streaming' ) ?> </h2>
				<p><?php esc_html_e( 'Take benefit of a variety of features, functionalities, elements, and an exclusive set of customization options to build your own professional charity website. Please Click on the link below to know the theme setup information.', 'video-streaming' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=video-streaming-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'video-streaming' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( VIDEO_STREAMING_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'video-streaming') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( VIDEO_STREAMING_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'video-streaming') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( VIDEO_STREAMING_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'video-streaming') ?></a>
				</div>
			</div>
		</div>
	</div>
	<?php }
}

// Admin notice code START
add_action('wp_ajax_video_streaming_dismiss_notice', 'video_streaming_dismiss_notice');
function video_streaming_dismiss_notice() {
    update_option('video_streaming_admin_notice', 1);
    wp_die();
}

//After Switch theme function
add_action('after_switch_theme', 'video_streaming_getstart_setup_options');
function video_streaming_getstart_setup_options () {
    delete_option('video_streaming_admin_notice');
}
// Admin notice code END

/**
 * Theme Info Page
 */
function video_streaming_guide() {

	// Theme info
	$video_streaming_return = add_query_arg( array()) ;
	$video_streaming_theme = wp_get_theme( 'video-streaming' ); ?>

	<div class="wrap getting-started">
		<div class="getting-started__header">
		    <div>
                <h2 class="tgmpa-notice-warning"></h2>
            </div>
		</div>
		<div class="tab-sec">
			<div class="tab">
				<button role="tab" class="tablinks home" onclick="video_streaming_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'video-streaming' ); ?></button>
				<button role="tab" class="tablinks" onclick="video_streaming_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'video-streaming' ); ?></button>
				<button role="tab" class="tablinks" onclick="video_streaming_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'video-streaming' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( VIDEO_STREAMING_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'video-streaming' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( VIDEO_STREAMING_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'video-streaming' ); ?>
				</a>
			</div>
			<div  id="bwp_getstart" class="tabcontent">
				<div class="row">
					<div class="col-md-5 intro">
						<div class="pad-box">
							<h2><?php esc_html_e( 'Welcome to Video Streaming ', 'video-streaming' ); ?>
							<span><?php esc_html_e( 'Version: ', 'video-streaming' ); ?><?php echo esc_html($video_streaming_theme['Version']);?></span>
							</h2>
							<span class="intro__version"><?php esc_html_e( 'Congratulations! You are about to use the most easy to use and flexible WordPress theme.', 'video-streaming' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'video-streaming' ); ?></strong></p>
								<p>
									<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/theme-logo.png'); ?>"/>
								</p>
								<div class="demo-content">
									<?php
										/* Demo Import */
										require get_parent_theme_file_path( '/inc/dashboard/demo-content.php' );
									?>
								</div>

								<div id="demo-import-loader">
									<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/spinner.gif'); ?>" alt="<?php echo esc_attr( 'Loading...', 'video-streaming'); ?>" />
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-7">
						<div class="install-plugins">
							<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive1.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'video-streaming'); ?>" />
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','video-streaming'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( VIDEO_STREAMING_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','video-streaming'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( VIDEO_STREAMING_PRO_SUPPORT ); ?>"><?php esc_html_e( 'Premium Theme Support','video-streaming'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','video-streaming'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','video-streaming'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','video-streaming'); ?></a> <?php esc_html_e( 'your website.','video-streaming'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','video-streaming'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( VIDEO_STREAMING_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','video-streaming'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( VIDEO_STREAMING_PRO_DOC ); ?>"><?php esc_html_e( 'Premium Theme Documentation','video-streaming'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Buy Premium','video-streaming'); ?></h3>
							<ol>
								<a href="<?php echo esc_url( VIDEO_STREAMING_BUY_PRO ); ?>" target="_blank"><?php esc_html_e('Buy Pro', 'video-streaming'); ?></a>
							</ol>
						</div>
					</div>
				</div>
			</div>
			<div  id="bwp_setup" class="tabcontent">
				<h2 class="tg-docs-section intruction-title" id="section-4"><?php esc_html_e( '1) Setup Video Streaming Theme', 'video-streaming' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Video Streaming offers a wealth of opportunities for creating a dynamic and engaging website, whether for a video blog, online courses, live streaming, or virtual events. It’s perfect for hosting video portfolios, OTT platforms, e-learning websites, sports broadcasting, video tutorials, influencer marketing, video podcasts, and music streaming channels, and can also function as a powerful aggregator that collects and displays content from multiple sources in one place. Whether you’re building media services, video consultancy sites, or webinar platforms, this solution provides all the tools needed for seamless video integration. Built with a powerful video player plugin for easy embedding and playback, it ensures smooth performance and compatibility with major streaming services like YouTube, Vimeo, and Twitch. Designed on a robust foundation, this platform helps you create a fully functional, responsive video streaming site that delivers fast load times, high interactivity, and a professional appearance. The layout is customizable, SEO-friendly, and designed for easy navigation, making it suitable for any kind of video-based website, including a video aggregator platform. CTA buttons guide visitors toward desired actions, while integrated social media icons enhance promotion across popular platforms. With clean code, secure structure, and mobile responsiveness, your website will run smoothly even under high traffic. Featuring testimonial sections, banner animations, video sliders, and multiple customization options, this theme offers the perfect blend of performance and design flexibility. Built on the Bootstrap framework, it provides scalability, adaptability, and a seamless viewing experience across all devices.', 'video-streaming' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','video-streaming'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','video-streaming'); ?></a> <?php esc_html_e( 'your website.','video-streaming'); ?> </l>
								<li><?php esc_html_e( 'Video Streaming','video-streaming'); ?> <a target="_blank" href="<?php echo esc_url( VIDEO_STREAMING_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','video-streaming'); ?></a> </li>
							</ol>
						</div>
					</div>
					<div class="col-md-5">
						<div class="pad-box">
								<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/screenshot.png'); ?>"/>
						</div>
					</div>	
				</div>
			</div>
			<div class="col-md-12 text-block tabcontent"  id="bwp_premium_info">
				<h2 class="dashboard-install-title"><?php esc_html_e( '2) Premium Theme Information.','video-streaming'); ?></h2>
				<div class="row">
					<div class="col-md-7">
						<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'video-streaming'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','video-streaming'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'This Free Video Streaming WordPress theme is designed for a high-performance and well-functioning website. It is suitable for a wide variety of purposes such as video websites, gaming, streaming, video theme, video magazine, Vimeo, multimedia, video portal, video production, and many more. The theme has an energetic vibe to it, which appeals to customers or visitors. It contains the Bootstrap framework, which facilitates website development by offering a variety of tools and features on the theme. It is undeniably valuable since it is built using efficient, secure, and clean code. This WordPress theme has a translation feature, as well as a full, safe, and clean code. The has a testimonial box for a more prominent display of important comments.', 'video-streaming' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','video-streaming'); ?></h3>
							<div class="dashboard-install-benefit">
							    <ul>
									<li><?php esc_html_e( 'Car listing Shortcode with category','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Car listing Shortcode','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Multiple image feature for each property with slider.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Brand Listing Section','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Car Brand(categories) Option','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Car Tags(categories) Option','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Testimonial listing.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Testimonial shortcode.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Social icons widget.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Latest post with the image widget.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Live customize editor for the About US section.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Font Awesome integrated.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets.','video-streaming'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Well sanitized as per WordPress standards.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Allow to set site title, tagline, logo.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page.','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Footer Widgets & Editor style','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Gallery & Banner functionality','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Full-width Template','video-streaming'); ?></li>
									<li><?php esc_html_e( 'Custom Menu, Colors Editor','video-streaming'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>