<?php

add_action( 'admin_menu', 'sports_league_gettingstarted' );
function sports_league_gettingstarted() {
	add_theme_page( esc_html__('About Theme', 'sports-league'), esc_html__('Theme Demo Import', 'sports-league'), 'edit_theme_options', 'sports-league-guide-page', 'sports_league_guide');
}

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

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

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

function sports_league_activation_notice() {
    // Hide permanently if dismissed
    if ( get_option('sports_league_admin_notice') == 1 ) {
        return;
    }
    // Hide ONLY on Get Started page
    if ( isset($_GET['page']) && $_GET['page'] === 'sports-league-guide-page' ) {
        return;
    } ?>        
        <div id="sports-league-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 Sports League, You Rock!', 'sports-league' ); ?></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 store website. Please click the link below for theme setup details.', 'sports-league' ); ?></p>
                    <div style="display: grid;">
                        <a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=sports-league-guide-page' ) ); ?>">
                            <?php esc_html_e( 'Getting Started', 'sports-league' ); ?>
                        </a>
                        <a class="button notice-btn" target="_blank" href="<?php echo esc_url( SPORTS_LEAGUE_LIVE_DEMO ); ?>">
                            <?php esc_html_e('Pro Demo', 'sports-league'); ?>
                        </a>
                        <a class="button notice-btn" target="_blank" href="<?php echo esc_url( SPORTS_LEAGUE_FREE_DOC ); ?>">
                            <?php esc_html_e('Free Doc', 'sports-league'); ?>
                        </a>
                        <a class="button notice-btn" target="_blank" href="<?php echo esc_url( SPORTS_LEAGUE_BUY_PRO ); ?>">
                            <?php esc_html_e('Upgrade To Pro', 'sports-league'); ?>
                        </a>
                    </div>
                </div>
            </div>
        </div>

    <?php 
	
}
//Hook (VERY IMPORTANT)
add_action('admin_notices', 'sports_league_activation_notice');

