<?php

add_action( 'admin_menu', 'charity_welfare_funds_gettingstarted' );
function charity_welfare_funds_gettingstarted() {
	add_theme_page( esc_html__('About Theme', 'charity-welfare-funds'), esc_html__('Theme Demo Import', 'charity-welfare-funds'), 'edit_theme_options', 'charity-welfare-funds-guide-page', 'charity_welfare_funds_guide');
}

function charity_welfare_funds_admin_theme_style() {
   wp_enqueue_style('charity-welfare-funds-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('charity-welfare-funds-tab', esc_url( get_template_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');

    // Admin notice code START
	wp_register_script('charity-welfare-funds-notice', esc_url(get_template_directory_uri()) . '/inc/dashboard/js/notice.js', array('jquery'), time(), true);
	wp_enqueue_script('charity-welfare-funds-notice');
	// Admin notice code END
}
add_action('admin_enqueue_scripts', 'charity_welfare_funds_admin_theme_style');

// Notice after Theme Activation
function charity_welfare_funds_notice(){
    global $pagenow;
    if ( is_admin() && $pagenow === 'themes.php' && (!isset($_GET['page']) || $_GET['page'] !== 'charity-welfare-funds-guide-page')
) {
$charity_welfare_funds_meta = get_option( 'charity_welfare_funds_admin_notice' );
	if (!$charity_welfare_funds_meta) {?>
    <div id="charity-welfare-funds-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 Charity Welfare Funds, You Rock!', 'charity-welfare-funds' ) ?> </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.', 'charity-welfare-funds' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=charity-welfare-funds-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'charity-welfare-funds' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'charity-welfare-funds') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'charity-welfare-funds') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'charity-welfare-funds') ?></a>
				</div>
			</div>
		</div>
	</div>
	<?php }
}
}
add_action('admin_notices', 'charity_welfare_funds_notice');

// Admin notice code START
function charity_welfare_funds_dismissed_notice() {
	update_option( 'charity_welfare_funds_admin_notice', true );
}
add_action( 'wp_ajax_charity_welfare_funds_dismissed_notice', 'charity_welfare_funds_dismissed_notice' );

