<?php if ($this->errors->get_error_codes()) { ?> <?php $this->error(); ?> <?php } ?> <h3><?php _e('Import/Export Templates', 'wp_all_import_plugin'); ?> </h3> <?php $templates = new PMXI_Template_List(); $templates->getBy()->convertRecords(); ?> <?php wp_nonce_field('delete-templates', '_wpnonce_delete-templates'); ?> <?php if ($templates->total()) { ?> <table> <?php foreach ($templates as $t) { ?> <tr> <td>
<label for="save_template_as"><?php _e('Save settings as a template', 'wp_all_import_plugin'); ?> </label> </p> <div class="switcher-target-save_template_as" style="float: left; overflow: hidden;"> <input type="text" name="name" placeholder="<?php _e('Template name...', 'wp_all_import_plugin'); ?> " style="vertical-align:middle; line-height: 26px;" value="<?php echo esc_attr($post['name']); ?> " /> </div> <?php $templates = new PMXI_Template_List(); ?> <div class="load-template"> <select name="load_template" id="load_template" style="padding:2px; width: auto; height: 40px;"> <option value=""><?php _e('Load Template...', 'wp_all_import_plugin'); ?> </option> <?php foreach ($templates->getBy()->convertRecords() as $t) { ?> <option value="<?php echo $t->id; ?> "><?php echo $t->name;
/** * convert imports options * compatibility with version 3.2.3 */ public function _fix_options() { global $wpdb; $imports = new PMXI_Import_List(); $post = new PMXI_Post_Record(); $templates = new PMXI_Template_List(); $template = new PMXI_Template_Record(); $is_migrated = get_option('pmxi_is_migrated'); $uploads = wp_upload_dir(); if (empty($is_migrated) or version_compare($is_migrated, PMXI_VERSION) < 0) { //PMXI_VERSION $commit_migration = true; if (empty($is_migrated)) { // plugin version less than 4.0.0 wp_all_import_rmdir($uploads['basedir'] . '/wpallimport_history'); wp_all_import_rmdir($uploads['basedir'] . '/wpallimport_logs'); foreach ($imports->setColumns($imports->getTable() . '.*')->getBy(array('id !=' => ''))->convertRecords() as $imp) { $imp->getById($imp->id); if (!$imp->isEmpty() and !empty($imp->template)) { $options = array_merge($imp->options, $imp->template); $this->__ver_4_transition_fix($options); $imp->set(array('options' => $options))->update(); if ($imp->type == 'file') { $imp->set(array('path' => $uploads['basedir'] . DIRECTORY_SEPARATOR . self::FILES_DIRECTORY . DIRECTORY_SEPARATOR . basename($imp->path)))->update(); } } } foreach ($templates->setColumns($templates->getTable() . '.*')->getBy(array('id !=' => ''))->convertRecords() as $tpl) { $tpl->getById($tpl->id); if (!$tpl->isEmpty() and !empty($tpl->title)) { $opt = empty($tpl->options) ? array() : $tpl->options; $options = array_merge($opt, array('title' => $tpl->title, 'content' => $tpl->content, 'is_keep_linebreaks' => $tpl->is_keep_linebreaks, 'is_leave_html' => $tpl->is_leave_html, 'fix_characters' => $tpl->fix_characters)); $this->__ver_4_transition_fix($options); $tpl->set(array('options' => $options))->update(); } } $commit_migration = $this->__fix_db_schema(); // feature to version 4.0.0 } else { // migration fixes for vesions switch ($is_migrated) { case '4.0.0-beta1': case '4.0.0-beta2': case '4.0.0 RC1': case '4.0.0': case '4.0.1': $commit_migration = $this->__fix_db_schema(); // feature to version 4.0.0 break; case '4.0.2': case '4.0.3': case '4.0.4': break; default: # code... break; } foreach ($imports->setColumns($imports->getTable() . '.*')->getBy(array('id !=' => ''))->convertRecords() as $imp) { $imp->getById($imp->id); if (!$imp->isEmpty()) { $options = $imp->options; $this->__ver_4x_transition_fix($options, $is_migrated); $imp->set(array('options' => $options))->update(); } } foreach ($templates->setColumns($templates->getTable() . '.*')->getBy(array('id !=' => ''))->convertRecords() as $tpl) { $tpl->getById($tpl->id); if (!$tpl->isEmpty()) { $options = empty($tpl->options) ? array() : $tpl->options; $this->__ver_4x_transition_fix($options, $is_migrated); $tpl->set(array('options' => $options))->update(); } } } if ($commit_migration) { update_option('pmxi_is_migrated', PMXI_VERSION); } } }
<div class="wpallimport-logo"></div> <div class="wpallimport-title"> <p><?php _e('WP All Import', 'wp_all_import_plugin'); ?></p> <h3><?php _e('Settings', 'wp_all_import_plugin'); ?></h3> </div> </div> <h2></h2> <div class="wpallimport-setting-wrapper"> <?php if ($this->errors->get_error_codes()): ?> <?php $this->error() ?> <?php endif ?> <h3><?php _e('Import/Export Templates', 'wp_all_import_plugin') ?></h3> <?php $templates = new PMXI_Template_List(); $templates->getBy()->convertRecords() ?> <?php wp_nonce_field('delete-templates', '_wpnonce_delete-templates') ?> <?php if ($templates->total()): ?> <table> <?php foreach ($templates as $t): ?> <tr> <td> <label class="selectit" for="template-<?php echo $t->id ?>"><input id="template-<?php echo $t->id ?>" type="checkbox" name="templates[]" value="<?php echo $t->id ?>" /> <?php echo $t->name ?></label> </td> </tr> <?php endforeach ?> </table> <p class="submit-buttons"> <input type="submit" class="button-primary" name="delete_templates" value="<?php _e('Delete Selected', 'wp_all_import_plugin') ?>" /> <input type="submit" class="button-primary" name="export_templates" value="<?php _e('Export Selected', 'wp_all_import_plugin') ?>" /> </p>