<?php

/**
 * file for holding dashboard welcome page for theme
 */
if (!function_exists('walker_news_template_is_plugin_installed')) {
    function walker_news_template_is_plugin_installed($plugin_slug)
    {
        $plugin_path = WP_PLUGIN_DIR . '/' . $plugin_slug;
        return file_exists($plugin_path);
    }
}
if (!function_exists('walker_news_template_is_plugin_activated')) {
    function walker_news_template_is_plugin_activated($plugin_slug)
    {
        return is_plugin_active($plugin_slug);
    }
}
if (!function_exists('walker_news_template_welcome_notice')) :
    function walker_news_template_welcome_notice()
    {
        global $pagenow;
        $meta            = get_option('wnt-welcome-notice-update');
        $current_screen  = get_current_screen();

        if (is_admin() && !$meta) {
            if ($current_screen->id !== 'dashboard' && $current_screen->id !== 'themes') {
                return;
            }
            if (is_network_admin()) {
                return;
            }
            if (!current_user_can('manage_options')) {
                return;
            }
            $theme = wp_get_theme();

            if (is_child_theme()) {
                $theme = wp_get_theme()->parent();
            }
            $walker_news_template_version = $theme->get('Version');


?>
            <div class="wnt-admin-notice notice notice-info is-dismissible content-install-plugin theme-info-notice">
                <div class="info-content">
                    <h5><span class="theme-name"><span><?php echo __('Welcome to Walker News Template', 'walker-news-template'); ?></span></h5>
                    <h1><?php echo __('Congratulations! Walker News Template has been installed and ready to build your website!', 'walker-news-template'); ?></h1>
                    </h3>
                    <p class="notice-text"><?php echo __('Please install and activate all recommended pluign to import the demo with "one click demo import" feature.', 'walker-news-template') ?></p>
                    <h3><?php echo __('Required Plugins', 'walker-news-template'); ?></h3>
                    <ul class="wnt-required-plugin">
                        <li>

                            <h4><?php echo __('1.  Walker Core', 'walker-news-template'); ?>
                                <?php
                                if (walker_news_template_is_plugin_activated('walker-core/walker-core.php')) {
                                    echo __(': Plugin has been already activated!', 'walker-news-template');
                                } elseif (walker_news_template_is_plugin_installed('walker-core/walker-core.php')) {
                                    echo __(': Plugin does not activated, Activate the plugin to use one click demo import and unlock premium features.', 'walker-news-template');
                                } else {
                                    echo ': <a href="' . get_admin_url() . 'plugin-install.php?tab=plugin-information&plugin=walker-core&TB_iframe=true&width=600&height=550">' . esc_html__('Install and Activate', 'walker-news-template') . '</a>';
                                }
                                ?>
                            </h4>
                        </li>
                        <li>
                            <h4><?php echo __('2. Advanced Import - Need only to use "one click demo import" features', 'walker-news-template'); ?>
                                <?php
                                if (walker_news_template_is_plugin_activated('advanced-import/advanced-import.php')) {
                                    echo __(': Plugin has been already activated!', 'walker-news-template');
                                } elseif (walker_news_template_is_plugin_installed('advanced-import/advanced-import.php')) {
                                    echo __(': Plugin does not activated, Activate the plugin to use one click demo import feature.', 'walker-news-template');
                                } else {
                                    echo ': <a href="' . get_admin_url() . 'plugin-install.php?tab=plugin-information&plugin=advanced-import&TB_iframe=true&width=600&height=550">' . esc_html__('Install and Activate', 'walker-news-template') . '</a>';
                                }
                                ?>
                            </h4>
                        </li>
                    </ul>
                    <a href="<?php echo admin_url(); ?>themes.php?page=about-Walker News Template" class="button admin-button info-button"><?php echo __('Explore Walker News Template', 'walker-news-template'); ?></a>
                    <a href="<?php echo admin_url(); ?>themes.php?wnt-welcome-notice-update=true" class="admin-button dismiss-notice btn-notice-dismiss"><?php echo __('Dismiss Notice', 'walker-news-template'); ?></a>

                </div>
                <div class="theme-screen">
                    <img src="<?php echo esc_url(get_template_directory_uri() . '/inc/admin/theme_screen.png'); ?>" />
                </div>
            </div>
    <?php
        }
    }
endif;
add_action('admin_notices', 'walker_news_template_welcome_notice');

if (!function_exists('walker_news_template_ignore_admin_notice')) :
    function walker_news_template_ignore_admin_notice()
    {
        if (isset($_GET['wnt-welcome-notice-update']) && $_GET['wnt-welcome-notice-update'] = 'true') {
            update_option('wnt-welcome-notice-update', true);
        }
    }
endif;
add_action('admin_init', 'walker_news_template_ignore_admin_notice');


