<?php

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

        if (is_admin()) {
            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();
            }
            $smartversity_version = $theme->get('Version');


?>
            <div class="smartversity-admin-notice notice notice-info is-dismissible content-install-plugin theme-info-notice" id="smartversity-dismiss-notice">
                <div class="info-content">
                    <h2><span class="theme-name"><span><?php echo __('Thank you for Installing Smartversity', 'smartversity'); ?></span></h2>
                    <p class="notice-text"><?php echo __('Please install and activate all recommended pluign to import the demo with "one click demo import" feature and Now cozy blocks provides upto 17 advanced blocks for FSE and Gutenberg editor', 'smartversity') ?></p>
                    <h3><?php echo __('Required Plugins', 'smartversity'); ?></h3>
                    <ul class="smartversity-required-plugin">
                        <li>

                            <h4><?php echo __('1. Cozy Blocks', 'smartversity'); ?>
                                <?php
                                if (smartversity_is_plugin_activated('cozy-addons/cozy-addons.php')) {
                                    echo __(': Plugin has been already activated!', 'smartversity');
                                } elseif (smartversity_is_plugin_installed('cozy-addons/cozy-addons.php')) {
                                    echo __(': Plugin does not activated, Activate the plugin to use upto 17 advanced blocks for FSE and Gutenberg editor', 'smartversity');
                                } else {
                                    echo ': <a href="' . get_admin_url() . 'plugin-install.php?tab=plugin-information&plugin=cozy-addons&TB_iframe=true&width=600&height=550">' . esc_html__('Install and Activate', 'smartversity') . '</a>';
                                }
                                ?>
                            </h4>
                        </li>
                        <li>

                            <h4><?php echo __('2. Cozy Essential Addons', 'smartversity'); ?>
                                <?php
                                if (smartversity_is_plugin_activated('cozy-essential-addons/cozy-essential-addons.php')) {
                                    echo __(': Plugin has been already activated!', 'smartversity');
                                } elseif (smartversity_is_plugin_installed('cozy-essential-addons/cozy-essential-addons.php')) {
                                    echo __(': Plugin does not activated, Activate the plugin to use one click demo import and unlock premium features.', 'smartversity');
                                } else {
                                    echo ': <a href="' . get_admin_url() . 'plugin-install.php?tab=plugin-information&plugin=cozy-essential-addons&TB_iframe=true&width=600&height=550">' . esc_html__('Install and Activate', 'smartversity') . '</a>';
                                }
                                ?>
                            </h4>
                        </li>
                        <li>
                            <h4><?php echo __('3. Advanced Import - Need only to use "one click demo import" features', 'smartversity'); ?>
                                <?php
                                if (smartversity_is_plugin_activated('advanced-import/advanced-import.php')) {
                                    echo __(': Plugin has been already activated!', 'smartversity');
                                } elseif (smartversity_is_plugin_installed('advanced-import/advanced-import.php')) {
                                    echo __(': Plugin does not activated, Activate the plugin to use one click demo import feature only, you can unstall and delete the pluign after task perform.', 'smartversity');
                                } 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', 'smartversity') . '</a>';
                                }
                                ?>
                            </h4>
                        </li>

                    </ul>
                    <a href="<?php echo admin_url(); ?>themes.php?page=about-smartversity" class="button admin-button info-button"><?php echo __('Explore Smartversity', 'smartversity'); ?></a>

                </div>
                <div class="dashboard-theme-screen">
                    <img src="<?php echo esc_url(get_template_directory_uri() . '/inc/admin/images/dashboard_image.png'); ?>" />
                </div>

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

function smartversity_dismissble_notice()
{
    update_option('smartversity_dashboard_dismissed_notice', 1);
}
add_action('wp_ajax_smartversity_dismissble_notice', 'smartversity_dismissble_notice');


