コード例 #1
0
ファイル: templates.php プロジェクト: satokora/IT354Project
function theme_integration_shortcode($atts)
{
    $current_mode = get_real_integration_mode();
    if (current_user_can("delete_private_products") && !is_advanced_mode_forced()) {
        $args = shortcode_atts(array('class' => 'relative-box'), $atts);
        $class = esc_attr($args['class']);
        $box_content = '<h4>' . __('Advanced Mode Test', 'al-ecommerce-product-catalog') . '</h4>';
        $box_content .= '<script>jQuery(window).scroll( function() { if (isScrolledIntoView(".relative-box")) {jQuery(".fixed-box").hide("slow");}
else {jQuery(".fixed-box").show("slow");}});
function isScrolledIntoView(elem)
{
    var docViewTop = jQuery(window).scrollTop();
    var docViewBottom = docViewTop + jQuery(window).height();
    var elemTop = jQuery(elem).offset().top;
    var elemBottom = elemTop + jQuery(elem).height();
    return ((docViewTop < elemTop) && (docViewBottom > elemBottom));
//    return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
}</script>';
        if (!isset($_GET['test_advanced'])) {
            $box_content .= '<p>' . __('eCommerce Product Catalog is currently running in Simple Mode.', 'al-ecommerce-product-catalog') . '</p>';
            $box_content .= '<p>' . __('In Simple Mode the product listing, product search and category pages are disabled (please read this Sample Product Page to fully understand the difference).', 'al-ecommerce-product-catalog') . '</p>';
            $box_content .= '<p>' . __('Please use the button below to check out how the product page looks in Automatic Advanced Mode.', 'al-ecommerce-product-catalog') . '</p>';
            $box_content .= '<p class="wp-core-ui"><a href="' . add_query_arg('test_advanced', '1') . '" class="button-primary">' . __('Start Advanced Mode Test', 'al-ecommerce-product-catalog') . '</a><a href="' . add_query_arg('test_advanced', 'simple') . '" class="button-secondary">' . __('Use Simple Mode', 'al-ecommerce-product-catalog') . '</a></p>';
            if ($current_mode == 'simple') {
                return '<div class="' . $class . '">' . implecode_info($box_content, 0) . '</div>';
            }
        } else {
            if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 1) {
                $box_content .= '<p>' . __('Advanced Mode is temporary enabled for this page now.', 'al-ecommerce-product-catalog') . '</p>';
                $box_content .= '<p>' . __('Please use the buttons below to let the script know if the Automatic Advanced Integration is done right.', 'al-ecommerce-product-catalog') . '</p>';
                $box_content .= '<p>' . __('Is everything looking fine, without design break and correct sidebar position?', 'al-ecommerce-product-catalog') . '</p>';
                $box_content .= '<p class="wp-core-ui"><a href="' . add_query_arg('test_advanced', 'ok') . '" class="button-primary">' . __('It\'s Fine', 'al-ecommerce-product-catalog') . '</a><a href="' . add_query_arg('test_advanced', 'bad') . '" class="button-secondary">' . __('It\'s Broken', 'al-ecommerce-product-catalog') . '</a></p>';
                return '<div class="' . $class . '">' . implecode_info($box_content, 0) . '</div>';
            } else {
                if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'bad') {
                    $box_content .= '<p>' . __('It seems that Manual Theme Integration is needed in order to use Advanced Mode with your current theme.', 'al-ecommerce-product-catalog') . '</p>';
                    $box_content .= '<h4>' . __('You Have 3 choices', 'al-ecommerce-product-catalog') . ':</h4>';
                    $box_content .= '<ol>';
                    $box_content .= '<li>' . __('Get the Manual Theme Integration done.', 'al-ecommerce-product-catalog') . '</li>';
                    $box_content .= '<li>' . __('Keep using Simple Mode which is still functional.', 'al-ecommerce-product-catalog') . '</li>';
                    $box_content .= '<li>' . __('Switch the theme.', 'al-ecommerce-product-catalog') . '</li>';
                    $box_content .= '</ol>';
                    $box_content .= '<p>' . __('Please make your choice below or switch the theme.', 'al-ecommerce-product-catalog') . '</p>';
                    $box_content .= '<p class="wp-core-ui"><a target="_blank" href="http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=integration-advanced-fail" class="button-primary">' . __('Free Theme Integration Guide', 'al-ecommerce-product-catalog') . '</a><a href="' . add_query_arg('test_advanced', 'simple') . '" class="button-secondary">' . __('Use Simple Mode', 'al-ecommerce-product-catalog') . '</a></p>';
                    enable_simple_mode();
                    return '<div class="' . $class . '">' . implecode_warning($box_content, 0) . '</div>';
                } else {
                    if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'ok') {
                        $box_content .= '<p>' . __('Congratulations! eCommerce Product Catalog is working on Advanced Mode now. You can go to admin and add the products to the catalog.', 'al-ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p>' . __('If you are a developer or would like to have full control on the product pages templates we still recommend to proceed with manual integration.', 'al-ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p>' . __('You can switch between modes at any time in Product Settings.', 'al-ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p class="wp-core-ui"><a href="' . admin_url() . '" class="button-primary">' . __('Go to Admin', 'al-ecommerce-product-catalog') . '</a><a target="_blank" href="http://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=advanced-mode&key=integration-advanced-success" class="button-secondary">' . __('Free Theme Integration Guide', 'al-ecommerce-product-catalog') . '</a></p>';
                        enable_advanced_mode();
                        return '<div class="' . $class . '">' . implecode_success($box_content, 0) . '</div>';
                    } else {
                        if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'simple') {
                            $box_content .= '<p>' . __('You are using simple mode now.', 'al-ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p>' . __('You can switch between modes at any time in Product Settings.', 'al-ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p>' . __('Use the buttons below to try the advanced integration again or go to admin and start adding your products.', 'al-ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p class="wp-core-ui"><a href="' . admin_url() . '" class="button-primary">' . __('Go to Admin', 'al-ecommerce-product-catalog') . '</a><a href="' . add_query_arg('test_advanced', '1') . '" class="button-secondary">' . __('Restart Advanced Mode Test', 'al-ecommerce-product-catalog') . '</a></p>';
                            enable_simple_mode();
                            return '<div class="' . $class . '">' . implecode_success($box_content, 0) . '</div>';
                        }
                    }
                }
            }
        }
    }
}
コード例 #2
0
/**
 * Shows theme intagration wizard
 *
 * @param type $atts
 */
