} global $cherry_data_manager; ?> <div class="wrap"> <div class="<?php echo $cherry_data_manager->ui_wrapper_class(array('cherry-wizard_')); ?> "> <?php /** * hook cherry_data_manager_pre_import * * do anything before content import starts */ do_action('cherry_data_manager_pre_import'); $action_url = cherry_dm_get_import_action_url(); $max_upload_size = cherry_dm_get_upload_size(); ?> <div class="box-default_ content-wrap_"> <?php do_action('cherry_data_manager_before_title'); ?> <h2 class="main-title_"> <?php _e('Import & install content', $cherry_data_manager->slug); ?> </h2> <?php _e('Please, install Sample data in order to make your webste looks exactly as our live demo including all images, pages, layout options etc.', $cherry_data_manager->slug); ?> </div>
/** * Include assets * * @since 1.0.0 */ function assets() { wp_enqueue_style('cherry-ui-elements', CHERRY_DATA_MANAGER_URI . 'assets/css/cherry-ui.css', array(), '1.0.0'); wp_enqueue_style($this->slug . '-style', CHERRY_DATA_MANAGER_URI . 'assets/css/style.css', '', CHERRY_DATA_MANAGER_VERSION); if ($this->is_manager_page($this->import_page)) { wp_deregister_script('heartbeat'); wp_enqueue_script($this->slug . '-importer', CHERRY_DATA_MANAGER_URI . 'assets/js/importer.js', array('jquery'), CHERRY_DATA_MANAGER_VERSION, true); wp_localize_script($this->slug . '-importer', 'cherry_data_manager_ajax', array('nonce' => wp_create_nonce('cherry_data_manager_ajax'))); $autoload = !empty($_SESSION['cherry_data']['sample']) ? 'yes' : 'no'; // setup js trigger for manual/automatic upload wp_localize_script($this->slug . '-importer', 'cherry_dm_import_trigger', array('autoload' => apply_filters('cherry_data_manager_content_autoload', $autoload))); // setup localized data for importer $import_texts = array('error_upload' => __('Upload Error', $this->slug), 'error_size' => __('The file is too big!', $this->slug), 'error_type' => __('The file type is error!', $this->slug), 'error_folder' => __('Folder cannot be uploaded!', $this->slug), 'uploading' => __('Uploading', $this->slug), 'upload' => __('Upload', $this->slug), 'upload_complete' => __('Upload Complete', $this->slug), 'item' => __('item', $this->slug), 'items' => __('items', $this->slug), 'uploaded_status_text' => __('Sample data installing. Some steps may take some time depending on your server settings. Please be patient.', $this->slug), 'uploaded_status_text_1' => __('Upload complete please click Continue Install button to proceed.', $this->slug), 'import_xml' => __('Importing XML', $this->slug), 'import_options' => __('Importing options', $this->slug), 'import_custom_tables' => __('Importing custom database tables', $this->slug), 'import_categories' => __('Importing categories', $this->slug), 'import_tags' => __('Importing tags', $this->slug), 'process_terms' => __('Processing dependencies', $this->slug), 'import_posts' => __('Importing posts. This may take some time. Please wait.', $this->slug), 'attach_terms' => __('Attaching terms to imported posts. This may take some time. Please wait.', $this->slug), 'attach_comments' => __('Attaching comments to imported posts. This may take some time. Please wait.', $this->slug), 'attach_postmeta' => __('Attaching metadata to imported posts. This may take some time. Please wait.', $this->slug), 'import_menu_item' => __('Importing menu items. This may take some time. Please wait.', $this->slug), 'import_attachment' => __('Importing media library.', $this->slug), 'import_attachment_metadata' => __('Importing attachements meta.', $this->slug), 'generate_attachment_metadata_step_1' => __('Generate attachements meta. Preparing. This may take some time. Please wait.', $this->slug), 'generate_attachment_metadata_step_2' => __('Generate attachements meta. Processing. This may take some time. Please wait.', $this->slug), 'generate_attachment_metadata_step_3' => __('Generate attachements meta. Finishing. This may take some time. Please wait.', $this->slug), 'generate_attachment_metadata_step_4' => __('Cropping attachements meta. Preparing. This may take some time. Please wait.', $this->slug), 'generate_attachment_metadata_step_5' => __('Cropping attachements meta. Processing. This may take some time. Please wait.', $this->slug), 'generate_attachment_metadata_step_6' => __('Cropping attachements meta. Finishing. This may take some time. Please wait.', $this->slug), 'import_parents' => __('Generating content hierarchy', $this->slug), 'update_featured_images' => __('Updating featured images', $this->slug), 'update_attachment' => __('Updating attachments', $this->slug), 'import_json' => __('Importing JSON', $this->slug), 'import_complete' => __('Installing content complete', $this->slug), 'instal_error' => __('Installing content error', $this->slug), 'confirm_load' => __("ATTENTION! Installing Sample Data will overwrite your current content.\nSo we don't recommend you to install Sample Data on a live website.\n\nClick OK to proceed", $this->slug)); wp_localize_script($this->slug . '-importer', 'cherry_dm_import_texts', $import_texts); // setup additional JS varaibles for importer $max_size = cherry_dm_get_upload_size(); $upload_dir = cherry_dm_get_upload_path(); $action_url = cherry_dm_get_import_action_url(); if (isset($_GET['type'])) { $type = $_GET['type']; } else { $type = 'demo'; } $import_vars = array('max_file_size' => $max_size['size'], 'action_url' => $action_url, 'type' => $type, 'nonce' => wp_create_nonce('cherry-dm-nonce')); wp_localize_script($this->slug . '-importer', 'cherry_dm_import_vars', $import_vars); } if ($this->is_manager_page($this->export_page)) { wp_enqueue_script($this->slug . '-exporter', CHERRY_DATA_MANAGER_URI . 'assets/js/exporter.js', array('jquery'), CHERRY_DATA_MANAGER_VERSION, true); } }