<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
$tabs = array();
$tabs = apply_filters( 'w2pshop_add_settings_tab', $tabs );
wp_register_script( 'admin_install_activate_js', W2PSHOP_PLUGIN_URL . 'assets/js/w2pshop-admin-install-activate.js', array('jquery'), W2PSHOPCORE_VERSION, true );
wp_enqueue_script('admin_install_activate_js');
$activation_nonce = wp_create_nonce('w2pshop_activate_plugin_nonce');
wp_localize_script('admin_install_activate_js', 'w2pshop_data', [admin_url( 'admin-ajax.php' ), $activation_nonce]);
//  $current_tab = ( isset( $_REQUEST['tab'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['tab'] ) ) : '';
	?>
	<div class="wrap about-wrap">
	<h1 style="color: #00A0D2;font-weight: bold;">Web To Print Shop</h1>
	<div class="about-text">Thank you for installing Web To Print Shop!</div>
    <div class = 'w2pshop-display-card-container'>
        <?php
        $plugin_status = W2PShopUtil::getActivePlugins();
        $pluginData = [[['Web To Print Shop : GO ePOWER - W2P CLOUD', __('Web To Print Shop : GO ePOWER - W2P CLOUD', 'web-to-print-shop-core')], __('The Go ePOWER - W2P CLOUD system is one that was built to optimize the orders and management of corproate clients. Create B2B portals, manage production from all your websites through a single production dashboard, and locate all orders at any stage in production.', 'web-to-print-shop-core'), [[__('Install Now (Coming Soon)', 'web-to-print-shop-core'), ['', '']], [__('Activate', 'web-to-print-shop-core'), ['Activate', 'GOePOWER']], [__('Go To Settings', 'web-to-print-shop-core'), ['Change Page', admin_url('admin.php?page=edit_w2pshop_settings&tab=goepower')]]]],
	        [['Web To Print Shop : GoSendEx', __('Web To Print Shop : GoSendEx', 'web-to-print-shop-core')], __('GoSENDEX is a file transmission and routing technology connecting to Google Drive or your FTP Server that circumvents the limits of most websites and has "auto-delete" capabilities to minimize security threats.', 'web-to-print-shop-core'), [[__('Install Now (Coming Soon)', 'web-to-print-shop-core'), ['', '']], [__('Activate', 'web-to-print-shop-core'), ['Activate', 'GoSendEx']], [__('Go To Settings', 'web-to-print-shop-core'), ['Change Page', admin_url('admin.php?page=edit_w2pshop_settings&tab=gosendex')]]]],
	        [['Web To Print Shop : PDF Editor', __('W2P Shop: PDF Editor', 'web-to-print-shop-core')], __('W2P Shop’s PDF Editor is a rule-based editor which displays a simple form fill interface and the final product once filled. You can set of corporate specifications, or simply limit the available design options within a certain framework , this editor does all the work of auto-formatting to present a perfect file for production every time.', 'web-to-print-shop-core'), [[__('Install Now (Coming Soon)', 'web-to-print-shop-core'), ['', '']], [__('Activate', 'web-to-print-shop-core'), ['Activate', 'PDFEditor']], [__('Go To Settings', 'web-to-print-shop-core'), ['Change Page', admin_url('admin.php?page=edit_w2pshop_settings&tab=goepower')]]]],
	        [['Web To Print Shop : Pricematrix', __('Web To Print Shop : Pricematrix', 'web-to-print-shop-core')], __('Web to Print Shop’s centralized pricing matrix is an intuitive calculator that is part of web to print’s comprehensive online print ordering system.', 'web-to-print-shop-core'), [[__('Install Now', 'web-to-print-shop-core'), ['Change Page', 'https://wordpress.org/plugins/search/web-to-print-shop-pricematrix/']], [__('Activate', 'web-to-print-shop-core'), ['Activate', 'Pricematrix']], [__('Go To Settings', 'web-to-print-shop-core'), ['Change Page', admin_url('admin.php?page=edit_w2pshop_settings&tab=pricematrix')]]]],
	        [['Web To Print Shop : Sinalite', __('W2P Shop: Sinalite', 'web-to-print-shop-core')], __('This app facilitates easy integration with the Sinalite API allowing for automatic connection of products, pricing and ordering through Sinalite for fulfilment and drop shipping.', 'web-to-print-shop-core'), [[__('Install Now (Coming Soon)', 'web-to-print-shop-core'), ['', '']], [__('Activate', 'web-to-print-shop-core'), ['Activate', 'Sinalite']], [__('Go To Settings', 'web-to-print-shop-core'), ['Change Page', admin_url('admin.php?page=edit_w2pshop_settings&tab=sinalite')]]]],
	        [['Web To Print Shop : uDraw Designer', __('W2P Shop: uDraw', 'web-to-print-shop-core')], __('The W2P Shop uDraw Editor is an online HTML5 graphic designer that is accessible from your browser. With uDraw, users can deisgn their own products with all sorts of tools such as select premade templates, upload their own images or images, apply fonts, layout, colour, style, and design they wish.', 'web-to-print-shop-core'), [[__('Install Now (Coming Soon)', 'web-to-print-shop-core'), ['', '']], [__('Activate', 'web-to-print-shop-core'), ['Activate', 'uDrawDesigner']], [__('Go To Settings', 'web-to-print-shop-core'), ['Change Page', admin_url('admin.php?page=edit_w2pshop_settings&tab=udraw')]]]], ];
        foreach ( $pluginData as $plugin ) {
            if (!array_key_exists($plugin[0][0], $plugin_status)) {
	            W2PShopSettings::generate_w2pshop_card($plugin[0][1], $plugin[1], $plugin[2][0]);
            } else {
                if ($plugin_status[$plugin[0][0]] == 'Active')
                {
	                W2PShopSettings::generate_w2pshop_card($plugin[0][1], $plugin[1], $plugin[2][2]);
                } else {
	                W2PShopSettings::generate_w2pshop_card($plugin[0][1], $plugin[1], $plugin[2][1]);
                }
            }
        }
        ?>
    </div>
    </div>
<?php
wp_enqueue_style('w2pshop_about_css', W2PSHOP_PLUGIN_URL . 'assets/css/w2pshop-about.css', array(), W2PSHOPCORE_VERSION);
?>