function smartversity_dashboard_menu()
{
    add_theme_page(esc_html__('About Smartversity', 'smartversity'), esc_html__('About Smartversity', 'smartversity'), 'edit_theme_options', 'about-smartversity', 'smartversity_theme_info_display');
}
add_action('admin_menu', 'smartversity_dashboard_menu');
function smartversity_theme_info_display()
{ ?>
    <div class="dashboard-about-smartversity">
        <h1> <?php echo __('Welcome to the Smartversity - FSE WordPress Theme for School/College', 'smartversity') ?></h1>
        <p><?php echo __('Smartversity stands out as a cutting-edge WordPress theme designed exclusively for educational websites, be it schools, colleges, or universities. Harnessing the power of block-based Full Site Editing (FSE), users can effortlessly tailor their entire website using intuitive blocks. The theme offers a spectrum of 5 global styles, enabling users to seamlessly switch between diverse color schemes to harmonize with their brand\'s unique identity. Boasting 13 complimentary ready-to-use patterns, Smartversity streamlines the design process for key homepage sections like banners, hero sections, about us, testimonials, call-to-action elements, recent posts, and more. For those seeking elevated design options, the theme goes the extra mile by presenting 7 premium patterns, totaling 20+ choices to elevate the visual appeal of any educational institution\'s website. Explore more about Smartversity at https://cozythemes.com/smartversity-free-wordpress-theme-for-school-college/', 'smartversity') ?></p>

        <h3 class="smartversity-baisc-guideline-header"><?php echo __('Basic Theme Setup', 'smartversity') ?></h3>
        <div class="smartversity-baisc-guideline">
            <div class="featured-box">
                <ul>
                    <li><strong><?php echo __('Setup Header Layout:', 'smartversity') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Patterns -> Template Parts -> Header:', 'smartversity') ?></li>
                            <li> - <?php echo __('click on Header > Click on Edit (Icon) -> Add or Remove Requirend block/content as your requirement.:', 'smartversity') ?></li>
                            <li> - <?php echo __('Click on save to update your layout', 'smartversity') ?></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="featured-box">
                <ul>
                    <li><strong><?php echo __('Setup Footer Layout:', 'smartversity') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Patterns -> Template Parts -> Footer:', 'smartversity') ?></li>
                            <li> - <?php echo __('click on Footer > Click on Edit (Icon) > Add or Remove Requirend block/content as your requirement.:', 'smartversity') ?></li>
                            <li> - <?php echo __('Click on save to update your layout', 'smartversity') ?></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:', 'smartversity') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Templates:', 'smartversity') ?></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.:', 'smartversity') ?></li>
                            <li> - <?php echo __('Click on save to update your layout', 'smartversity') ?></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="featured-box">
                <ul>
                    <li><strong><?php echo __('Restore/Reset Default Content layout of Template(Like: Frontpage/Blog/Archive etc.)', 'smartversity') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Templates:', 'smartversity') ?></li>
                            <li> - <?php echo __('Click on Manage all Templates', 'smartversity') ?></li>
                            <li> - <?php echo __('Click on 3 Dots icon at right side of respective Template', 'smartversity') ?></li>
                            <li> - <?php echo __('Click on Clear Customization', 'smartversity') ?></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="featured-box">
                <ul>
                    <li><strong><?php echo __('Restore/Reset Default Content layout of Template Parts(Header/Footer/Sidebar)', 'smartversity') ?></strong>
                        <ul>
                            <li> - <?php echo __('Go to Appearance -> Editor -> Patterns:', 'smartversity') ?></li>
                            <li> - <?php echo __('Click on Manage All Template Parts', 'smartversity') ?></li>
                            <li> - <?php echo __('Click on 3 Dots icon at right side of respective Template parts', 'smartversity') ?></li>
                            <li> - <?php echo __('Click on Clear Customization', 'smartversity') ?></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>

        <h3><?php echo __('Required Plugins', 'smartversity'); ?></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)', 'smartversity') ?></p>
        <ul class="smartversity-required-plugin">
            <li>

                <h4><?php echo __('1. Cozy Addons', 'smartversity'); ?>
                    <?php
                    if (smartversity_is_plugin_activated('cozy-addons/cozy-addons.php')) {
                        echo __(': Plugin has been already activated!', 'smartversity');
                    } elseif (smartversity_is_plugin_installed('cozy-addons/cozy-addons.php')) {
                        echo __(': Plugin does not activated, Activate the plugin to use one click demo import and unlock premium features.', 'smartversity');
                    } else {
                        echo ': <a href="' . get_admin_url() . 'plugin-install.php?tab=plugin-information&plugin=cozy-addons&TB_iframe=true&width=600&height=550">' . esc_html__('Install and Activate', 'smartversity') . '</a>';
                    }
                    ?>
                </h4>
            </li>
            <li>

                <h4><?php echo __('2. Cozy Essential Addons', 'smartversity'); ?>
                    <?php
                    if (smartversity_is_plugin_activated('cozy-essential-addons/cozy-essential-addons.php')) {
                        echo __(': Plugin has been already activated!', 'smartversity');
                    } elseif (smartversity_is_plugin_installed('cozy-essential-addons/cozy-essential-addons.php')) {
                        echo __(': Plugin does not activated, Activate the plugin to use one click demo import and unlock premium features.', 'smartversity');
                    } else {
                        echo ': <a href="' . get_admin_url() . 'plugin-install.php?tab=plugin-information&plugin=cozy-essential-addons&TB_iframe=true&width=600&height=550">' . esc_html__('Install and Activate', 'smartversity') . '</a>';
                    }
                    ?>
                </h4>
            </li>
            <li>
                <h4><?php echo __('3. Advanced Import - Need only to use "one click demo import" features', 'smartversity'); ?>
                    <?php
                    if (smartversity_is_plugin_activated('advanced-import/advanced-import.php')) {
                        echo __(': Plugin has been already activated!', 'smartversity');
                    } elseif (smartversity_is_plugin_installed('advanced-import/advanced-import.php')) {
                        echo __(': Plugin does not activated, Activate the plugin to use one click demo import feature.', 'smartversity');
                    } 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', 'smartversity') . '</a>';
                    }
                    ?>
                </h4>
            </li>
        </ul>
        <div class="featured-list">
            <div class="half-col free-features">
                <h3><?php echo __('Smartversity Features (Free)', 'smartversity') ?></h3>
                <ul>
                    <li><strong> - <?php echo __('Offer 13 ready to use Home Sections Patterns', 'smartversity') ?></strong>
                        <ul>
                            <li> <?php echo __('Banner/Hero section pattern - 2', 'smartversity') ?></li>
                            <li> <?php echo __('About section pattern', 'smartversity') ?></li>
                            <li> <?php echo __('About section with full width image', 'smartversity') ?></li>
                            <li> <?php echo __('FAQ section - 2', 'smartversity') ?></li>
                            <li> <?php echo __('Courses Display Section', 'smartversity') ?></li>
                            <li> <?php echo __('Hero Image Display', 'smartversity') ?></li>
                            <li> <?php echo __('Testimonial section pattern', 'smartversity') ?></li>
                            <li> <?php echo __('Admission and Stats Display section', 'smartversity') ?></li>
                            <li> <?php echo __('Latest posts section pattern', 'smartversity') ?></li>
                            <li> <?php echo __('Call to Action section pattern', 'smartversity') ?></li>
                            <li> <?php echo __('Recognised & accredited partners logos Showcase', 'smartversity') ?></li>
                        </ul>
                    </li>

                    <li> <strong>- <?php echo __('14 Well Designed Base FSE Templates Ready', 'smartversity') ?></strong>
                        <ul>
                            <li> <?php echo __('404 Template', 'smartversity') ?></li>
                            <li> <?php echo __('Archive Template', 'smartversity') ?></li>
                            <li> <?php echo __('Blank Template', 'smartversity') ?></li>
                            <li> <?php echo __('Front Page Template', 'smartversity') ?></li>
                            <li> <?php echo __('Blog Home Template', 'smartversity') ?></li>
                            <li> <?php echo __('Index Page Template', 'smartversity') ?></li>
                            <li> <?php echo __('Search Template', 'smartversity') ?></li>
                            <li> <?php echo __('Sitemap Template', 'smartversity') ?></li>
                            <li> <?php echo __('Page Template', 'smartversity') ?></li>
                            <li> <?php echo __('Left Sidebar Page Template', 'smartversity') ?></li>
                            <li> <?php echo __('Right sidebar page  Template', 'smartversity') ?></li>
                            <li> <?php echo __('Single Template', 'smartversity') ?></li>
                            <li> <?php echo __('Left Sidebar Single Template', 'smartversity') ?></li>
                            <li> <?php echo __('Right Sidebar Single Template', 'smartversity') ?></li>
                        </ul>
                    <li>
                    <li><strong> - <?php echo __('Fully Customizable Header Layout', 'smartversity') ?></strong></li>
                    <li> <strong>- <?php echo __('Fully Customizable Footer Layout', 'smartversity') ?></strong></li>
                    <li><strong> - <?php echo __('10+ Beautiful Fonts Option', 'smartversity') ?></strong></li>
                    <li> <strong>- <?php echo __('5 Styles Variations', 'smartversity') ?></strong></li>
                </ul>
            </div>
            <div class="half-col pro-features">
                <h3><?php echo __('Premium Features', 'smartversity') ?></h3>
                <ul>
                    <li><?php echo __('Including all free features and comes with 8 more Premium patterns (total 20+ patterns)', 'smartversity') ?></strong></li>
                    <li><?php echo __('Teams Section', 'smartversity') ?></li>
                    <li><?php echo __('Photo Gallery Section', 'smartversity') ?></li>
                    <li><?php echo __('Upcoming Events/Notice Display Section', 'smartversity') ?></li>
                    <li><?php echo __('Video Display Section', 'smartversity') ?></li>
                    <li><?php echo __('Course List Layout', 'smartversity') ?></li>
                    <li><?php echo __('Course Grid Layout', 'smartversity') ?></li>
                    <li><?php echo __('Programs Offered Section', 'smartversity') ?></li>
                    <li><?php echo __('News and Announcement Section', 'smartversity') ?></li>

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