function theme_integration_wizard($atts)
{
    $current_mode = get_real_integration_mode();
    if (is_ic_integration_wizard_page()) {
        $args = shortcode_atts(array('class' => 'fixed-box'), $atts);
        $class = esc_attr($args['class']);
        $box_content = '<h4>' . __('Advanced Mode Test', 'ecommerce-product-catalog') . '</h4>';
        /* $box_content .= '<script>jQuery(window).scroll( function() { if (isScrolledIntoView(".relative-box")) {jQuery(".fixed-box").hide("slow");}
        	  else {jQuery(".fixed-box").show("slow");}});
        	  function isScrolledIntoView(elem)
        	  {
        	  var docViewTop = jQuery(window).scrollTop();
        	  var docViewBottom = docViewTop + jQuery(window).height();
        	  var elemTop = jQuery(elem).offset().top;
        	  var elemBottom = elemTop + jQuery(elem).height();
        	  return ((docViewTop < elemTop) && (docViewBottom > elemBottom));
        	  //    return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
        	  }</script>'; */
        if (!isset($_GET['test_advanced'])) {
            $box_content .= '<p>' . __('eCommerce Product Catalog is currently running in Simple Mode.', 'ecommerce-product-catalog') . '</p>';
            $box_content .= '<p>' . __('In Simple Mode the product listing, product search and category pages are disabled (please read this Sample Product Page to fully understand the difference).', 'ecommerce-product-catalog') . '</p>';
            $box_content .= '<p>' . __('Please use the button below to check out how the product page looks in Automatic Advanced Mode.', 'ecommerce-product-catalog') . '</p>';
            $box_content .= '<p class="wp-core-ui"><a href="' . esc_url(add_query_arg('test_advanced', '1')) . '" class="button-primary">' . __('Start Advanced Mode Test', 'ecommerce-product-catalog') . '</a><a href="' . esc_url(add_query_arg('test_advanced', 'simple')) . '" class="button-secondary">' . __('Use Simple Mode', 'ecommerce-product-catalog') . '</a></p>';
            if ($current_mode == 'simple') {
                echo '<div id="integration_wizard" class="' . $class . '">' . implecode_info($box_content, 0) . '</div>';
            }
        } else {
            if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 1) {
                $box_content .= '<style>#integration_wizard.fixed-box {opacity: 0.8;}#integration_wizard.fixed-box:hover {opacity: 1;}</style>';
                $box_content .= '<p>' . __('Advanced Mode is temporary enabled for this page now.', 'ecommerce-product-catalog') . '</p>';
                //$box_content .= '<p>' . __( 'Please use the buttons below to let the script know if the Automatic Advanced Integration is done right.', 'ecommerce-product-catalog' ) . '</p>';
                $box_content .= '<p style="margin-bottom: 0">' . __('Make some adjustments if necessary (you can change it at any time later)', 'ecommerce-product-catalog') . ':</p>';
                $box_content .= '<table class="styling-adjustments">';
                $integration_settings = get_integration_settings();
                $box_content .= implecode_settings_number(__('Width', 'ecommerce-product-catalog'), 'container_width', $integration_settings['container_width'], '%', 0, null, null, 0);
                $box_content .= implecode_settings_text_color(__('Background', 'ecommerce-product-catalog'), 'container_bg', $integration_settings['container_bg'], null, 0, null, '{change: function(event, ui){ var hexcolor = jQuery( this ).wpColorPicker( "color" ); jQuery("#container").css("background", hexcolor); jQuery("#container").css("overflow", "hidden"); jQuery("#container").css("width", jQuery("input[name=\\"container_width\\"]").val()+"%");}}');
                $box_content .= implecode_settings_number(__('Padding', 'ecommerce-product-catalog'), 'container_padding', $integration_settings['container_padding'], 'px', 0, null, null, 0);
                if (!defined('AL_SIDEBAR_PLUGIN_BASE_PATH')) {
                    $box_content .= implecode_settings_radio(__('Default Sidebar', 'ecommerce-product-catalog'), 'default_sidebar', $integration_settings['default_sidebar'], array('none' => __('Disabled', 'ecommerce-product-catalog'), 'left' => __('Left', 'ecommerce-product-catalog'), 'right' => __('Right', 'ecommerce-product-catalog')), 0);
                    if ($integration_settings['default_sidebar'] == 'none') {
                        $box_content .= '<style>#catalog_sidebar {display: none;}</style>';
                    }
                }
                $box_content .= implecode_settings_checkbox(__('Disable breadcrumbs', 'ecommerce-product-catalog'), 'disable_breadcrumbs', $integration_settings['disable_breadcrumbs'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Name', 'ecommerce-product-catalog'), 'disable_name', $integration_settings['disable_name'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Image', 'ecommerce-product-catalog'), 'disable_image', $integration_settings['disable_image'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Price', 'ecommerce-product-catalog'), 'disable_price', $integration_settings['disable_price'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Shipping', 'ecommerce-product-catalog'), 'disable_shipping', $integration_settings['disable_shipping'], 0);
                $box_content .= implecode_settings_checkbox(__('Disable Attributes', 'ecommerce-product-catalog'), 'disable_attributes', $integration_settings['disable_attributes'], 0);
                $box_content .= '</table>';
                $box_content .= '<style>#integration_wizard .al-box table tbody, #integration_wizard .al-box table tr, #integration_wizard .al-box table td {border: 0; background: transparent;} #integration_wizard .al-box table.styling-adjustments td {vertical-align: middle;font-size: 14px; color: rgb(136, 136, 136); text-align: left;} #integration_wizard .wp-picker-container {padding-top: 5px;}html #integration_wizard.fixed-box .al-box table input.wp-picker-clear {background: #ededed; transition: none; padding: 1px 6px; border: 1px solid #000; color: #000; margin: 0; margin-left: 6px;}#integration_wizard .wp-picker-holder{position: absolute;}</style>';
                $box_content .= '<script>jQuery("input[name=\\"container_width\\"]").change(function() { jQuery("#container").css("width", jQuery(this).val()+"%");jQuery("#container").css("margin", "0 auto");});';
                $box_content .= 'jQuery("input[name=\\"container_padding\\"]").change(function() { jQuery("#container #content").css("padding", jQuery(this).val()+"px");jQuery("#container").css("box-sizing", "border-box");jQuery("#container #catalog_sidebar").css("padding", jQuery(this).val()+"px");});';
                $box_content .= 'jQuery("input[name=\\"disable_breadcrumbs\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("p#breadcrumbs").hide();} else {jQuery("p#breadcrumbs").show();}});';
                $box_content .= 'jQuery("input[name=\\"disable_name\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("h1.product-name").hide();} else {jQuery("h1.product-name").show();}});';
                $box_content .= 'jQuery("input[name=\\"disable_image\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("div.product-image").hide();jQuery("#product_details").addClass("no-image");} else {jQuery("div.product-image").show();jQuery("#product_details").removeClass("no-image");}});';
                $box_content .= 'jQuery("input[name=\\"disable_price\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("table.price-table").hide();} else {jQuery("table.price-table").show();}});';
                $box_content .= 'jQuery("input[name=\\"disable_shipping\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("table.shipping-table").hide();} else {jQuery("table.shipping-table").show();}});';
                $box_content .= 'jQuery("input[name=\\"disable_attributes\\"]").change(function() { if (jQuery(this).is(":checked")) { jQuery("#product_features").hide();} else {jQuery("#product_features").show();}});';
                $box_content .= 'jQuery("input[name=\\"default_sidebar\\"]").change(function() { if (jQuery(this).is(":checked")) { sidebar = jQuery(this).val();if (sidebar == "left") {jQuery("#catalog_sidebar").show();jQuery("#catalog_sidebar").css("float","left");jQuery(".product-catalog #content").css("width","70%");jQuery(".product-catalog #content").css("float","right");} else if (sidebar == "right") {jQuery("#catalog_sidebar").show();jQuery("#catalog_sidebar").css("float","right");jQuery(".product-catalog #content").css("width","70%");jQuery(".product-catalog #content").css("float","left");} else {jQuery("#catalog_sidebar").hide();jQuery(".product-catalog #content").css("width","100%");jQuery(".product-catalog #content").css("float","none");}}});';
                $box_content .= '</script>';
                //$box_content .= '<script>jQuery("input[name=\"container_bg\"]").change(function() { jQuery("#container").css("background", jQuery(this).val());});</script>';
                $box_content .= '<p>' . __('Is everything looking fine now?', 'ecommerce-product-catalog') . '</p>';
                $box_content .= '<script>jQuery(document).ready(function() {
    jQuery("a.integration-ok").click(function(e) {
	clicked = jQuery(this).attr("href");
	e.preventDefault();
	var breadcrumbs = 0;
	if (jQuery("input[name=\\"disable_breadcrumbs\\"]").is(":checked")) {
		breadcrumbs = 1;
	}
	var name = 0;
	if (jQuery("input[name=\\"disable_name\\"]").is(":checked")) {
		name = 1;
	}
	var image = 0;
	if (jQuery("input[name=\\"disable_image\\"]").is(":checked")) {
		image = 1;
	}
	var price = 0;
	if (jQuery("input[name=\\"disable_price\\"]").is(":checked")) {
		price = 1;
	}
	var shipping = 0;
	if (jQuery("input[name=\\"disable_shipping\\"]").is(":checked")) {
		shipping = 1;
	}
	var attributes = 0;
	if (jQuery("input[name=\\"disable_attributes\\"]").is(":checked")) {
		attributes = 1;
	}
	default_sidebar = jQuery("input[name=\\"default_sidebar\\"]:checked").val();
		var data = {
			"action": "save_wizard",
			"container_width": jQuery("input[name=\\"container_width\\"]").val(),
			"container_padding": jQuery("input[name=\\"container_padding\\"]").val(),
			"container_bg": jQuery("input[name=\\"container_bg\\"]").val(),
			"disable_breadcrumbs": breadcrumbs,
			"disable_name": name,
			"disable_image": image,
			"disable_price": price,
			"disable_shipping": shipping,
			"disable_attributes": attributes,
			"default_sidebar": default_sidebar
		};

		jQuery.post("' . admin_url('admin-ajax.php') . '", data, function(response) {
			window.location.href = clicked;
		});
	}); });
</script>';
                $box_content .= '<p class="wp-core-ui"><a href="' . esc_url(add_query_arg('test_advanced', 'ok')) . '" class="button-primary integration-ok">' . __('It\'s Fine', 'ecommerce-product-catalog') . '</a><a href="' . esc_url(add_query_arg('test_advanced', 'bad')) . '" class="button-secondary">' . __('It\'s Broken', 'ecommerce-product-catalog') . '</a></p>';
                echo '<div id="integration_wizard" class="' . $class . '">' . implecode_info($box_content, 0) . '</div>';
            } else {
                if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'bad') {
                    $box_content .= '<p>' . __('It seems that Manual Theme Integration is needed in order to use Advanced Mode with your current theme.', 'ecommerce-product-catalog') . '</p>';
                    $box_content .= '<h4>' . __('You Have 3 choices', 'ecommerce-product-catalog') . ':</h4>';
                    $box_content .= '<ol>';
                    $box_content .= '<li>' . __('Get the Manual Theme Integration done.', 'ecommerce-product-catalog') . '</li>';
                    $box_content .= '<li>' . __('Keep using Simple Mode which is still functional.', 'ecommerce-product-catalog') . '</li>';
                    $box_content .= '<li>' . __('Switch the theme.', 'ecommerce-product-catalog') . '</li>';
                    $box_content .= '</ol>';
                    $box_content .= '<p>' . __('Please make your choice below or switch the theme.', 'ecommerce-product-catalog') . '</p>';
                    $box_content .= '<p class="wp-core-ui"><a target="_blank" href="https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=simple-mode&key=integration-advanced-fail" class="button-primary">' . __('Free Theme Integration Guide', 'ecommerce-product-catalog') . '</a><a href="' . esc_url(add_query_arg('test_advanced', 'simple')) . '" class="button-secondary">' . __('Use Simple Mode', 'ecommerce-product-catalog') . '</a></p>';
                    enable_simple_mode();
                    echo '<div id="integration_wizard" class="' . $class . '">' . implecode_warning($box_content, 0) . '</div>';
                } else {
                    if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'ok') {
                        $box_content .= '<p>' . __('Congratulations! eCommerce Product Catalog is working on Advanced Mode now. You can go to admin and add the products to the catalog.', 'ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p>' . __('If you are a developer or would like to have full control on the product pages templates we still recommend to proceed with manual integration.', 'ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p>' . __('You can switch between modes at any time in Product Settings.', 'ecommerce-product-catalog') . '</p>';
                        $box_content .= '<p class="wp-core-ui"><a href="' . admin_url('edit.php?post_type=al_product') . '" class="button-primary">' . __('Go to Admin', 'ecommerce-product-catalog') . '</a><a target="_blank" href="https://implecode.com/wordpress/product-catalog/theme-integration-guide/#cam=advanced-mode&key=integration-advanced-success" class="button-secondary">' . __('Free Theme Integration Guide', 'ecommerce-product-catalog') . '</a></p>';
                        enable_advanced_mode();
                        echo '<div id="integration_wizard" class="' . $class . '">' . implecode_success($box_content, 0) . '</div>';
                    } else {
                        if (isset($_GET['test_advanced']) && $_GET['test_advanced'] == 'simple') {
                            $box_content .= '<p>' . __('You are using simple mode now.', 'ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p>' . __('You can switch between modes at any time in Product Settings.', 'ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p>' . __('Use the buttons below to try the advanced integration again or go to admin and start adding your products.', 'ecommerce-product-catalog') . '</p>';
                            $box_content .= '<p class="wp-core-ui"><a href="' . admin_url('edit.php?post_type=al_product') . '" class="button-primary">' . __('Go to Admin', 'ecommerce-product-catalog') . '</a><a href="' . esc_url(add_query_arg('test_advanced', '1')) . '" class="button-secondary">' . __('Restart Advanced Mode Test', 'ecommerce-product-catalog') . '</a></p>';
                            enable_simple_mode();
                            echo '<div id="integration_wizard" class="' . $class . '">' . implecode_success($box_content, 0) . '</div>';
                        }
                    }
                }
            }
        }
    }
}
コード例 #3
0
ファイル: system.php プロジェクト: RA2WP/RA2WP
function ic_system_status()
{
    if (current_user_can('manage_product_settings')) {
        if (isset($_GET['reset_product_settings'])) {
            if (isset($_GET['reset_product_settings_confirm'])) {
                foreach (all_ic_options('options') as $option) {
                    delete_option($option);
                }
                implecode_success(__('Product Settings successfully reset to default!', 'ecommerce-product-catalog'));
            } else {
                echo '<h3>' . __('All products settings will be reset to defaults. Would you like to proceed?', 'ecommerce-product-catalog') . '</h3>';
                echo '<a class="button" href="' . esc_url(add_query_arg('reset_product_settings_confirm', 1)) . '">' . __('Yes', 'ecommerce-product-catalog') . '</a> <a class="button" href="' . esc_url(remove_query_arg('reset_product_settings')) . '">' . __('No', 'ecommerce-product-catalog') . '</a>';
            }
        } else {
            if (isset($_GET['delete_all_products'])) {
                if (isset($_GET['delete_all_products_confirm'])) {
                    global $wpdb;
                    $wpdb->query("DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'al_product' );");
                    $wpdb->query("DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;");
                    implecode_success(__('Product Settings successfully reset to default!', 'ecommerce-product-catalog'));
                } else {
                    echo '<h3>' . __('All products will be permanently deleted. Would you like to proceed?', 'ecommerce-product-catalog') . '</h3>';
                    echo '<a class="button" href="' . esc_url(add_query_arg('delete_all_products_confirm', 1)) . '">' . __('Yes', 'ecommerce-product-catalog') . '</a> <a class="button" href="' . esc_url(remove_query_arg('delete_all_products')) . '">' . __('No', 'ecommerce-product-catalog') . '</a>';
                }
            } else {
                if (isset($_GET['delete_all_product_categories'])) {
                    if (isset($_GET['delete_all_product_categories_confirm'])) {
                        global $wpdb;
                        $taxonomy = 'al_product-cat';
                        $terms = $wpdb->get_results($wpdb->prepare("SELECT t.*, tt.* FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy));
                        // Delete Terms
                        if ($terms) {
                            foreach ($terms as $term) {
                                $wpdb->delete($wpdb->term_taxonomy, array('term_taxonomy_id' => $term->term_taxonomy_id));
                                $wpdb->delete($wpdb->term_relationships, array('term_taxonomy_id' => $term->term_taxonomy_id));
                                $wpdb->delete($wpdb->terms, array('term_id' => $term->term_id));
                                delete_option('al_product_cat_image_' . $term->term_id);
                            }
                        }
                        // Delete Taxonomy
                        $wpdb->delete($wpdb->term_taxonomy, array('taxonomy' => $taxonomy), array('%s'));
                        implecode_success(__('All Product Categories successfully deleted!', 'ecommerce-product-catalog'));
                    } else {
                        echo '<h3>' . __('All product categories will be permanently deleted. Would you like to proceed?', 'ecommerce-product-catalog') . '</h3>';
                        echo '<a class="button" href="' . esc_url(add_query_arg('delete_all_product_categories_confirm', 1)) . '">' . __('Yes', 'ecommerce-product-catalog') . '</a> <a class="button" href="' . esc_url(remove_query_arg('delete_all_product_categories')) . '">' . __('No', 'ecommerce-product-catalog') . '</a>';
                    }
                } else {
                    if (isset($_GET['delete_old_filters_bar'])) {
                        if (isset($_GET['delete_old_filters_bar_confirm'])) {
                            delete_option('old_sort_bar');
                            implecode_success(__('Filters bar is now empty by default!', 'ecommerce-product-catalog'));
                        } else {
                            echo '<h3>' . __('Default filters bar will become empty.', 'ecommerce-product-catalog') . '</h3>';
                            echo '<a class="button" href="' . esc_url(add_query_arg('delete_old_filters_bar_confirm', 1)) . '">' . __('OK', 'ecommerce-product-catalog') . '</a> <a class="button" href="' . esc_url(remove_query_arg('delete_old_filters_bar')) . '">' . __('Cancel', 'ecommerce-product-catalog') . '</a>';
                        }
                    } else {
                        ?>
			<style>table.widefat {width: 95%}table tbody tr td:first-child {width: 350px } table tbody tr:nth-child(even) {background: #fafafa;}</style>
			<p></p>
			<table class="widefat" cellspacing="0" id="ic_tools">
				<thead>
					<tr>
						<th colspan="2"><?php 
                        _e('impleCode Tools', 'ecommerce-product-catalog');
                        ?>
</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td><?php 
                        _e('Reset product settings', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><a class="button" href="<?php 
                        echo esc_url(add_query_arg('reset_product_settings', 1));
                        ?>
"><?php 
                        _e('Reset Product Settings', 'ecommerce-product-catalog');
                        ?>
</a></td>
					</tr>
					<tr>
						<td><?php 
                        _e('Delete all products', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><a class="button" href="<?php 
                        echo esc_url(add_query_arg('delete_all_products', 1));
                        ?>
"><?php 
                        _e('Delete all Products', 'ecommerce-product-catalog');
                        ?>
</a></td>
					</tr>
					<tr>
						<td><?php 
                        _e('Delete all product categories', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><a class="button" href="<?php 
                        echo esc_url(add_query_arg('delete_all_product_categories', 1));
                        ?>
"><?php 
                        _e('Delete all Product Categories', 'ecommerce-product-catalog');
                        ?>
</a></td>
					</tr>
					<?php 
                        if (get_option('old_sort_bar') == 1) {
                            ?>
						<tr>
							<td><?php 
                            _e('Make default filters bar empty.', 'ecommerce-product-catalog');
                            ?>
:</td>
							<td><a class="button" href="<?php 
                            echo esc_url(add_query_arg('delete_old_filters_bar', 1));
                            ?>
"><?php 
                            _e('Empty Default Filters Bar', 'ecommerce-product-catalog');
                            ?>
</a></td>
						</tr>
					<?php 
                        }
                        ?>
					<tr>
						<td><?php 
                        _e('Delete all products and categories on uninstall', 'ecommerce-product-catalog');
                        ?>
:</td>
						<?php 
                        $checked = get_option('ic_delete_products_uninstall', 0);
                        ?>
						<td><input type="checkbox" name="delete_products_uninstall" <?php 
                        checked(1, $checked);
                        ?>
 /></td>
					</tr>
				</tbody>
			</table>
			<p></p>
			<table class="widefat" cellspacing="0" id="status">
				<thead>
					<tr>
						<th colspan="2"><?php 
                        _e('WordPress Environment', 'ecommerce-product-catalog');
                        ?>
</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td><?php 
                        _e('Home URL', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo home_url();
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('Site URL', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo site_url();
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('eCommerce Product Catalog Version', 'ecommerce-product-catalog');
                        ?>
:
						</td>
						<td>
							<?php 
                        $plugin_data = get_plugin_data(AL_PLUGIN_MAIN_FILE);
                        $plugin_version = $plugin_data["Version"];
                        echo $plugin_version;
                        ?>
						</td>
					</tr>
					<tr>
						<td><?php 
                        _e('eCommerce Product Catalog Database Version', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo get_option('ecommerce_product_catalog_ver', $plugin_version);
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('WP Version', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        bloginfo('version');
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('WP Multisite', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        if (is_multisite()) {
                            echo '&#10004;';
                        } else {
                            echo '&ndash;';
                        }
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('WP Memory Limit', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        $memory = WP_MEMORY_LIMIT;
                        echo size_format($memory);
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('WP Debug Mode', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        if (defined('WP_DEBUG') && WP_DEBUG) {
                            echo '&#10004;';
                        } else {
                            echo '&ndash;';
                        }
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('Language', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo get_locale();
                        ?>
</td>
					</tr>
				</tbody>
			</table>
			<p></p>
			<table class="widefat" cellspacing="0" id="status">
				<thead>
					<tr>
						<th colspan="2"><?php 
                        _e('Server Environment', 'ecommerce-product-catalog');
                        ?>
</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td><?php 
                        _e('Server Info', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo esc_html($_SERVER['SERVER_SOFTWARE']);
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('PHP Version', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        if (function_exists('phpversion')) {
                            echo esc_html(phpversion());
                        }
                        ?>
</td>
					</tr>
					<?php 
                        if (function_exists('ini_get')) {
                            ?>
						<tr>
							<td><?php 
                            _e('PHP Post Max Size', 'ecommerce-product-catalog');
                            ?>
:</td>
							<td><?php 
                            echo size_format(ini_get('post_max_size'));
                            ?>
</td>
						</tr>
						<tr>
							<td><?php 
                            _e('PHP Time Limit', 'ecommerce-product-catalog');
                            ?>
:</td>
							<td><?php 
                            echo ini_get('max_execution_time');
                            ?>
</td>
						</tr>
						<tr>
							<td><?php 
                            _e('PHP Max Input Vars', 'ecommerce-product-catalog');
                            ?>
:</td>
							<td><?php 
                            echo ini_get('max_input_vars');
                            ?>
</td>
						</tr>
					<?php 
                        }
                        ?>
					<tr>
						<td><?php 
                        _e('MySQL Version', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td>
							<?php 
                        /** @global wpdb $wpdb */
                        global $wpdb;
                        echo $wpdb->db_version();
                        ?>
						</td>
					</tr>
					<tr>
						<td><?php 
                        _e('Max Upload Size', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo size_format(wp_max_upload_size());
                        ?>
</td>
					</tr>
				</tbody>
			</table>
			<p></p>
			<table class="widefat" cellspacing="0" id="status">
				<thead>
					<tr>
						<th colspan="2"><?php 
                        _e('Server Locale', 'ecommerce-product-catalog');
                        ?>
</th>
					</tr>
				</thead>
				<tbody>
					<?php 
                        $locale = localeconv();
                        foreach ($locale as $key => $val) {
                            if (in_array($key, array('decimal_point', 'mon_decimal_point', 'thousands_sep', 'mon_thousands_sep'))) {
                                echo '<tr><td>' . $key . ':</td><td>' . ($val ? $val : __('N/A', 'ecommerce-product-catalog')) . '</td></tr>';
                            }
                        }
                        ?>
				</tbody>
			</table>
			<p></p>
			<table class="widefat" cellspacing="0" id="status">
				<thead>
					<tr>
						<th colspan="2"><?php 
                        _e('Active Plugins', 'ecommerce-product-catalog');
                        ?>
 (<?php 
                        echo count((array) get_option('active_plugins'));
                        ?>
)</th>
					</tr>
				</thead>
				<tbody>
					<?php 
                        $active_plugins = (array) get_option('active_plugins', array());
                        if (is_multisite()) {
                            $active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
                        }
                        foreach ($active_plugins as $plugin) {
                            $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
                            $dirname = dirname($plugin);
                            $version_string = '';
                            $network_string = '';
                            if (!empty($plugin_data['Name'])) {
                                // link the plugin name to the plugin url if available
                                $plugin_name = esc_html($plugin_data['Name']);
                                if (!empty($plugin_data['PluginURI'])) {
                                    $plugin_name = '<a href="' . esc_url($plugin_data['PluginURI']) . '" title="' . __('Visit plugin homepage', 'ecommerce-product-catalog') . '">' . $plugin_name . '</a>';
                                }
                                ?>
							<tr>
								<td><?php 
                                echo $plugin_name;
                                ?>
</td>
								<td><?php 
                                echo sprintf(_x('by %s', 'by author', 'ecommerce-product-catalog'), $plugin_data['Author']) . ' &ndash; ' . esc_html($plugin_data['Version']) . $version_string . $network_string;
                                ?>
</td>
							</tr>
							<?php 
                            }
                        }
                        ?>
				</tbody>
			</table>
			<p></p>
			<table class="widefat" cellspacing="0">
				<thead>
					<tr>
						<th colspan="2"><?php 
                        _e('Theme', 'ecommerce-product-catalog');
                        ?>
</th>
					</tr>
				</thead>
				<?php 
                        $active_theme = wp_get_theme();
                        ?>
				<tbody>
					<tr>
						<td><?php 
                        _e('Name', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo $active_theme->Name;
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('Version', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo $active_theme->Version;
                        if (!empty($theme_version_data['version']) && version_compare($theme_version_data['version'], $active_theme->Version, '!=')) {
                            echo ' &ndash; <strong style="color:red;">' . $theme_version_data['version'] . ' ' . __('is available', 'ecommerce-product-catalog') . '</strong>';
                        }
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('Author URL', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo $active_theme->{'Author URI'};
                        ?>
</td>
					</tr>
					<tr>
						<td><?php 
                        _e('Child Theme', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        echo is_child_theme() ? '<mark class="yes">' . '&#10004;' . '</mark>' : '&#10005; &ndash; ' . sprintf(__('If you\'re modifying eCommerce Product Catalog or a parent theme you didn\'t build personally we recommend using a child theme. See: <a href="%s" target="_blank">How to create a child theme</a>', 'ecommerce-product-catalog'), 'http://codex.wordpress.org/Child_Themes');
                        ?>
</td>
					</tr>
					<?php 
                        if (is_child_theme()) {
                            $parent_theme = wp_get_theme($active_theme->Template);
                            ?>
						<tr>
							<td><?php 
                            _e('Parent Theme Name', 'ecommerce-product-catalog');
                            ?>
:</td>
							<td><?php 
                            echo $parent_theme->Name;
                            ?>
</td>
						</tr>
						<tr>
							<td><?php 
                            _e('Parent Theme Version', 'ecommerce-product-catalog');
                            ?>
:</td>
							<td><?php 
                            echo $parent_theme->Version;
                            ?>
</td>
						</tr>
						<tr>
							<td><?php 
                            _e('Parent Theme Author URL', 'ecommerce-product-catalog');
                            ?>
:</td>
							<td><?php 
                            echo $parent_theme->{'Author URI'};
                            ?>
</td>
						</tr>
					<?php 
                        }
                        ?>
					<tr>
						<td><?php 
                        _e('eCommerce Product Catalog Support', 'ecommerce-product-catalog');
                        ?>
:</td>
						<td><?php 
                        if (!is_theme_implecode_supported()) {
                            _e('Not Declared', 'ecommerce-product-catalog');
                        } else {
                            echo '&#10004;';
                        }
                        ?>
</td>
					</tr>
				</tbody>
			</table>
			<script>
				jQuery( document ).ready( function () {
					jQuery( "input[type='checkbox']" ).change( function () {
						checkbox = jQuery( this );
						if ( checkbox.is( ":checked" ) ) {
							checked = 1;
						} else {
							checked = 0;
						}
						data = {
							action: "save_implecode_tools",
							field: checkbox.attr( 'name' ) + "|" + checked
						};
						jQuery.post( "<?php 
                        echo admin_url('admin-ajax.php');
                        ?>
", data, function ( response ) {
							checkbox.after( "<span class='saved'>Saved!</span>" );
							jQuery( ".saved" ).delay( 2000 ).fadeOut( 300, function () {
								jQuery( this ).remove();
							} );
						} );
					} );
				} );
			</script>
			<?php 
                    }
                }
            }
        }
    }
}