// Admin notice code START
add_action('wp_ajax_sports_league_dismiss_notice', 'sports_league_dismiss_notice');
function sports_league_dismiss_notice() {
    update_option('sports_league_admin_notice', 1);
    wp_die();
}

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

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

	// Theme info
	$sports_league_return = add_query_arg( array()) ;
	$sports_league_theme = wp_get_theme( 'sports-league' ); ?>

	<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="sports_league_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'sports-league' ); ?></button>
				<button role="tab" class="tablinks" onclick="sports_league_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'sports-league' ); ?></button>
				<button role="tab" class="tablinks" onclick="sports_league_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'sports-league' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( SPORTS_LEAGUE_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'sports-league' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( SPORTS_LEAGUE_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'sports-league' ); ?>
				</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 Sports League ', 'sports-league' ); ?>
							<span><?php esc_html_e( 'Version: ', 'sports-league' ); ?><?php echo esc_html($sports_league_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.', 'sports-league' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'sports-league' ); ?></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...', 'sports-league'); ?>" />
								</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', 'sports-league'); ?>" />
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','sports-league'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( SPORTS_LEAGUE_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','sports-league'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( SPORTS_LEAGUE_PRO_SUPPORT ); ?>"><?php esc_html_e( 'Premium Theme Support','sports-league'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','sports-league'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','sports-league'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','sports-league'); ?></a> <?php esc_html_e( 'your website.','sports-league'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','sports-league'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( SPORTS_LEAGUE_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','sports-league'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( SPORTS_LEAGUE_PRO_DOC ); ?>"><?php esc_html_e( 'Premium Theme Documentation','sports-league'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Buy Premium','sports-league'); ?></h3>
							<ol>
								<a href="<?php echo esc_url( SPORTS_LEAGUE_BUY_PRO ); ?>" target="_blank"><?php esc_html_e('Buy Pro', 'sports-league'); ?></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 Sports League Theme', 'sports-league' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Sports League is a dynamic and versatile platform designed specifically for sports leagues, teams, and athletic organizations aiming to create a professional online presence. Tailored for soccer clubs, basketball teams, football leagues, cricket tournaments, hockey leagues, baseball teams, rugby events, volleyball competitions, swimming meets, tennis championships, golf associations, martial arts tournaments, track and field events, esports teams, youth leagues, amateur sports, professional leagues, community clubs, school sports, athlete profiles, game schedules, live scores, match results, player statistics, league standings, team rosters, sports news, event management, and sponsorship promotions, it combines functionality with style. It also perfectly supports bike competitions and high-intensity race events, making it ideal for cycling leagues and motorsport organizers looking to showcase thrilling competitions. Built with a sports management plugin, it provides advanced tools for event scheduling, match updates, ticket sales, media galleries, and fan engagement, allowing leagues to manage operations efficiently, including bike race event coordination and results tracking. Its modern design and customizable layout ensure seamless branding opportunities for any sports organization. Integrated with social media tools, SEO-friendly features, responsive design, and mobile compatibility, it ensures accessibility for fans and players alike. Whether used by coaches, athletes, sports associations, or fans, this platform offers interactive elements like game highlights, team statistics, and fan forums to enhance user engagement. Perfect for promoting sports leagues, bike race tournaments, and fostering community spirit, Sports League provides the ultimate solution for showcasing athletic events and league activities.', 'sports-league' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','sports-league'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','sports-league'); ?></a> <?php esc_html_e( 'your website.','sports-league'); ?> </l>
								<li><?php esc_html_e( 'Sports League','sports-league'); ?> <a target="_blank" href="<?php echo esc_url( SPORTS_LEAGUE_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','sports-league'); ?></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.','sports-league'); ?></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', 'sports-league'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','sports-league'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'The premium Sports League WordPress Theme is designed for sports enthusiasts and organizations who want to showcase their teams, matches, and events in a dynamic and professional manner. With its sleek and modern design, this theme offers a range of features tailored specifically for sports leagues. Easily create team profiles, display match schedules, and highlight player statistics with the themes user-friendly interface. Engage your audience by sharing live scores and match updates using the built-in live score feature. The theme also includes customizable widgets, allowing you to add social media integration, countdown timers, and more. Sports League WordPress Theme is fully responsive and mobile-friendly, ensuring your website looks great on any device. It is also compatible with popular plugins, allowing you to extend its functionality even further. With its powerful customization options and intuitive admin panel, this theme is the perfect choice for sports leagues, clubs, and fans alike.', 'sports-league' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','sports-league'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Theme options using Customizer API','sports-league'); ?></li>
									<li><?php esc_html_e( 'Responsive design','sports-league'); ?></li>
									<li><?php esc_html_e( 'Site Icon and Logo option','sports-league'); ?></li>
									<li><?php esc_html_e( 'Header Images option','sports-league'); ?></li>
									<li><?php esc_html_e( 'Favicon, Logo, title, and tagline customization','sports-league'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets','sports-league'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options','sports-league'); ?></li>
									<li><?php esc_html_e( 'Pagination option','sports-league'); ?></li>
									<li><?php esc_html_e( 'Demo Importer','sports-league'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections','sports-league'); ?></li>
									<li><?php esc_html_e( 'Main Slider','sports-league'); ?></li>
									<li><?php esc_html_e( 'Woocommerce Compatible','sports-league'); ?></li>
									<li><?php esc_html_e( 'Unlimited Slides','sports-league'); ?></li>
									<li><?php esc_html_e( 'Section to show categories','sports-league'); ?></li>
									<li><?php esc_html_e( 'Product Listing based on category','sports-league'); ?></li>
									<li><?php esc_html_e( 'Top Categories Section','sports-league'); ?></li>
									<li><?php esc_html_e( 'Best Seller Tab','sports-league'); ?></li>
									<li><?php esc_html_e( 'Testimonial with custom post type','sports-league'); ?></li>
									<li><?php esc_html_e( 'Promotional Banners','sports-league'); ?></li>
									<li><?php esc_html_e( 'Partner Listing','sports-league'); ?></li>
									<li><?php esc_html_e( 'Shortcodes for Testimonials','sports-league'); ?></li>
									<li><?php esc_html_e( 'Newsletter with the help of contact form 7.','sports-league'); ?></li>
									<li><?php esc_html_e( 'Well-sanitized as per WordPress standards.','sports-league'); ?></li>
									<li><?php esc_html_e( 'Responsive layout for all devices','sports-league'); ?></li>
									<li><?php esc_html_e( 'Typography for the complete website','sports-league'); ?></li>
									<li><?php esc_html_e( 'Global Color pallete','sports-league'); ?></li>
									<li><?php esc_html_e( 'Section specific Color pallete','sports-league'); ?></li>
									<li><?php esc_html_e( 'Fully integrated with Font Awesome Icon','sports-league'); ?></li>
									<li><?php esc_html_e( 'Instagram Section','sports-league'); ?></li>
									<li><?php esc_html_e( 'Partner Listing','sports-league'); ?></li>
									<li><?php esc_html_e( 'Background Image Option','sports-league'); ?></li>
									<li><?php esc_html_e( 'Custom page templates','sports-league'); ?></li>
									<li><?php esc_html_e( 'Allow setting site title, tagline, logo','sports-league'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar','sports-league'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads','sports-league'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page','sports-league'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','sports-league'); ?></li>
									<li><?php esc_html_e( 'Contact Page Template','sports-league'); ?></li>
									<li><?php esc_html_e( 'Blog Full width and right and left sidebar','sports-league'); ?></li>
									<li><?php esc_html_e( 'Recent post widget with images, Related post','sports-league'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>