function walker_news_template_dashboard_menu()
{
    add_theme_page(esc_html__('Walker News Template', 'walker-news-template'), esc_html__('Walker News Template', 'walker-news-template'), 'edit_theme_options', 'about-Walker News Template', 'walker_news_template_theme_info_display');
}
add_action('admin_menu', 'walker_news_template_dashboard_menu');
function walker_news_template_theme_info_display()
{ ?>
    <div class="dashboard-about-wnt">
        <h1> <?php echo __('Welcome to the Walker News Template - FSE WordPress Theme', 'walker-news-template') ?></h1>
        <p><?php echo __('Walker News Template is a versatile WordPress theme built for bloggers, news sites, and magazines. Whether you’re an individual or an agency, with its customizable full-site editing, 20+ free patterns, and 30+ premium patterns (altogether 50+ patterns), there is no limit to what kind of blog you want to make. Switch between 10 global styles within seconds and 12+ beautiful fonts to match your brand\'s color and style. Get started with four one-click demo import starter sites. Learn more about Walker News Template at https://walkerwp.com/walker-news-template/.', 'walker-news-template') ?></p>

        <h3 class="wnt-baisc-guideline-header"><?php echo __('Basic Theme Setup', 'walker-news-template') ?></h3>
        <div class="wnt-baisc-guideline">
            <div class="featured-box">
                <ul>
                    <li><strong><?php echo __('Setup Header Layout:', 'walker-news-template') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Patterns > Header ((Under Template Parts):):', 'walker-news-template') ?></li>
                            <li> - <?php echo __('Click on Header > Click on Edit (Icon) > Add or Remove Requirend block/content as your requirement.:', 'walker-news-template') ?></li>
                            <li> - <?php echo __('Click on save to update your layout', 'walker-news-template') ?></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="featured-box">
                <ul>
                    <li><strong><?php echo __('Setup Footer Layout:', 'walker-news-template') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Patterns -> Footer (Under Template Parts):', 'walker-news-template') ?></li>
                            <li> - <?php echo __('Click on Footer > Click on Edit (Icon) > Add or Remove Requirend block/content as your requirement.:', 'walker-news-template') ?></li>
                            <li> - <?php echo __('Click on save to update your layout', 'walker-news-template') ?></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="featured-box">
                <ul>
                    <li><strong><?php echo __('Add/Change Site Logo:', 'walker-news-template') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Patterns -> Header (Under Template Parts):', 'walker-news-template') ?></li>
                            <li> - <?php echo __('Click on Header', 'walker-news-template') ?></li>
                            <li> - <?php echo __('If already exist, click on logo and replce it', 'walker-news-template') ?></li>
                            <li>- <?php echo __('For Add  new logo, click on + Icon on top left of Editor', 'walker-news-template') ?> </li>
                            <li>- <?php echo __('Search for "Site Logo" block', 'walker-news-template') ?> </li>
                            <li>- <?php echo __('Add block and upload logo', 'walker-news-template') ?> </li>
                            <li> - <?php echo __('Click on save to update your layout', 'walker-news-template') ?></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="featured-box">
                <ul>
                    <li><strong><?php echo __('Add/Edit Favicon/site icon:', 'walker-news-template') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Patterns -> Header (Under Template Parts):', 'walker-news-template') ?></li>
                            <li> - <?php echo __('Click on Header', 'walker-news-template') ?></li>
                            <li> - <?php echo __('Click on logo', 'walker-news-template') ?></li>
                            <li>- <?php echo __('Click on Site Icon Setting at the bottom of right sidebar panel', 'walker-news-template') ?> </li>
                            <li>- <?php echo __('Now add or change site icon here', 'walker-news-template') ?> </li>
                            <li> - <?php echo __('Click on save to update your layout', 'walker-news-template') ?></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="featured-box">
                <ul>
                    <li><strong><?php echo __('Setup Templates like Homepage/404/Search/Page/Single and more templates Layout:', 'walker-news-template') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Templates:', 'walker-news-template') ?></li>
                            <li> - <?php echo __('click on Template(You need to edit/update) > Click on Edit (Icon) > Add or Remove Requirend block/content as your requirement.:', 'walker-news-template') ?></li>
                            <li> - <?php echo __('Click on save to update your layout', 'walker-news-template') ?></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>

        <h3><?php echo __('Required Plugins', 'walker-news-template'); ?></h3>
        <p class="notice-text"><?php echo __('Please install and activate all recommended pluign to import the demo with "one click demo import" feature and unlock premium features!(for pro version)', 'walker-news-template') ?></p>
        <ul class="wnt-required-plugin">
            <li>

                <h4><?php echo __('1.  Walker Core', 'walker-news-template'); ?>
                    <?php
                    if (walker_news_template_is_plugin_activated('walker-core/walker-core.php')) {
                        echo __(': Plugin has been already activated!', 'walker-news-template');
                    } elseif (walker_news_template_is_plugin_installed('walker-core/walker-core.php')) {
                        echo __(': Plugin does not activated, Activate the plugin to use one click demo import and unlock premium features.', 'walker-news-template');
                    } else {
                        echo ': <a href="' . get_admin_url() . 'plugin-install.php?tab=plugin-information&plugin=walker-core&TB_iframe=true&width=600&height=550">' . esc_html__('Install and Activate', 'walker-news-template') . '</a>';
                    }
                    ?>
                </h4>
            </li>
            <li>
                <h4><?php echo __('2. Advanced Import - Need only to use "one click demo import" features', 'walker-news-template'); ?>
                    <?php
                    if (walker_news_template_is_plugin_activated('advanced-import/advanced-import.php')) {
                        echo __(': Plugin has been already activated!', 'walker-news-template');
                    } elseif (walker_news_template_is_plugin_installed('advanced-import/advanced-import.php')) {
                        echo __(': Plugin does not activated, Activate the plugin to use one click demo import feature.', 'walker-news-template');
                    } else {
                        echo ': <a href="' . get_admin_url() . 'plugin-install.php?tab=plugin-information&plugin=advanced-import&TB_iframe=true&width=600&height=550">' . esc_html__('Install and Activate', 'walker-news-template') . '</a>';
                    }
                    ?>
                </h4>
            </li>
        </ul>
        <div class="featured-list">
            <div class="half-col free-features">
                <h3><?php echo __('Walker News Template Features (Free)', 'walker-news-template') ?></h3>
                <ul>
                    <li><strong> - <?php echo __('Offer 20+ Beautiful Patterns', 'walker-news-template') ?></strong>
                        <ul>
                            <li> <?php echo __('News Ticker', 'walker-news-template') ?></li>
                            <li> <?php echo __('Banner Section with Slider', 'walker-news-template') ?></li>
                            <li> <?php echo __('Banner Layout with Grid Section', 'walker-news-template') ?></li>
                            <li> <?php echo __('Post Grid Section', 'walker-news-template') ?></li>
                            <li> <?php echo __('Magazine Grid Layout', 'walker-news-template') ?></li>
                            <li> <?php echo __('Post Grid 4 Column Section', 'walker-news-template') ?></li>
                            <li> <?php echo __('Post Grid Content Overlay Section', 'walker-news-template') ?></li>
                            <li> <?php echo __('Featured Grid Layout', 'walker-news-template') ?></li>
                            <li> <?php echo __('Featured List Layout', 'walker-news-template') ?></li>
                            <li> <?php echo __('Full Featured image grid layout', 'walker-news-template') ?></li>
                            <li> <?php echo __('Reporter Display Section ', 'walker-news-template') ?></li>
                            <li> <?php echo __('Post List Section and More... ', 'walker-news-template') ?></li>
                        </ul>
                    </li>

                    <li> <strong>- <?php echo __('15+ FSE Templates Ready', 'walker-news-template') ?></strong>
                        <ul>
                            <li> <?php echo __('404 Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Search Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Sitemap Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Page Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Left Sidebar Page Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Blank Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Full Width Page  Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Single Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Product Single Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Left Sidebar Single Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('Archive Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('WooCommerce ProductA rchive Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('WooCommerce Cart Page Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('WooCommerce Checkout Page Template', 'walker-news-template') ?></li>
                            <li> <?php echo __('WooCommerce Single Page Template', 'walker-news-template') ?></li>
                        </ul>
                    <li>
                    <li><strong> - <?php echo __('1 Sidebar Layouts', 'walker-news-template') ?></strong></li>
                    <li><strong> - <?php echo __('3 Header Layouts', 'walker-news-template') ?></strong></li>
                    <li> <strong>- <?php echo __('2 Footer Layouts', 'walker-news-template') ?></strong></li>
                    <li><strong> - <?php echo __('12+ Beautiful Fonts Option', 'walker-news-template') ?></strong></li>
                    <li> <strong>- <?php echo __('10 Styles Variations', 'walker-news-template') ?></strong></li>
                </ul>
            </div>
            <div class="half-col pro-features">
                <h3><?php echo __('Premium Features', 'walker-news-template') ?></h3>
                <p><?php echo __('We offer more than 50+ total beatutiful patterns with aaditional 30+ premium advanced patterns to create any kinds of blog, news and magazine website.', 'walker-news-template') ?></p>
                <ul>
                    <li><?php echo __('Include all free Features and comes with more 50+ Premium patterns', 'walker-news-template') ?></strong></li>
                    <li><?php echo __('Header Layout - 5+', 'walker-news-template') ?></li>
                    <li><?php echo __('Footer Layout - 5+', 'walker-news-template') ?></li>
                    <li><?php echo __('Advanced Post Sliders', 'walker-news-template') ?></li>
                    <li><?php echo __('Banner Layout with slider- 5+', 'walker-news-template') ?></li>
                    <li><?php echo __('Magazine Layout Patterns', 'walker-news-template') ?></li>
                    <li><?php echo __('Breaking News Patterns', 'walker-news-template') ?></li>
                    <li><?php echo __('Post Carousel Patterns ', 'walker-news-template') ?></li>
                    <li><?php echo __('Advanced  Magazine  Grid Patterns ', 'walker-news-template') ?></li>
                    <li><?php echo __('Advanced Magazine List Patterns and More...', 'walker-news-template') ?></li>

                </ul>
                <a href="https://walkerwp.com/pricing-plans/" class="upgrade-btn button" target="_blank"><?php echo __('Upgrade to Pro', 'walker-news-template') ?></a>
            </div>
        </div>
    </div>
<?php
}
