<?php
/**
 * Theme About Page
 *
 * @package Powerlift FSE
 * @since 1.0
 */

function powerlift_fse_theme_page_admin_style( $hook ) {
	if ( 'appearance_page_powerlift-fse-theme' === $hook ) {
		// Register theme stylesheet.
		$theme_version = wp_get_theme()->get( 'Version' );

		$version_string = is_string( $theme_version ) ? $theme_version : false;
		wp_enqueue_style(
			'powerlift-fse-theme-admin-style',
			get_theme_file_uri( 'assets/css/about-admin.css' ),
			array(),
			$version_string
		);
	}
}
add_action( 'admin_enqueue_scripts', 'powerlift_fse_theme_page_admin_style' );

/**
 * Add theme page
 */
function powerlift_fse_menu() {
	add_theme_page( esc_html__( 'Powerlift Theme Info', 'powerlift-fse' ), esc_html__( 'Powerlift Theme Info', 'powerlift-fse' ), 'edit_theme_options', 'powerlift-fse-theme', 'powerlift_fse_theme_page_display' );
}
add_action( 'admin_menu', 'powerlift_fse_menu' );

/**
 * Display About page
 */
function powerlift_fse_theme_page_display() {
	$theme = wp_get_theme();
	
	if ( is_child_theme() ) {
		$theme = wp_get_theme()->parent();
	}
	?>
	
	<div id="welcome-panel" class="welcome-panel">
		<div class="welcome-panel-content">
			<div class="welcome-panel-header">
				<h2><?php echo esc_html( $theme->Name ); ?></h2>
				<p><?php esc_html_e( 'Free Full Site Editing WordPress Theme', 'powerlift-fse' ); ?></p>
				<div class="logo-panel">
					<a href="<?php echo esc_url('https://alexathemes.net/','powerlift-fse'); ?>"><img src="<?php echo esc_url( get_template_directory_uri().'/assets/img/logo.png' ); ?>"></a>
				</div>
			</div>
			
			<div class="welcome-panel-column-container">
				<div class="container-wrap">
					<div class="welcome-panel-column two-columns">
						<!-- <div class="welcome-panel-icon-pages"></div> -->
						<div class="welcome-panel-column-content">
							<h3><?php esc_html_e( 'Getting Started with Powerlift FSE!', 'powerlift-fse' ); ?></h3>
							<p><?php esc_html_e( 'Awesome! Powerlift FSE has been installed and activated successfully. Now, you can start building your dream website with a wide range of highly-customizable block patterns, templates, and template parts available in this astounding theme.', 'powerlift-fse' ); ?></p>
						</div>
					</div>
					
					<div class="welcome-panel-column two-columns">
						<div class="welcome-panel-column-content">
							<h3><?php esc_html_e( 'More Features with Powerlift Pro Theme', 'powerlift-fse' ); ?></h3>
							<p><?php esc_html_e( 'To get more features and unique home page sections, we recommend you activate the Powerlift Pro. With the pro theme installed, get more options like google fonts, colors, sliders, page template, shortcodes and more.', 'powerlift-fse' ); ?></p>
							<a target="_blank" class="button green button-primary button-hero green" href="https://alexathemes.net/themes/powerlift-wordpress-theme/"><?php esc_html_e( 'Buy Powerlift Pro', 'powerlift-fse' ); ?></a>
						</div>
					</div>
					
				</div>
				<div class="sidebar">
					<div class="welcome-panel-column important-links">
					<!-- <div class="welcome-panel-icon-pages"></div> -->
					<div class="welcome-panel-column-content">
						<h3><?php esc_html_e( 'Important Links', 'powerlift-fse' ); ?></h3>
						<a target="_blank" href="<?php echo esc_url( 'https://alexathemes.net/themes/powerlift-wordpress-theme/' ); ?>"><?php esc_html_e( 'Theme Info', 'powerlift-fse' ); ?></a>
						<a target="_blank" href="https://live-demo.online/powerlift/"><?php esc_html_e( 'View Demo', 'powerlift-fse' ); ?></a>
						<a target="_blank" href="<?php echo esc_url( 'https://alexathemes.net/forums/' ); ?>"><?php esc_html_e( 'Support', 'powerlift-fse' ); ?></a>
					</div>
				</div>
				
				<div class="welcome-panel-column review">
					<!-- <div class="welcome-panel-icon-pages"></div> -->
					<div class="welcome-panel-column-content">
						<h3><?php esc_html_e( 'Leave us a review', 'powerlift-fse' ); ?></h3>
						<p><?php esc_html_e( 'Loved powerlift fse? Feel free to leave your feedback. Your opinion helps us reach more audiences!', 'powerlift-fse' ); ?></p>
						<a href="https://wordpress.org/support/theme/powerlift-fse/reviews/" class="button button-primary button-hero" style="text-decoration: none;" target="_blank"><?php esc_html_e( 'Review', 'powerlift-fse' ); ?></a>
					</div>
				</div>
				</div>
			</div>
		</div>
	</div>
	<?php
}
