<?php
add_action( 'admin_menu', 'master_study_lite_gettingstarted' );
function master_study_lite_gettingstarted() {
	add_theme_page( esc_html__('About Theme', 'master-study-lite'), esc_html__('Theme Demo Import', 'master-study-lite'), 'edit_theme_options', 'master-study-lite-guide-page', 'master_study_lite_guide');
}

function master_study_lite_admin_theme_style() {
   wp_enqueue_style('master-study-lite-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('master-study-lite-tab', esc_url( get_template_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');
   wp_enqueue_script('master-study-lite-bundle-banner', get_template_directory_uri() . '/inc/dashboard/js/bundle_banner.js', array(), false, true);

	// Admin notice code START
	wp_register_script('master-study-lite-notice', esc_url(get_template_directory_uri()) . '/inc/dashboard/js/notice.js', array('jquery'), time(), true);
	wp_enqueue_script('master-study-lite-notice');
	// Admin notice code END
}
add_action('admin_enqueue_scripts', 'master_study_lite_admin_theme_style');

// Notice after Theme Activation
function master_study_lite_notice(){
    global $pagenow;
    if ( is_admin() && $pagenow === 'themes.php' && (!isset($_GET['page']) || $_GET['page'] !== 'master-study-lite-guide-page')
) {
$master_study_lite_meta = get_option( 'master_study_lite_admin_notice' );
	if (!$master_study_lite_meta) {?>
    <div id="master-study-lite-welcome-notice" class="notice notice-success is-dismissible getting_started activation-notice">
		<div class="notice-info-row">
			<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 Master Study Lite, You Rock!', 'master-study-lite' ) ?> </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.', 'master-study-lite' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=master-study-lite-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'master-study-lite' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( MASTER_STUDY_LITE_BUY_BUNDLE ); ?>"><?php esc_html_e('Get Bundle', 'master-study-lite') ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( MASTER_STUDY_LITE_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'master-study-lite') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( MASTER_STUDY_LITE_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'master-study-lite') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( MASTER_STUDY_LITE_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'master-study-lite') ?></a>
				</div>
			</div>
		</div>
	</div>
	<?php }
}
}
add_action('admin_notices', 'master_study_lite_notice');

// Admin notice code START
function master_study_lite_dismissed_notice() {
	update_option( 'master_study_lite_admin_notice', true );
}
add_action( 'wp_ajax_master_study_lite_dismissed_notice', 'master_study_lite_dismissed_notice' );

//After Switch theme function
add_action('after_switch_theme', 'master_study_lite_getstart_setup_options');
function master_study_lite_getstart_setup_options () {
    update_option('master_study_lite_admin_notice', false );
}
// Admin notice code END

/**
 * Theme Info Page
 */