//After Switch theme function
add_action('after_switch_theme', 'charity_welfare_funds_getstart_setup_options');
function charity_welfare_funds_getstart_setup_options () {
    update_option('charity_welfare_funds_admin_notice', false );
}

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

	// Theme info
	$charity_welfare_funds_return = add_query_arg( array()) ;
	$charity_welfare_funds_theme = wp_get_theme( 'charity-welfare-funds' ); ?>

	<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="charity_welfare_funds_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'charity-welfare-funds' ); ?></button>
				<button role="tab" class="tablinks" onclick="charity_welfare_funds_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'charity-welfare-funds' ); ?></button>
				<button role="tab" class="tablinks" onclick="charity_welfare_funds_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'charity-welfare-funds' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'charity-welfare-funds' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'charity-welfare-funds' ); ?>
				</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 Charity Welfare Funds ', 'charity-welfare-funds' ); ?>
							<span><?php esc_html_e( 'Version: ', 'charity-welfare-funds' ); ?><?php echo esc_html($charity_welfare_funds_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.', 'charity-welfare-funds' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'charity-welfare-funds' ); ?></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...', 'charity-welfare-funds'); ?>" />
								</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', 'charity-welfare-funds'); ?>" />
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','charity-welfare-funds'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','charity-welfare-funds'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_PRO_SUPPORT ); ?>"><?php esc_html_e( 'Premium Theme Support','charity-welfare-funds'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','charity-welfare-funds'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','charity-welfare-funds'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','charity-welfare-funds'); ?></a> <?php esc_html_e( 'your website.','charity-welfare-funds'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','charity-welfare-funds'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','charity-welfare-funds'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_PRO_DOC ); ?>"><?php esc_html_e( 'Premium Theme Documentation','charity-welfare-funds'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Buy Premium','charity-welfare-funds'); ?></h3>
							<ol>
								<a href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_BUY_PRO ); ?>" target="_blank"><?php esc_html_e('Buy Pro', 'charity-welfare-funds'); ?></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 Charity Welfare Funds Theme', 'charity-welfare-funds' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Charity Welfare Funds is a specialized theme designed for non-profit organizations, charities, NGOs, and charity foundations focused on social good, helping them build a strong and impactful online presence while fitting perfectly within charity themes, nonprofit templates, donation systems, fundraiser layouts, social service platforms, humanitarian support sites, and community service portals. This versatile theme supports a wide range of causes such as animal welfare, disaster relief, children’s support, homeless care, medical assistance, blood donation drives, crowdfunding campaigns, sponsorship programs, education support, community aid, philanthropy projects, orphan support initiatives, environmental care, rural development, and welfare missions, including urgent responses to coronavirus, covid19, and other global health crises. It enables organizations to clearly present their purpose through well-structured sections like About Us for mission details and Causes Undertaken for highlighting advocacy efforts and humanitarian projects, ensuring meaningful donor engagement. Customizable layouts allow promotion of fundraising events, donation campaigns, charity drives, and volunteer programs through the Upcoming Events section, improving outreach and awareness and strengthening fundraising capabilities for modern charities. Integrated with the give Donation plugin, the theme ensures secure online contributions, streamlined donor management, recurring donations, payment processing, and improved donor retention, making it ideal for large-scale fundraising efforts and emergency relief campaigns such as coronavirus and covid19 support initiatives. Features such as SEO optimization, responsive design, fast-loading structure, and social media integration enhance visibility and user experience, which is essential for NGO websites, charity events, relief efforts, medical fundraisers, grant initiatives, adoption campaigns, community funding projects, and welfare initiatives. With organized sections like Mission and Vision, FAQs, and Contact Us, Charity Welfare Funds helps organizations build trust, communicate effectively with donors and volunteers, and support sustainable growth across social welfare organizations, humanitarian aid programs, rescue missions, and community upliftment projects.', 'charity-welfare-funds' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','charity-welfare-funds'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','charity-welfare-funds'); ?></a> <?php esc_html_e( 'your website.','charity-welfare-funds'); ?> </l>
								<li><?php esc_html_e( 'Charity Welfare Funds','charity-welfare-funds'); ?> <a target="_blank" href="<?php echo esc_url( CHARITY_WELFARE_FUNDS_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','charity-welfare-funds'); ?></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.','charity-welfare-funds'); ?></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', 'charity-welfare-funds'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','charity-welfare-funds'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'The Charity Welfare Funds theme is a specialised WordPress theme designed for nonprofit organisations, charities, and NGOs focused on social good and community support, looking to better their online presence. The theme is versatile for organisations working towards causes of animal welfare, disaster relief, children and homeless charity, essentials and blood drives, medical aids, donations and fundraisers. The About Us page tells what your organisation does. This theme caters to raise funds through the themes contact forms plugin, keeps volunteers engaged through its Blog section, and promotes their missions under the Causes Undertaken page. It features customizable templates that will highlight various charitable activities of fundraising events, donation drives, and community outreach programs under the Upcoming Events section. Integrated tools of payment gateway ease the donations collection processes. Additionally the Charitable plugin the theme uses, makes the donation process easier for potential donors and gives exclusive functionality to the theme. The themes SEO optimization and social media integration feature ensures broader visibility, crucial for spreading awareness about various charitable initiatives. It simplifies content management under various pages like Mission and Vision page, Contact Us page and FAQs section for easy navigation. Whether launching new charity runs or enhancing existing outreach efforts, this theme equips organisations with the tools to amplify their mission. Charity Welfare Funds theme is a comprehensive solution that enhances visibility, attracts donors, and ultimately, contributes meaningfully to social impact and humanitarian causes.', 'charity-welfare-funds' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','charity-welfare-funds'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Theme options using Customizer API','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Responsive design','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Site Icon and Logo option','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Header Images option','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Favicon, Logo, title, and tagline customization','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Pagination option','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Demo Importer','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Main Slider','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Woocommerce Compatible','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Unlimited Slides','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Section to show categories','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Product Listing based on category','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Top Categories Section','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Best Seller Tab','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Testimonial with custom post type','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Promotional Banners','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Partner Listing','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Shortcodes for Testimonials','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Newsletter with the help of contact form 7.','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Well-sanitized as per WordPress standards.','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Responsive layout for all devices','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Typography for the complete website','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Global Color pallete','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Section specific Color pallete','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Fully integrated with Font Awesome Icon','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Instagram Section','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Partner Listing','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Background Image Option','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Custom page templates','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Allow setting site title, tagline, logo','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Contact Page Template','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Blog Full width and right and left sidebar','charity-welfare-funds'); ?></li>
									<li><?php esc_html_e( 'Recent post widget with images, Related post','charity-welfare-funds'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>
