Ejemplo n.º 1
0
function product_extensions()
{
    ?>
	<div id="implecode_settings" class="wrap">
		<h2><?php 
    echo sprintf(__('Extensions for %s', 'ecommerce-product-catalog'), 'eCommerce Product Catalog');
    ?>
</h2>
		<h3><?php 
    _e('All the extensions come with premium support provided by dev team.<br>Feel free to contact impleCode for configuration help, troubleshooting, installation assistance and any other plugin support at any time!', 'ecommerce-product-catalog');
    ?>
</h3>
		<h2 class="nav-tab-wrapper">
			<a id="extensions" class="nav-tab"
			   href="<?php 
    echo admin_url('edit.php?post_type=al_product&page=extensions.php&tab=product-extensions');
    ?>
"><?php 
    _e('Installation', 'ecommerce-product-catalog');
    ?>
</a>
			   <?php 
    /* <a id="new-extensions" class="nav-tab"
    		 href="<?php echo admin_url( 'edit.php?post_type=al_product&page=extensions.php&tab=new-product-extensions' ) ?>"><?php _e( 'New', 'ecommerce-product-catalog' ); ?></a> */
    ?>
			<a id="help" class="nav-tab"
			   href="<?php 
    echo admin_url('edit.php?post_type=al_product&page=extensions.php&tab=help');
    ?>
"><?php 
    _e('Help', 'ecommerce-product-catalog');
    ?>
</a>
			   <?php 
    do_action('extensions-menu');
    ?>
		</h2>
		<div class="table-wrapper">
			<?php 
    $tab = isset($_GET['tab']) ? $_GET['tab'] : '';
    /* GENERAL SETTINGS */
    if ($tab == 'product-extensions' or $tab == '') {
        ?>
				<div class="extension-list">
					<script>
		                jQuery( '.nav-tab-wrapper a' ).removeClass( 'nav-tab-active' );
		                jQuery( '.nav-tab-wrapper a#extensions' ).addClass( 'nav-tab-active' );
					</script><?php 
        start_implecode_install();
        if (false === ($extensions = get_transient('implecode_extensions_data'))) {
            $extensions = wp_remote_get('http://app.implecode.com/index.php?provide_extensions');
            if (!is_wp_error($extensions) && 200 == wp_remote_retrieve_response_code($extensions)) {
                $extensions = json_decode(wp_remote_retrieve_body($extensions), true);
                if ($extensions) {
                    set_transient('implecode_extensions_data', $extensions, 60 * 60 * 24 * 7);
                }
            } else {
                $extensions = implecode_extensions();
            }
        }
        $all_ic_plugins = '';
        if (function_exists('get_implecode_active_plugins')) {
            $all_ic_plugins = get_implecode_active_plugins();
        }
        $not_active_ic_plugins = get_implecode_not_active_plugins();
        echo extensions_bundle_box();
        foreach ($extensions as $extension) {
            echo extension_box($extension['name'], $extension['url'], $extension['desc'], $extension['comp'], $extension['slug'], $all_ic_plugins, $not_active_ic_plugins);
        }
        ?>
				</div>
				<div class="helpers">
					<div class="wrapper"><h2><?php 
        _e('Did you Know?', 'ecommerce-product-catalog');
        ?>
</h2><?php 
        text_helper('', __('All extensions are designed to work with each other smoothly.', 'ecommerce-product-catalog'));
        text_helper('', __('Some extensions give even more features when combined with another one.', 'ecommerce-product-catalog'));
        text_helper('', __('Click on the extension to see full features list.', 'ecommerce-product-catalog'));
        text_helper('', __('Paste your license key and click install button to start the extension installation process.', 'ecommerce-product-catalog'));
        ?>
					</div>
				</div> <?php 
    } else {
        if ($tab == 'new-product-extensions') {
            ?>
				<div class="extension-list">
					<script>
		                jQuery( '.nav-tab-wrapper a' ).removeClass( 'nav-tab-active' );
		                jQuery( '.nav-tab-wrapper a#new-extensions' ).addClass( 'nav-tab-active' );
					</script><?php 
            start_implecode_install();
            if (false === ($extensions = get_transient('implecode_new_extensions_data'))) {
                $extensions = wp_remote_get('http://app.implecode.com/index.php?provide_extensions&new=1');
                if (!is_wp_error($extensions) || 200 != wp_remote_retrieve_response_code($extensions)) {
                    $extensions = json_decode(wp_remote_retrieve_body($extensions), true);
                    if ($extensions) {
                        set_transient('implecode_new_extensions_data', $extensions, 60 * 60 * 24 * 7);
                    }
                } else {
                    $extensions = implecode_extensions();
                }
            }
            $all_ic_plugins = '';
            if (function_exists('get_implecode_active_plugins')) {
                $all_ic_plugins = get_implecode_active_plugins();
            }
            $not_active_ic_plugins = get_implecode_not_active_plugins();
            echo extensions_bundle_box();
            foreach ($extensions as $extension) {
                echo extension_box($extension['name'], $extension['url'], $extension['desc'], $extension['comp'], $extension['slug'], $all_ic_plugins, $not_active_ic_plugins);
            }
            ?>
				</div>
				<div class="helpers">
					<div class="wrapper"><h2><?php 
            _e('Did you Know?', 'ecommerce-product-catalog');
            ?>
</h2><?php 
            text_helper('', __('All extensions are designed to work with each other smoothly.', 'ecommerce-product-catalog'));
            text_helper('', __('Some extensions give even more features when combined with another one.', 'ecommerce-product-catalog'));
            text_helper('', __('Click on the extension to see full features list.', 'ecommerce-product-catalog'));
            text_helper('', __('Paste your license key and click install button to start the extension installation process.', 'ecommerce-product-catalog'));
            ?>
					</div>
				</div>
				<?php 
        } else {
            if ($tab == 'all-product-extensions') {
                ?>
				<div class="extension-list">
					<script>
		                jQuery( '.nav-tab-wrapper a' ).removeClass( 'nav-tab-active' );
		                jQuery( '.nav-tab-wrapper a#extensions' ).addClass( 'nav-tab-active' );
					</script><?php 
                start_implecode_install();
                if (false === ($extensions = get_transient('implecode_extensions_data'))) {
                    $extensions = wp_remote_get('http://app.implecode.com/index.php?provide_extensions');
                    if (!is_wp_error($extensions) || 200 != wp_remote_retrieve_response_code($extensions)) {
                        $extensions = json_decode(wp_remote_retrieve_body($extensions), true);
                        if ($extensions) {
                            set_transient('implecode_extensions_data', $extensions, 60 * 60 * 24 * 7);
                        }
                    } else {
                        $extensions = implecode_extensions();
                    }
                }
                $all_ic_plugins = '';
                if (function_exists('get_implecode_active_plugins')) {
                    $all_ic_plugins = get_implecode_active_plugins();
                }
                $not_active_ic_plugins = get_implecode_not_active_plugins();
                echo extensions_bundle_box();
                foreach ($extensions as $extension) {
                    echo extension_box($extension['name'], $extension['url'], $extension['desc'], $extension['comp'], $extension['slug'], $all_ic_plugins, $not_active_ic_plugins);
                }
                ?>
				</div>
				<div class="helpers">
					<div class="wrapper"><h2><?php 
                _e('Did you Know?', 'ecommerce-product-catalog');
                ?>
</h2><?php 
                text_helper('', __('All extensions are designed to work with each other smoothly.', 'ecommerce-product-catalog'));
                text_helper('', __('Some extensions give even more features when combined with another one.', 'ecommerce-product-catalog'));
                text_helper('', __('Click on the extension to see full features list.', 'ecommerce-product-catalog'));
                text_helper('', __('Paste your license key and click install button to start the extension installation process.', 'ecommerce-product-catalog'));
                ?>
					</div>
				</div>
				<?php 
            } else {
                if ($tab == 'help') {
                    ?>
				<div class="help">
					<script>
		                jQuery( '.nav-tab-wrapper a' ).removeClass( 'nav-tab-active' );
		                jQuery( '.nav-tab-wrapper a#help' ).addClass( 'nav-tab-active' );
					</script> <?php 
                    echo '<h3>How to Install the extension?</h3>';
                    echo '<ol><li>Click the "Get your key" button on the extension that you want to install;</li>';
                    echo '<li>You will be redirected to the impleCode website. Read the extension description, choose license type, click the Add to Cart button and fill the form;</li>';
                    echo '<li>Your license key will be immediately sent to you by email provided in the previous step;</li>';
                    echo '<li>Copy and Paste the license key to the license key field on the extension that you want to install;</li>';
                    echo '<li>Click the install button and wait until the installation process is done. The installer will establish a secure connection with impleCode to get the installation files;</li>';
                    echo '<li>Click the activation button;</li>';
                    echo '<li>That\'s it. Enjoy!</li></ol>';
                    echo '<p>In case you prefer to install the extension manually you will get also the installation files by email. See <a href="https://implecode.com/wordpress/product-catalog/plugin-installation-guide/?cam=extensions-help&key=manual-installation#manual">manual installation guide</a> for this.</p>';
                    echo '<p>Please see the <a href="https://implecode.com/faq/?cam=extensions-help&key=faq">FAQ</a> for additional information</p>';
                    ?>
				</div>
				<div class="helpers">
					<div class="wrapper"><h2><?php 
                    _e('Did you Know?', 'ecommerce-product-catalog');
                    ?>
</h2><?php 
                    text_helper('', __('The installation process takes less than 10 seconds.', 'ecommerce-product-catalog'));
                    text_helper('', sprintf(__('You can take advantage of premium support and <a href="%s">send support tickets</a> to impleCode developers once you have your license key.', 'ecommerce-product-catalog'), 'https://implecode.com/support/?support_type=support'));
                    ?>
					</div>
				</div><?php 
                }
            }
        }
    }
    ?>
		</div>

		<div style="clear:both; height: 50px;"></div>
		<div class="plugin-logo">
			<a href="https://implecode.com/#cam=catalog-settings-link&key=logo-link"><img class="en" src="<?php 
    echo AL_PLUGIN_BASE_PATH . 'img/implecode.png';
    ?>
" width="282px" alt="impleCode"/></a>
		</div>
	</div>
	<?php 
}
function product_extensions()
{
    ?>

	<div id="implecode_settings" class="wrap">
		<h2><?php 
    _e('Extensions', 'al-ecommerce-product-catalog');
    ?>
 - impleCode eCommerce Product Catalog</h2>
		<h2 class="nav-tab-wrapper">
			<a id="extensions" class="nav-tab"
			   href="<?php 
    echo admin_url('edit.php?post_type=al_product&page=extensions.php&tab=product-extensions');
    ?>
"><?php 
    _e('Extensions', 'al-ecommerce-product-catalog');
    ?>
</a>
			<a id="help" class="nav-tab"
			   href="<?php 
    echo admin_url('edit.php?post_type=al_product&page=extensions.php&tab=help');
    ?>
"><?php 
    _e('Help', 'al-ecommerce-product-catalog');
    ?>
</a>
		</h2>
		<div class="table-wrapper">

			<?php 
    $tab = isset($_GET['tab']) ? $_GET['tab'] : '';
    /* GENERAL SETTINGS */
    if ($tab == 'product-extensions' or $tab == '') {
        ?>
				<div class="extension-list">
					<script>
		                jQuery( '.nav-tab-wrapper a' ).removeClass( 'nav-tab-active' );
		                jQuery( '.nav-tab-wrapper a#extensions' ).addClass( 'nav-tab-active' );
					</script><?php 
        start_implecode_install();
        if (false === ($extensions = get_transient('implecode_extensions_data'))) {
            $extensions = wp_remote_get('http://app.implecode.com/index.php?provide_extensions');
            if (!is_wp_error($extensions) || 200 != wp_remote_retrieve_response_code($extensions)) {
                $extensions = json_decode(wp_remote_retrieve_body($extensions), true);
                if ($extensions) {
                    set_transient('implecode_extensions_data', $extensions, 60 * 60 * 24 * 7);
                }
            } else {
                $extensions = implecode_extensions();
            }
        }
        $all_ic_plugins = '';
        if (function_exists('get_implecode_active_plugins')) {
            $all_ic_plugins = get_implecode_active_plugins();
        }
        $not_active_ic_plugins = get_implecode_not_active_plugins();
        foreach ($extensions as $extension) {
            echo extension_box($extension['name'], $extension['url'], $extension['desc'], $extension['comp'], $extension['slug'], $all_ic_plugins, $not_active_ic_plugins);
        }
        ?>
 </div>
				<div class="helpers">
					<div class="wrapper"><h2><?php 
        _e('Did you Know?', 'al-ecommerce-product-catalog');
        ?>
</h2><?php 
        text_helper('', __('All extensions are designed to work with each other smoothly.', 'al-ecommerce-product-catalog'));
        text_helper('', __('Some extensions give even more features when combined with another one.', 'al-ecommerce-product-catalog'));
        text_helper('', __('Click on the extension to see full features list.', 'al-ecommerce-product-catalog'));
        text_helper('', __('Paste your license key and click install button to start the extension installation process.', 'al-ecommerce-product-catalog'));
        ?>
					</div>
				</div>
				<?php 
    } else {
        if ($tab == 'help') {
            ?>
				<div class="help">
					<script>
		                jQuery( '.nav-tab-wrapper a' ).removeClass( 'nav-tab-active' );
		                jQuery( '.nav-tab-wrapper a#help' ).addClass( 'nav-tab-active' );
					</script> <?php 
            echo '<h3>How to Install the extension?</h3>';
            echo '<ol><li>Click the "Get your key" button on the extension that you want to install;</li>';
            echo '<li>You will be redirected to the impleCode website. Read the extension description, choose license type, click the Add to Cart button and fill the form;</li>';
            echo '<li>Your license key will be immediately sent to you by email provided in the previous step;</li>';
            echo '<li>Copy and Paste the license key to the license key field on the extension that you want to install;</li>';
            echo '<li>Click the install button and wait until the installation process is done. The installer will establish a secure connection with impleCode to get the installation files;</li>';
            echo '<li>Click the activation button;</li>';
            echo '<li>That\'s it. Enjoy!</li></ol>';
            echo '<p>In case you prefer to install the extension manually you will get also the installation files by email. See <a target="_blank" href="http://implecode.com/wordpress/product-catalog/plugin-installation-guide/?cam=extensions-help&key=manual-installation#manual">manual installation guide</a> for this.</p>';
            echo '<p>Please see the <a target="_blank" href="http://implecode.com/faq/?cam=extensions-help&key=faq">FAQ</a> for additional information</p>';
            echo '</div>';
            ?>
					<div class="helpers">
						<div class="wrapper"><h2><?php 
            _e('Did you Know?', 'al-ecommerce-product-catalog');
            ?>
</h2><?php 
            text_helper('', __('The installation process takes less than 10 seconds.', 'al-ecommerce-product-catalog'));
            text_helper('', sprintf(__('You can take advantage of premium support and <a href="%s">send support tickets</a> to impleCode developers once you have your license key.', 'al-ecommerce-product-catalog'), 'https://implecode.com/support/?support_type=support'));
            ?>
						</div>
					</div><?php 
        }
    }
    ?>

			</div>
			<div style="clear:both; height: 50px;"></div>
			<div class="plugin-logo">
				<a href="http://implecode.com/#cam=catalog-settings-link&key=logo-link"><img class="en"
																							 src="<?php 
    echo AL_PLUGIN_BASE_PATH . 'img/implecode.png';
    ?>
"
																							 width="282px" alt="impleCode"/></a>
			</div>
		</div><?php 
    /*
    		  if ($tab == 'product-extensions' OR $tab == '') { ?>
    		  <script>
    		  jQuery(document).ready(function($) {
    		  var $cache = $('.helpers .wrapper');
    		  var top = $cache.offset().top - 30;
    		  var h_height = $('.helpers .wrapper').height();
    		  var height = $('.helpers').height() - h_height + 95;
    		  function fixDiv() {
    		  if ($(window).scrollTop() > top && $(window).scrollTop() < height)
    		  $cache.css({'position': 'fixed', 'top': '32px'});
    		  else if ($(window).scrollTop() > height)
    		  $cache.css({'position': 'absolute', 'bottom': '10px', 'top': 'auto'});
    		  else
    		  $cache.css({'position': 'relative', 'top': 'auto', 'bottom': 'auto'});
    		  }
    		  $(window).scroll(fixDiv);
    		  fixDiv();
    		  });</script><?php } */
}