function master_study_lite_guide() {
	// Theme info
	$master_study_lite_return = add_query_arg( array()) ;
	$master_study_lite_theme = wp_get_theme( 'master-study-lite' ); ?>

	<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="bwp-bundle-banner">
				<div class="bwp-bundle-banner__row">
					<div class="bwp-bundle-banner__content">
						<span class="bwp-bundle-banner__badge"><?php esc_html_e( 'Limited Time Deal - 25% Off', 'master-study-lite' ); ?></span>
						<h2 class="bwp-bundle-banner__title"><?php esc_html_e( '250+ Premium WordPress Themes in One Bundle', 'master-study-lite' ); ?></h2>
						<p class="bwp-bundle-banner__desc">
							<strong><?php esc_html_e( 'SUMMER SALE!', 'master-study-lite' ); ?></strong>
							<?php esc_html_e( 'Get 15% off on a Bundle of 250+ Premium WP Themes. Use', 'master-study-lite' ); ?>
							<span class="bwp-bundle-banner__coupon-inline">&quot;SUMMER15&quot;</span>
							<?php esc_html_e( 'at Checkout.', 'master-study-lite' ); ?>
						</p>
						<div class="bwp-bundle-banner__actions">
							<a class="bwp-bundle-banner__cta" target="_blank" href="<?php echo esc_url( MASTER_STUDY_LITE_BUY_BUNDLE ); ?>"><?php esc_html_e( 'Get Bundle Just at $99', 'master-study-lite' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span></a>
							<button type="button" class="bwp-bundle-banner__coupon" id="bwp-copy-coupon" data-coupon="SUMMER15" aria-label="<?php echo esc_attr__( 'Copy coupon code SUMMER15', 'master-study-lite' ); ?>">
								<span class="bwp-bundle-banner__coupon-label"><?php esc_html_e( 'Coupon Code', 'master-study-lite' ); ?></span>
								<span class="bwp-bundle-banner__coupon-code">SUMMER15</span>
								<span class="bwp-bundle-banner__coupon-copied" id="bwp-copy-coupon-msg"><?php esc_html_e( 'Copied!', 'master-study-lite' ); ?></span>
							</button>
						</div>
					</div>
					<div class="bwp-bundle-banner__price">
						<div class="bwp-bundle-banner__price-amount">
							<span class="bwp-bundle-banner__price-old">$9750</span>
							<span class="bwp-bundle-banner__price-new">$99</span>
						</div>
						<span class="bwp-bundle-banner__price-note"><?php esc_html_e( '* Lifetime Updates & All Future Themes Included', 'master-study-lite' ); ?></span>
					</div>
					<div class="bwp-bundle-banner__visual" aria-hidden="true">
						<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/bwt-bundle.png'); ?>"/>
					</div>
				</div>
			</div>
			<div class="tab">
				<button role="tab" class="tablinks home" onclick="master_study_lite_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'master-study-lite' ); ?></button>
				<button role="tab" class="tablinks" onclick="master_study_lite_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'master-study-lite' ); ?></button>
				<button role="tab" class="tablinks" onclick="master_study_lite_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'master-study-lite' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( MASTER_STUDY_LITE_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'master-study-lite' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( MASTER_STUDY_LITE_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'master-study-lite' ); ?>
				</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 Master Study Lite ', 'master-study-lite' ); ?>
							<span><?php esc_html_e( 'Version: ', 'master-study-lite' ); ?><?php echo esc_html($master_study_lite_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.', 'master-study-lite' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'master-study-lite' ); ?></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...', 'master-study-lite'); ?>" />
								</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', 'master-study-lite'); ?>" />
							<div class="install-plugins__actions">
								<a class="install-plugins__btn install-plugins__btn--pro" href="<?php echo esc_url( MASTER_STUDY_LITE_BUY_PRO ); ?>" target="_blank"><?php esc_html_e( 'Get Pro at $39', 'master-study-lite' ); ?></a>
								<a class="install-plugins__btn install-plugins__btn--bundle" href="<?php echo esc_url( MASTER_STUDY_LITE_BUY_BUNDLE ); ?>" target="_blank"><?php esc_html_e( 'Buy Bundle at $99', 'master-study-lite' ); ?></a>
							</div>
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','master-study-lite'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( MASTER_STUDY_LITE_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','master-study-lite'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','master-study-lite'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','master-study-lite'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','master-study-lite'); ?></a> <?php esc_html_e( 'your website.','master-study-lite'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','master-study-lite'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( MASTER_STUDY_LITE_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','master-study-lite'); ?></a></li>
							</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 Master Study Lite Theme', 'master-study-lite' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'The Master Study Lite Theme is a powerful, feature-rich solution designed specifically for educational institutions, online courses, and academic professionals, making it ideal for modern e-learning platforms and digital education ecosystems. Whether you’re offering master’s degree programs, online master’s programs, or specialized courses in business administration, computer science, data science, engineering, or MBA programs, this theme delivers a smooth and engaging learning experience while also supporting every coacher and instructor in building impactful courses. Built with flexibility in mind, it supports graduate programs, postgraduate study, dual degree options, distance learning, accelerated learning paths, and blended education models, allowing institutions and e-learning coacher professionals to deliver education in multiple formats. The theme integrates seamlessly with the MasterStudy LMS plugin, enabling structured course creation, lesson management, quizzes, assignments, student dashboards, instructor profiles, virtual classrooms, and progress tracking, which is essential for any e-learning coacher platform. It is well suited for universities, colleges, e-learning platforms, training institutes, online academies, certification programs, professional education providers, coaching centers, MOOC platforms, and tutoring services, including coursework-based, thesis-based, and executive education programs. Built-in payment integration simplifies course enrollment and fee collection, improving the learner journey across all e-learning environments. Visually, Master Study Lite offers clean typography, responsive design, customizable layouts, interactive video lessons, and rich media support for a professional look that enhances both learner and coacher engagement. Relevant search terms include education theme, LMS theme, online learning theme, course management theme, university website theme, academic course theme, digital learning theme, virtual classroom theme, training institute theme, learning management theme, online education platform theme, and study portal theme, making it a complete solution for building a credible and modern e-learning environment.', 'master-study-lite' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','master-study-lite'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','master-study-lite'); ?></a> <?php esc_html_e( 'your website.','master-study-lite'); ?> </l>
								<li><?php esc_html_e( 'Master Study Lite','master-study-lite'); ?> <a target="_blank" href="<?php echo esc_url( MASTER_STUDY_LITE_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','master-study-lite'); ?></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.','master-study-lite'); ?></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', 'master-study-lite'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','master-study-lite'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'The Master Study WordPress Theme is a powerful, feature-rich solution designed specifically for educational institutions, online courses, and academic professionals. Whether youre offering masters degree programs, online masters programs, or specialized courses in fields like business administration, computer science, data science, engineering, and more, this theme provides a seamless and engaging learning experience. Built with flexibility in mind, it caters to graduate programs, postgraduate study, and even distance learning masters options, ensuring that institutions can effectively deliver education in any format. The theme includes an intuitive Learning Management System (LMS) that allows institutions to create structured courses, add quizzes, manage student dashboards, and provide instructor profiles. It fully supports coursework-based masters, thesis-based masters, and executive masters programs, making it ideal for universities, training academies, and professional education platforms. With built-in payment gateways, institutions can handle course enrollments and purchases effortlessly, providing a smooth user experience. Visually, the Master Study theme is designed for clarity and professionalism, featuring clean typography, responsive layouts, and high-quality media integration. It offers customizable colors, interactive video support, and seamless navigation, ensuring an immersive learning environment. Institutions offering MBA programs, dual degree programs, or accelerated masters programs will benefit from its polished structure, which enhances credibility, engagement, and student retention.', 'master-study-lite' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','master-study-lite'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Theme options using Customizer API','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Responsive design','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Site Icon and Logo option','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Header Images option','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Favicon, Logo, title, and tagline customization','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets','master-study-lite'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Pagination option','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Demo Importer','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Main Slider','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Woocommerce Compatible','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Unlimited Slides','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Section to show categories','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Product Listing based on category','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Top Categories Section','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Best Seller Tab','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Testimonial with custom post type','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Promotional Banners','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Partner Listing','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Shortcodes for Testimonials','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Newsletter with the help of contact form 7.','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Well-sanitized as per WordPress standards.','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Responsive layout for all devices','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Typography for the complete website','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Global Color pallete','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Section specific Color pallete','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Fully integrated with Font Awesome Icon','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Instagram Section','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Partner Listing','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Background Image Option','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Custom page templates','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Allow setting site title, tagline, logo','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Contact Page Template','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Blog Full width and right and left sidebar','master-study-lite'); ?></li>
									<li><?php esc_html_e( 'Recent post widget with images, Related post','master-study-lite'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<?php }?>
