<?php

add_action( 'admin_menu', 'multipurpose_blog_gettingstarted' );
function multipurpose_blog_gettingstarted() {    	
	add_theme_page( esc_html__('About Theme', 'multipurpose-blog'), esc_html__('Theme Demo Import', 'multipurpose-blog'), 'edit_theme_options', 'multipurpose-blog-guide-page', 'multipurpose_blog_guide');   
}

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

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

// Notice after Theme Activation
function multipurpose_blog_notice(){
    global $pagenow;
    if ( is_admin() && $pagenow === 'themes.php' && (!isset($_GET['page']) || $_GET['page'] !== 'multipurpose-blog-guide-page')
) {
$multipurpose_blog_meta = get_option( 'multipurpose_blog_admin_notice' );
	if (!$multipurpose_blog_meta) {?>
    <div id="multipurpose-blog-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 Multipurpose Blog, You Rock!', 'multipurpose-blog' ) ?> </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.', 'multipurpose-blog' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=multipurpose-blog-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'multipurpose-blog' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( MULTIPURPOSE_BLOG_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'multipurpose-blog') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( MULTIPURPOSE_BLOG_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'multipurpose-blog') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( MULTIPURPOSE_BLOG_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'multipurpose-blog') ?></a>
				</div>

			</div>
		</div>
	</div>
	<?php }
}
}
add_action('admin_notices', 'multipurpose_blog_notice');

// Admin notice code START
function multipurpose_blog_dismissed_notice() {
	update_option( 'multipurpose_blog_admin_notice', true );
}
add_action( 'wp_ajax_multipurpose_blog_dismissed_notice', 'multipurpose_blog_dismissed_notice' );

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

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

	// Theme info
	$multipurpose_blog_return = add_query_arg( array()) ;
	$multipurpose_blog_theme = wp_get_theme( 'multipurpose-blog' ); ?>

	<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="multipurpose_blog_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'multipurpose-blog' ); ?></button>
				<button role="tab" class="tablinks" onclick="multipurpose_blog_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'multipurpose-blog' ); ?></button>
				<button role="tab" class="tablinks" onclick="multipurpose_blog_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'multipurpose-blog' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( MULTIPURPOSE_BLOG_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'multipurpose-blog' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( MULTIPURPOSE_BLOG_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'multipurpose-blog' ); ?>
				</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 Multipurpose Blog ', 'multipurpose-blog' ); ?>
							<span><?php esc_html_e( 'Version: ', 'multipurpose-blog' ); ?><?php echo esc_html($multipurpose_blog_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.', 'multipurpose-blog' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'multipurpose-blog' ); ?></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...', 'multipurpose-blog'); ?>" />
								</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', 'multipurpose-blog'); ?>" />
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','multipurpose-blog'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( MULTIPURPOSE_BLOG_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','multipurpose-blog'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( MULTIPURPOSE_BLOG_PRO_SUPPORT ); ?>"><?php esc_html_e( 'Premium Theme Support','multipurpose-blog'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','multipurpose-blog'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','multipurpose-blog'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','multipurpose-blog'); ?></a> <?php esc_html_e( 'your website.','multipurpose-blog'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','multipurpose-blog'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( MULTIPURPOSE_BLOG_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','multipurpose-blog'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( MULTIPURPOSE_BLOG_PRO_DOC ); ?>"><?php esc_html_e( 'Premium Theme Documentation','multipurpose-blog'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Buy Premium','multipurpose-blog'); ?></h3>
							<ol>
								<a href="<?php echo esc_url( MULTIPURPOSE_BLOG_BUY_PRO ); ?>" target="_blank"><?php esc_html_e('Buy Pro', 'multipurpose-blog'); ?></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 Multipurpose Blog Theme', 'multipurpose-blog' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'The Multipurpose Blog WordPress Theme is an elegant and versatile blogging solution designed to cater to a variety of niches. Whether you\'re a photographer, food enthusiast, fashionista, lifestyle guru, or travel blogger, this theme is perfect for showcasing your passion. It also suits modern platforms like YouTube blogs, vlogs, videography sites, personal journals, portfolios, and recipe blogs. Additionally, it\'s a powerful option for technical blogs, Q&A forums, creative blog designs, and online newspapers.With an emphasis on minimalism and beauty, this theme offers a robust set of features, including footer widgets, SEO optimization, cross-browser compatibility, and a mobile-friendly layout. The theme ensures quick page loading speeds and is translation-ready, supporting multiple languages like Arabic, German, Spanish, French, Italian, Russian, Chinese, and Turkish. Its masonry blog layout and full-width template provide a professional and engaging presentation for your content.The theme boasts a large slider with a Call to Action (CTA) button, attracting visitors and driving engagement. It’s compatible with WooCommerce, enabling bloggers to integrate e-commerce functionalities seamlessly. With clean and secure coding, there\'s no need for manual coding, as the theme comes with various shortcodes to add advanced functionalities effortlessly.Built on the Bootstrap framework, the theme ensures quick development and a responsive design. It features an interactive demo for easy setup and customization, making it accessible even for beginners. Whether you want to share your experiences, build a portfolio, or create a magazine-style blog, the Multipurpose Blog WordPress Theme provides a sophisticated and user-friendly platform for all your blogging needs.', 'multipurpose-blog' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','multipurpose-blog'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','multipurpose-blog'); ?></a> <?php esc_html_e( 'your website.','multipurpose-blog'); ?> </l>
								<li><?php esc_html_e( 'Multipurpose Blog','multipurpose-blog'); ?> <a target="_blank" href="<?php echo esc_url( MULTIPURPOSE_BLOG_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','multipurpose-blog'); ?></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.','multipurpose-blog'); ?></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', 'multipurpose-blog'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','multipurpose-blog'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'The Multipurpose Blog WordPress Theme is designed specifically for bloggers. This Multipurpose Blog WordPress Theme to make blogs about photography, food, fashion, lifestyle, magazines, travel, sports, technology, personal blog, craft blog, creative blog, video blogs, tech review blogs, Food review blogs, gaming blog, sports blog, e-sport blog, business blog, Media blogs, entertainment blog, Podcasts, animals, pets, Wiki websites and as well as modern newspaper websites. It is one of the most popular blog WordPress theme that come with plenty of features & user-friendly customization options. It includes features such as quick page speed, responsive design, mobile-friendly, user-friendly, SEO & cross-browser compatibility translation ready and etc. Running and maintaining the blog can be a difficult task. Your knowledge, creativity and presentation method can decide how well the blog will perform. Since you are only going to be concerned with writing and posting quality content, you would want to have the best premium WP Blog theme that works swiftly. A glitchy and faulty theme is only going to force your attention elsewhere, this would never happen with our themes.', 'multipurpose-blog' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','multipurpose-blog'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Car listing Shortcode with category','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Car listing Shortcode','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Multiple image feature for each property with slider.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Brand Listing Section','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Car Brand(categories) Option','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Car Tags(categories) Option','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Testimonial listing.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Testimonial shortcode.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Social icons widget.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Latest post with the image widget.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Live customize editor for the About US section.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Font Awesome integrated.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Well sanitized as per WordPress standards.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Allow to set site title, tagline, logo.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page.','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Footer Widgets & Editor style','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Gallery & Banner functionality','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Full-width Template','multipurpose-blog'); ?></li>
									<li><?php esc_html_e( 'Custom Menu, Colors Editor','multipurpose-blog'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>