';
}
} else {
$intropop_content .= '
';
}
}
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '- '. esc_html__('Start Setup', 'i-design') .'
';
$intropop_content .= '- '. esc_html__('Select Demo', 'i-design') .'
';
$intropop_content .= '- '. esc_html__('Plugin Install', 'i-design') .'
';
$intropop_content .= '- '. esc_html__('Import Demo', 'i-design') .'
';
$intropop_content .= '
';
$intropop_content .= '
'. esc_html__('Select A Design', 'i-design') .'
';
$intropop_content .= '
'. esc_html__('Start With A Pre-designed Website', 'i-design') .'
';
$intropop_content .= '
';
$intropop_content .= '- '. esc_html__('All', 'i-design') .'
';
$intropop_content .= '- '. esc_html__('Free', 'i-design') .'
';
$intropop_content .= '- '. esc_html__('WooCommerce', 'i-design') .'
';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
';
foreach ( $demolist as $vals ) {
foreach ( $vals['categories'] as $class ) {
$intropop_classes .= 'nx-' . str_replace(' ', '-', strtolower($class)) . ' ';
}
$intropop_content .= '- ';
$intropop_content .= '';
$intropop_content .= '';
$intropop_content .= '
';
$intropop_plugins = '';
$intropop_classes = '';
}
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
';
if ( !empty($show_pop_meta) ) {
if ( '1' == $show_pop_meta[0] ) {
$intropop_content .= '
';
}
}
$intropop_content .= '
';
/*************** Stage 2 ******************/
/******************************************/
$pluginLocation = rawurlencode('one-click-demo-import/one-click-demo-import.php');
$pluginLink = idesign_plugin_activation( $pluginLocation, 'one-click-demo-import', 'one-click-demo-import.php' );
$nonce_install = idesign_plugin_install('one-click-demo-import');
$pluginTitle = 'One Click Demo Import';
$activation_button = '';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
- Start Setup
- Select Demo
- Plugin Install
- Import Demo
';
$intropop_content .= '
';
$intropop_content .= '
'. esc_html__('Please wait ... ', 'i-design') .'
';
$intropop_content .= '
'. esc_html__('Installing Plugin One Click Demo Import', 'i-design') .'
';
$intropop_content .= '
';
$activation_button .= '
';
/*************** Stage 3 ******************/
/******************************************/
$intropop_plugins = '';
$nxd_classes = '';
$item_counter = 0;
$required_plugins_list = idesign_ocdi_required_plugins();
foreach ( $demolist as $vals ) {
foreach ( $vals['categories'] as $class ) {
$nxd_classes .= 'nxd-' . strtolower($class) . ' ';
}
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
- Start Setup
- Select Demo
- Plugin Install
- Import Demo
';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
'. esc_html__('You are about to import demo site', 'i-design') .' '.$vals['import_file_name'].'
';
$intropop_content .= '
';
if ( in_array( "Free", $vals['categories']) ) {
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '- '. esc_html__('No existing content or any other data will be deleted.', 'i-design') .'
- ';
$intropop_content .= '
- '. esc_html__('Posts, pages, images, menus and other theme settings will get imported.', 'i-design') .'
';
$intropop_content .= '- '. esc_html__('Please click on the Import button only once and wait, it can take 5 - 20 minutes.', 'i-design') .'
';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
';
$intropop_content .= '
'. esc_html__('Following Plugins Will Be Installed As Part Of The Demo', 'i-design') .'
';
if( !empty($vals['required_plugin']) )
{
foreach ( $vals['required_plugin'] as $plugin_slug ) {
foreach ( $required_plugins_list as $plugin ) {
if ( $plugin_slug == $plugin['slug'] )
{
$pluginLocation = rawurlencode($plugin['slug'].'/'.$plugin['pluginfile']);
$pluginLink = idesign_plugin_activation( $pluginLocation, $plugin['slug'], $plugin['pluginfile'] );
$nonce_install = idesign_plugin_install($plugin['slug']);
$intropop_content .= '
';
}
}
}
}
$intropop_content .= '
';
} else {
$intropop_content .= '
';
}
$intropop_content .= '';
$intropop_content .= '
';
$intropop_plugins = '';
$nxd_classes = '';
$item_counter++;
}
$intropop_content .= '
';
$intropop_content .= '
';
return $intropop_content.$activation_button;
}
function idesign_enque_ocdi () {
wp_enqueue_script( 'jquery-ui-dialog' );
wp_enqueue_style( 'wp-jquery-ui-dialog' );
wp_enqueue_script( 'tx-ocdi-main-js', get_template_directory_uri() . '/inc/txoc/js/txoc-main.js');
// Get theme data.
$theme = wp_get_theme();
wp_localize_script( 'tx-ocdi-main-js', 'ocdi',
array(
'ajax_url' => admin_url( 'admin-ajax.php' ),
'ajax_nonce' => wp_create_nonce( 'ocdi-ajax-verification' ),
'texts' => array(
'missing_preview_image' => esc_html__( 'No preview image defined for this import.', 'i-design' ),
'dialog_title' => esc_html__( 'Are you sure?', 'i-design' ),
'dialog_no' => esc_html__( 'Cancel', 'i-design' ),
'dialog_yes' => esc_html__( 'Yes, import!', 'i-design' ),
'selected_import_title' => esc_html__( 'Selected demo import:', 'i-design' ),
),
'dialog_options' => apply_filters( 'pt-ocdi/confirmation_dialog_options', array() )
)
);
}
function idesign_ocdi_required_plugins() {
return array(
array(
'name' => __( 'TemplatesNext ToolKit (
Highly Recommended)', 'i-design' ),
'desc' => __( 'Required for page options, widgets and WooCommerce wishlist and compare. This plugin also adds all the custom post types like, portfolio, Team, Slider, Testimonials etc along with all the shortcodes.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/templatesnext-toolkit/' ),
'tutorial' => esc_url( 'https://www.youtube.com/watch?v=vqTHQCN2ci4' ),
'title' => 'TemplatesNext ToolKit',
'slug' => 'templatesnext-toolkit',
'pluginfile' => 'tx-toolkit.php',
'ocdi' => 1,
),
array(
'name' => __( 'Breadcrumb NavXT (
Recommended)', 'i-design' ),
'desc' => __( 'This plugin adds the “Breadcrumbs” trail for your users to help them navigate and find their location in your site.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/breadcrumb-navxt/' ),
'title' => 'Breadcrumb NavXT',
'slug' => 'breadcrumb-navxt',
'pluginfile' => 'breadcrumb-navxt.php',
'ocdi' => 1,
),
array(
'name' => __( 'Contact Form 7 (
Recommended)', 'i-design' ),
'desc' => __( 'A form creating plugin to help you create your own contact form or other kinds of forms.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/contact-form-7/' ),
'tutorial' => esc_url( 'https://www.youtube.com/watch?v=wy70WGCjMY4' ),
'title' => 'Contact Form 7',
'slug' => 'contact-form-7',
'pluginfile' => 'wp-contact-form-7.php',
'ocdi' => 1,
),
array(
'name' => __( 'One Click Demo Import (
Optional)', 'i-design' ),
'desc' => __( 'This plugin is only required if you choose to import the predefined demo contents, Once you are done with your demo setup you can deactivate the plugin.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/one-click-demo-import/' ),
'title' => 'One Click Demo Import',
'slug' => 'one-click-demo-import',
'pluginfile' => 'one-click-demo-import.php',
'ocdi' => 1,
),
array(
'name' => __( 'Brizy Page Builder (
Optional)', 'i-design' ),
'desc' => __( 'Drag and drop page builder with pre-built sections.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/brizy/' ),
'tutorial' => esc_url( 'https://www.youtube.com/watch?v=3sRJ0-PAuXk' ),
'title' => 'Brizy – Page Builder',
'slug' => 'brizy',
'pluginfile' => 'brizy.php',
),
array(
'name' => __( 'Elementor Page Builder (
Optional)', 'i-design' ),
'desc' => __( 'Drag and drop page builder with pre-built layouts.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/elementor/' ),
'tutorial' => esc_url( 'https://www.youtube.com/watch?v=3B5HL11uhVE' ),
'title' => 'Elementor',
'slug' => 'elementor',
'pluginfile' => 'elementor.php',
),
array(
'name' => __( 'SiteOrigin PageBuilder (
Recommended)', 'i-design' ),
'desc' => __( 'This drag and drop page builder plugin makes it easy to build responsive grid-based page content. Our themes supports and extends SiteOrigin PageBuilder functionalities.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/siteorigin-panels/' ),
'tutorial' => esc_url( 'https://siteorigin.com/page-builder/documentation/' ),
'title' => 'Page Builder by SiteOrigin',
'slug' => 'siteorigin-panels',
'pluginfile' => 'siteorigin-panels.php',
'ocdi' => 1,
),
array(
'name' => __( 'SiteOrigin Widgets Bundle (
Optional)', 'i-design' ),
'desc' => __( 'Additional useful widgets for pagebuilder such as Google map, Button, Image, Price table, etc.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/so-widgets-bundle/' ),
'title' => 'SiteOrigin Widgets Bundle',
'slug' => 'so-widgets-bundle',
'pluginfile' => 'so-widgets-bundle.php',
'ocdi' => 1,
),
array(
'name' => __( 'Contact Form 7 Honeypot (
Optional)', 'i-design' ),
'desc' => __( 'Plugin to fools spammers with a dummy filed visible only to bots.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/contact-form-7-honeypot/' ),
'title' => 'Contact Form 7 Honeypot',
'slug' => 'contact-form-7-honeypot',
'pluginfile' => 'honeypot.php',
'ocdi' => 1,
),
array(
'name' => __( 'Essential Addons for Elementor (
Recommended with Elementor)', 'i-design' ),
'desc' => __( 'Various addons for elementor', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/essential-addons-for-elementor-lite/' ),
'title' => 'Essential Addons for Elementor',
'slug' => 'essential-addons-for-elementor-lite',
'pluginfile' => 'essential_adons_elementor.php',
'ocdi' => 1,
),
array(
'name' => __( 'WooCommerce', 'i-design' ),
'desc' => __( 'WordPress Ecommerce plugin', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/woocommerce/' ),
'title' => 'WooCommerce',
'slug' => 'woocommerce',
'pluginfile' => 'woocommerce.php',
'ocdi' => 1,
),
array(
'name' => __( 'Loco Translate (
Optional)', 'i-design' ),
'desc' => __( 'Theme translation plugin.', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/loco-translate/' ),
'title' => 'Loco Translate',
'slug' => 'loco-translate',
'pluginfile' => 'loco.php',
'ocdi' => 1,
'repourl' => '',
),
array(
'name' => __( 'Polylang (
Optional)', 'i-design' ),
'desc' => __( 'Multilingual plugin', 'i-design' ),
'pluginurl' => esc_url( 'https://wordpress.org/plugins/polylang/' ),
'title' => 'Polylang',
'slug' => 'polylang',
'pluginfile' => 'polylang.php',
'ocdi' => 1,
'repourl' => '',
),
);
}
add_action('admin_init', 'idesign_txoc_popup_ignore');
function idesign_txoc_popup_ignore() {
global $current_user;
$user_id = $current_user->ID;
$show_pop_meta = get_user_meta($user_id, 'idesign_txoc_show_pops');
/*
if ( isset($_GET['activated']) && $_GET['activated'] == 'true' ) {
add_user_meta($user_id, 'idesign_txoc_show_pops', 1);
}
*/
if ( isset($_GET['idesign_txoc_pops']) && '0' == $_GET['idesign_txoc_pops'] ) {
update_user_meta($user_id, 'idesign_txoc_show_pops', 0);
} elseif ( isset($_GET['idesign_txoc_pops']) && '1' == $_GET['idesign_txoc_pops'] ) {
update_user_meta($user_id, 'idesign_txoc_show_pops', 1);
}
}
/* Turn On Imporp wiz */
add_action('after_switch_theme', 'idesign_txoc_setup_options');
function idesign_txoc_setup_options () {
global $current_user ;
$user_id = $current_user->ID;
$show_pop_meta = get_user_meta($user_id, 'idesign_txoc_show_pops');
add_user_meta($user_id, 'idesign_txoc_show_pops', 1);
}