element.php
14 years ago
element_after.php
14 years ago
error.php
14 years ago
evaluate.php
14 years ago
index.php
14 years ago
options.php
14 years ago
preview.php
14 years ago
process-complete.php
14 years ago
process.php
14 years ago
tag.php
14 years ago
template.php
14 years ago
options.php
310 lines
| 1 | <form class="options <?php echo ! $this->isWizard ? 'edit' : '' ?>" method="post"> |
| 2 | <table class="layout"> |
| 3 | <tr> |
| 4 | <td class="left"> |
| 5 | <h2> |
| 6 | <?php if ($this->isWizard): ?> |
| 7 | <?php if ($is_loaded_template && !$load_options): ?> |
| 8 | <span class="load-options"> |
| 9 | Load Options... <input type="checkbox" name="load_options" /><a class="help" href="#help" original-title="Load options from selected template.">?</a> |
| 10 | </span> |
| 11 | <?php elseif ($is_loaded_template): ?> |
| 12 | <span class="load-options"> |
| 13 | Reset Options... <input type="checkbox" name="reset_options" /><a class="help" href="#help" original-title="Reset options.">?</a> |
| 14 | </span> |
| 15 | <?php endif; ?> |
| 16 | <?php _e('Import XML/CSV - Step 4: Post Options', 'pmxi_plugin') ?><br/><span class="taglines"><?php _e('options for the created posts', 'pmxi_plugin') ?></span> |
| 17 | <?php else: ?> |
| 18 | <?php _e('Edit Import Options', 'pmxi_plugin') ?> |
| 19 | <?php endif ?> |
| 20 | </h2> |
| 21 | <hr /> |
| 22 | |
| 23 | <?php if ($this->errors->get_error_codes()): ?> |
| 24 | <?php $this->error() ?> |
| 25 | <?php endif ?> |
| 26 | |
| 27 | <div class="post-type-container"> |
| 28 | <h3> |
| 29 | <input type="radio" id="type_post" name="type" value="post" <?php echo 'post' == $post['type'] ? 'checked="checked"' : '' ?> /> |
| 30 | <label for="type_post"><?php _e('Create Posts', 'pmxi_plugin') ?></label> |
| 31 | </h3> |
| 32 | <div class="post-type-options"> |
| 33 | <table class="form-table"> |
| 34 | <tr> |
| 35 | <th><?php _e('Categories', 'pmxi_plugin') ?> <a href="#help" class="help" title="<?php _e('Enter Category IDs or Names separated by commas. Enclose a name with double quotes if it contains comma.', 'pmxi_plugin') ?>">?</a></th> |
| 36 | <td><input type="text" class="widefat" name="categories" value="<?php echo esc_attr($post['categories']) ?>" /></td> |
| 37 | <td class="delim"> |
| 38 | <input type="text" class="small" name="categories_delim" maxlength="1" value="<?php echo esc_attr($post['categories_delim']) ?>" /> |
| 39 | <a href="#help" class="help" title="<?php _e('Delimiter used for category list', 'pmxi_plugin') ?>">?</a> |
| 40 | </td> |
| 41 | </tr> |
| 42 | <tr> |
| 43 | <th><?php _e('Tags', 'pmxi_plugin') ?> <a href="#help" class="help" title="<?php _e('Enter tags separated by commas.', 'pmxi_plugin') ?>">?</a></th> |
| 44 | <td><input type="text" name="tags" class="widefat" value="<?php echo esc_attr($post['tags']) ?>" /></td> |
| 45 | <td class="delim"> |
| 46 | <input type="text" class="small" name="tags_delim" maxlength="1" value="<?php echo esc_attr($post['tags_delim']) ?>" /> |
| 47 | <a href="#help" class="help" title="<?php _e('Delimiter used for tag list', 'pmxi_plugin') ?>">?</a> |
| 48 | </td> |
| 49 | </tr> |
| 50 | <tr> |
| 51 | <td colspan="3"> <a href="http://www.wpallimport.com/upgrade-to-pro?from=cpt" target="_blank">To import to Custom Post Types, upgrade to pro.</a> </td> |
| 52 | </tr> |
| 53 | <?php $post_taxonomies = array_diff_key(get_taxonomies_by_object_type(array('post'), 'object'), array_flip(array('category', 'post_tag', 'post_format'))) ?> |
| 54 | <?php foreach ($post_taxonomies as $ctx): ?> |
| 55 | <tr class="post_taxonomy" data-type="<?php echo implode(' ', $ctx->object_type) ?>"> |
| 56 | <th><nobr><?php echo $ctx->labels->name ?> <a href="#help" class="help" title="<?php _e('Enter taxonomies separated by commas.', 'pmxi_plugin') ?>">?</a></nobr></th> |
| 57 | <td><input type="text" name="post_taxonomies[<?php echo $ctx->name ?>]" class="widefat" value="<?php echo esc_attr(isset($post['post_taxonomies'][$ctx->name]) ? $post['post_taxonomies'][$ctx->name] : '') ?>" /></td> |
| 58 | <td class="delim"> |
| 59 | <input type="text" class="small" name="post_taxonomies_delim[<?php echo $ctx->name ?>]" maxlength="1" value="<?php echo esc_attr(isset($post['post_taxonomies_delim'][$ctx->name]) ? $post['post_taxonomies_delim'][$ctx->name] : ',') ?>" /> |
| 60 | <a href="#help" class="help" title="<?php _e('Delimiter used for taxonomy list', 'pmxi_plugin') ?>">?</a> |
| 61 | </td> |
| 62 | </tr> |
| 63 | <?php endforeach ?> |
| 64 | </table> |
| 65 | </div> |
| 66 | </div> |
| 67 | <div class="post-type-container"> |
| 68 | <h3> |
| 69 | <input type="radio" id="type_page" name="type" value="page" <?php echo 'page' == $post['type'] ? 'checked="checked"' : '' ?> /> |
| 70 | <label for="type_page"><?php _e('Create Pages', 'pmxi_plugin') ?></label> |
| 71 | </h3> |
| 72 | <div class="post-type-options"> |
| 73 | <table class="form-table"> |
| 74 | <tr> |
| 75 | <th><?php _e('Page Template', 'pmxi_plugin') ?></th> |
| 76 | <td> |
| 77 | <select name="page_template" id="page_template"> |
| 78 | <option value='default'><?php _e('Default', 'pmxi_plugin') ?></option> |
| 79 | <?php page_template_dropdown($template); ?> |
| 80 | </select> |
| 81 | </td> |
| 82 | </tr> |
| 83 | <tr> |
| 84 | <th><?php _e('Parent Page', 'pmxi_plugin') ?></th> |
| 85 | <td> |
| 86 | <?php wp_dropdown_pages(array('post_type' => 'page', 'selected' => $post['parent'], 'name' => 'parent', 'show_option_none' => __('(no parent)', 'pmxi_plugin'), 'sort_column'=> 'menu_order, post_title',)) ?> |
| 87 | </td> |
| 88 | </tr> |
| 89 | <tr> |
| 90 | <th><?php _e('Order', 'pmxi_plugin') ?></th> |
| 91 | <td><input type="text" class="small-text" name="order" value="<?php echo esc_attr($post['order']) ?>" /></td> |
| 92 | </tr> |
| 93 | <?php $page_taxonomies = get_taxonomies_by_object_type('page', 'object') ?> |
| 94 | <?php foreach ($page_taxonomies as $ctx): ?> |
| 95 | <tr class="page_taxonomy" data-type="<?php echo implode(' ', $ctx->object_type) ?>"> |
| 96 | <th><nobr><?php echo $ctx->labels->name ?> <a href="#help" class="help" title="<?php _e('Enter taxonomies separated by commas.', 'pmxi_plugin') ?>">?</a></nobr></th> |
| 97 | <td><input type="text" name="page_taxonomies[<?php echo $ctx->name ?>]" class="widefat" value="<?php echo esc_attr(isset($post['page_taxonomies'][$ctx->name]) ? $post['page_taxonomies'][$ctx->name] : '') ?>" /></td> |
| 98 | <td class="delim"> |
| 99 | <input type="text" class="small" name="page_taxonomies_delim[<?php echo $ctx->name ?>]" maxlength="1" value="<?php echo esc_attr(isset($post['page_taxonomies_delim'][$ctx->name]) ? $post['page_taxonomies_delim'][$ctx->name] : ',') ?>" /> |
| 100 | <a href="#help" class="help" title="<?php _e('Delimiter used for taxonomy list', 'pmxi_plugin') ?>">?</a> |
| 101 | </td> |
| 102 | </tr> |
| 103 | <?php endforeach ?> |
| 104 | </table> |
| 105 | </div> |
| 106 | </div> |
| 107 | |
| 108 | <h2><?php _e('Generic Options', 'pmxi_plugin') ?></h2> |
| 109 | <hr /> |
| 110 | |
| 111 | <div class="input"> |
| 112 | <input type="hidden" name="is_import_specified" value="0" /> |
| 113 | <input type="checkbox" id="is_import_specified" class="switcher" name="is_import_specified" value="1" <?php echo $post['is_import_specified'] ? 'checked="checked"': '' ?>/> |
| 114 | <label for="is_import_specified"><?php _e('Import only specified records', 'pmxi_plugin') ?> <a href="#help" class="help" title="<?php _e('Enter records or record ranges separated by commas, e.g. <b>1,5,7-10</b> would import the first, the fifth, and the seventh to tenth.', 'pmxi_plugin') ?>">?</a></label> |
| 115 | <span class="switcher-target-is_import_specified" style="vertical-align:middle"> |
| 116 | <input type="text" name="import_specified" value="<?php echo esc_attr($post['import_specified']) ?>" /> |
| 117 | </span> |
| 118 | </div> |
| 119 | <div> |
| 120 | <input type="hidden" name="is_duplicates" value="0" /> |
| 121 | <input type="checkbox" id="is_duplicates" class="switcher" name="is_duplicates" value="1" disabled="disabled"/> |
| 122 | <label for="is_duplicates"><?php _e('Check for duplicates', 'pmxi_plugin') ?> <a href="#help" class="help" title="<?php _e('This option allows you to specify action for articles being imported which have duplicates in WordPress database.<br /><br /><b>Important</b>: This option applies only to pages or posts not associated with current import. To manage overwrite rules for records previously created by import operation currently being updated please see `Reimport / Update Options` section below.', 'pmxi_plugin') ?>">?</a></label> |
| 123 | <a href="http://www.wpallimport.com/upgrade-to-pro?from=cfd" target="_blank">Upgrade to pro for automatic duplicate detection.</a> |
| 124 | </div> |
| 125 | <?php if (in_array($source_type, array('ftp', 'file'))): ?> |
| 126 | <div class="input"> |
| 127 | <input type="hidden" name="is_delete_source" value="0" /> |
| 128 | <input type="checkbox" id="is_delete_source" name="is_delete_source" value="1" <?php echo $post['is_delete_source'] ? 'checked="checked"': '' ?>/> |
| 129 | <label for="is_delete_source"><?php _e('Delete source XML file after importing', 'pmxi_plugin') ?> <a href="#help" class="help" title="<?php _e('This setting takes effect only when script has access rights to perform the action, e.g. file is not deleted when pulled via HTTP or delete permission is not granted to the user that script is executed under.', 'pmxi_plugin') ?>">?</a></label> |
| 130 | </div> |
| 131 | <?php endif ?> |
| 132 | <?php if (class_exists('PMLC_Plugin')): // option is only valid when `WP Wizard Cloak` pluign is enabled ?> |
| 133 | <div class="input"> |
| 134 | <input type="hidden" name="is_cloak" value="0" /> |
| 135 | <input type="checkbox" id="is_cloak" name="is_cloak" value="1" <?php echo $post['is_cloak'] ? 'checked="checked"': '' ?>/> |
| 136 | <label for="is_cloak"><?php _e('Auto-Cloak Links', 'pmxi_plugin') ?> <a href="#help" class="help" title="<?php printf(__('Automatically process all links present in body of created post or page with <b>%s</b> plugin', 'pmxi_plugin'), PMLC_Plugin::getInstance()->getName()) ?>">?</a></label> |
| 137 | </div> |
| 138 | <?php endif ?> |
| 139 | <?php if (in_array($source_type, array('url', 'ftp', 'file'))): ?> |
| 140 | <div class="input"> |
| 141 | <input type="hidden" name="is_scheduled" value="0" /> |
| 142 | <input type="checkbox" id="is_scheduled" class="switcher" name="is_scheduled" value="1" disabled="disabled"/> |
| 143 | <label for="is_scheduled"><?php _e('Recurring import', 'pmxi_plugin') ?> <a href="#help" class="help" title="<?php _e('Consider this option if you want this import task to be run automatically on regular basis.', 'pmxi_plugin') ?>">?</a></label> |
| 144 | <a href="http://www.wpallimport.com/upgrade-to-pro?from=ri" target="_blank">Upgrade to pro for recurring/scheduled imports.</a> |
| 145 | </div> |
| 146 | <?php endif ?> |
| 147 | <h3><?php _e('Post Status', 'pmxi_plugin') ?></h3> |
| 148 | <div> |
| 149 | <input type="radio" id="status_publish" name="status" value="publish" <?php echo 'publish' == $post['status'] ? 'checked="checked"' : '' ?> /> |
| 150 | <label for="status_publish"><?php _e('Published', 'pmxi_plugin') ?></label> |
| 151 | |
| 152 | <input type="radio" id="status_draft" name="status" value="draft" <?php echo 'draft' == $post['status'] ? 'checked="checked"' : '' ?> /> |
| 153 | <label for="status_draft"><?php _e('Draft', 'pmxi_plugin') ?></label> |
| 154 | </div> |
| 155 | |
| 156 | <h3><?php _e('Post Dates', 'pmxi_plugin') ?> <a href="#help" class="help" title="<?php _e('Use any format supported by <b>strtotime</b>', 'pmxi_plugin') ?>">?</a></h3> |
| 157 | <div class="input"> |
| 158 | <input type="radio" id="date_type_specific" class="switcher" name="date_type" value="specific" checked="checked"/> |
| 159 | <label for="date_type_specific"> |
| 160 | <?php _e('As specified', 'pmxi_plugin') ?> |
| 161 | </label> |
| 162 | <span class="switcher-target-date_type_specific" style="vertical-align:middle"> |
| 163 | <input type="text" class="datepicker" name="date" value="<?php echo esc_attr($post['date']) ?>" /> |
| 164 | </span> |
| 165 | </div> |
| 166 | <div class="input"> |
| 167 | <input type="radio" id="date_type_random" class="switcher" value="random" disabled="disabled" /> |
| 168 | <label for="date_type_random"> |
| 169 | <?php _e('Random dates', 'pmxi_plugin') ?> |
| 170 | </label> |
| 171 | <span class="" style="vertical-align:middle"> |
| 172 | <?php _e('between', 'pmxi_plugin') ?> |
| 173 | <input type="text" class="datepicker" name="date_start" value="<?php echo esc_attr($post['date_start']) ?>" /> |
| 174 | <?php _e('and', 'pmxi_plugin') ?> |
| 175 | <input type="text" class="datepicker" name="date_end" value="<?php echo esc_attr($post['date_end']) ?>" /> |
| 176 | </span> |
| 177 | <a href="http://www.wpallimport.com/upgrade-to-pro?from=rd" target="_blank">To create posts with random dates, upgrade to pro.</a> |
| 178 | </div> |
| 179 | |
| 180 | <h3><?php _e('Custom Fields', 'pmxi_plugin') ?></h3> |
| 181 | <table class="form-table custom-params"> |
| 182 | <thead> |
| 183 | <tr> |
| 184 | <td><?php _e('Name', 'pmxi_plugin') ?></td> |
| 185 | <td><?php _e('Value', 'pmxi_plugin') ?></td> |
| 186 | <td></td> |
| 187 | </tr> |
| 188 | </thead> |
| 189 | <tbody> |
| 190 | <tr class="form-field"> |
| 191 | <td><input type="text" name="custom_name[]" value="" disabled="disabled"/></td> |
| 192 | <td><textarea name="custom_value[]" disabled="disabled"></textarea></td> |
| 193 | <td class="action remove"></td> |
| 194 | </tr> |
| 195 | <tr> |
| 196 | <td colspan="3"> <a href="http://www.wpallimport.com/upgrade-to-pro?from=cf" target="_blank">To import data to Custom Fields (including fields in Custom Post Types), upgrade to pro.</a> </td> |
| 197 | </tr> |
| 198 | </tbody> |
| 199 | </table> |
| 200 | <br /> |
| 201 | <div> |
| 202 | <input type="hidden" name="comment_status" value="closed" /> |
| 203 | <input type="checkbox" id="comment_status" name="comment_status" value="open" <?php echo 'open' == $post['comment_status'] ? 'checked="checked"' : '' ?> /> |
| 204 | <label for="comment_status"><?php _e('Allow Comments', 'pmxi_plugin') ?></label> |
| 205 | </div> |
| 206 | <div> |
| 207 | <input type="hidden" name="ping_status" value="closed" /> |
| 208 | <input type="checkbox" id="ping_status" name="ping_status" value="open" <?php echo 'open' == $post['ping_status'] ? 'checked="checked"' : '' ?> /> |
| 209 | <label for="ping_status"><?php _e('Allow Trackbacks and Pingbacks', 'pmxi_plugin') ?></label> |
| 210 | </div> |
| 211 | |
| 212 | <h3><?php _e('Post Author', 'pmxi_plugin') ?></h3> |
| 213 | <div> |
| 214 | <?php wp_dropdown_users(array('name' => 'author', 'selected' => $post['author'])); ?> |
| 215 | </div> |
| 216 | |
| 217 | <h3><?php _e('Featured Image', 'pmxi_plugin') ?></h3> |
| 218 | <div> |
| 219 | <input type="text" name="featured_image" disabled="disabled" style="width:300px;" value="<?php echo esc_attr($post['featured_image']) ?>" /> <span>Separate multiple image URLs with commas</span> <br/> |
| 220 | <a href="http://www.wpallimport.com/upgade-to-pro?from=fi" target="_blank">To import images to the post image gallery and set the Featured Image, upgrade to pro.</a> |
| 221 | </div> |
| 222 | |
| 223 | <h2><?php _e('Reimport / Update Options', 'pmxi_plugin') ?></h2> |
| 224 | <hr /> |
| 225 | |
| 226 | <h3> |
| 227 | <?php _e('Post Unique Key', 'pmxi_plugin') ?> |
| 228 | <a href="#help" class="help" title="<?php _e('XPath expression which is used to detect correspondence between previously imported records and new ones. An expression used for the title is suitable in the most cases, but using recurring tag unique attribute, e.g. ID, if present, is good alternative as well.', 'pmxi_plugin') ?>">?</a> |
| 229 | </h3> |
| 230 | <div class="input"> |
| 231 | <input type="text" class="smaller-text" name="unique_key" value="<?php echo esc_attr($post['unique_key']) ?>" <?php echo ! ($this->isWizard && $update_previous->isEmpty()) ? 'disabled="disabled"' : '' ?>/> |
| 232 | </div> |
| 233 | <br /> |
| 234 | <div> |
| 235 | <input type="hidden" name="is_delete_missing" value="0" /> |
| 236 | <input type="checkbox" id="is_delete_missing" name="is_delete_missing" value="1" <?php echo $post['is_delete_missing'] ? 'checked="checked"': '' ?> /> |
| 237 | <label for="is_delete_missing"><?php _e('Delete missing records', 'pmxi_plugin') ?></label> |
| 238 | <a href="#help" class="help" title="<?php _e('Check this option if you want to delete posts from previous import operation which are not found among newly impoprted set.', 'pmxi_plugin') ?>">?</a> |
| 239 | </div> |
| 240 | <div> |
| 241 | <input type="hidden" name="is_keep_former_posts" value="0" /> |
| 242 | <input type="checkbox" id="is_keep_former_posts" name="is_keep_former_posts" value="1" <?php echo $post['is_keep_former_posts'] ? 'checked="checked"': '' ?> class="switcher switcher-reversed" /> |
| 243 | <label for="is_keep_former_posts"><?php _e('Do not update already existing records', 'pmxi_plugin') ?></label> |
| 244 | <a href="#help" class="help" title="<?php _e('Check this option if you do not want to update already esisting records. The option is useful if you plan to manually edit imported records and do not want them to be overwritten.<br /><br /><b>Important</b>: The option applies to the posts or pages associated with the import being updated. To handle potential conflicts with post or pages which are not associated with this import please use `Check for duplicates` option in `General Options` secion above.', 'pmxi_plugin') ?>">?</a> |
| 245 | </div> |
| 246 | <div class="switcher-target-is_keep_former_posts"> |
| 247 | <div> |
| 248 | <input type="hidden" name="is_keep_status" value="0" /> |
| 249 | <input type="checkbox" id="is_keep_status" name="is_keep_status" value="1" <?php echo $post['is_keep_status'] ? 'checked="checked"': '' ?> /> |
| 250 | <label for="is_keep_status"><?php _e('Keep status', 'pmxi_plugin') ?></label> |
| 251 | <a href="#help" class="help" title="<?php _e('Check this option if you do not want previously imported posts to change their publish status or being restored from Trash.', 'pmxi_plugin') ?>">?</a> |
| 252 | </div> |
| 253 | <div> |
| 254 | <input type="hidden" name="is_keep_categories" value="0" /> |
| 255 | <input type="checkbox" id="is_keep_categories" name="is_keep_categories" value="1" <?php echo $post['is_keep_categories'] ? 'checked="checked"': '' ?> /> |
| 256 | <label for="is_keep_categories"><?php _e('Keep categories, tags and taxonomies', 'pmxi_plugin') ?></label> |
| 257 | <a href="#help" class="help" title="<?php _e('Check this option if you do not want previously imported posts to change their category, tag and custom taxonomies associations upon reimport.', 'pmxi_plugin') ?>">?</a> |
| 258 | </div> |
| 259 | </div> |
| 260 | <div> |
| 261 | <input type="hidden" name="is_keep_attachments" value="0" /> |
| 262 | <input type="checkbox" id="is_keep_attachments" name="is_keep_attachments" value="1" <?php echo $post['is_keep_attachments'] ? 'checked="checked"': '' ?> /> |
| 263 | <label for="is_keep_attachments"><?php _e('Keep attachments when records removed', 'pmxi_plugin') ?></label> |
| 264 | <a href="#help" class="help" title="<?php _e('Check this option if you want attachments like featured image to be kept in media library after parent post or page is removed or replaced during reimport operation.', 'pmxi_plugin') ?>">?</a> |
| 265 | </div> |
| 266 | |
| 267 | <br /> |
| 268 | <p> |
| 269 | <?php wp_nonce_field('options', '_wpnonce_options') ?> |
| 270 | <input type="hidden" name="is_submitted" value="1" /> |
| 271 | |
| 272 | <?php if ($this->isWizard): ?> |
| 273 | <a href="<?php echo add_query_arg('action', 'template', $this->baseUrl) ?>" class="button back"><?php _e('Back', 'pmxi_plugin') ?></a> |
| 274 | |
| 275 | <input type="submit" class="button-primary ajax-import" value="<?php _e('Save & Create Posts', 'pmxi_plugin') ?>" /> |
| 276 | |
| 277 | <?php if (in_array($source_type, array('url', 'ftp', 'file'))): ?> |
| 278 | or |
| 279 | <input type="submit" name="save_only" class="button" value="<?php _e('Save Only', 'pmxi_plugin') ?>" /> |
| 280 | <?php endif ?> |
| 281 | |
| 282 | <?php else: ?> |
| 283 | <input type="submit" class="button-primary" value="<?php _e('Edit', 'pmxi_plugin') ?>" /> |
| 284 | <?php endif ?> |
| 285 | </p> |
| 286 | |
| 287 | </td> |
| 288 | <?php if ($this->isWizard or $this->isTemplateEdit): ?> |
| 289 | <td class="right"> |
| 290 | <p><?php _e('Drag & Drop opening tag of an element for inserting corresponding XPath into a form element.', 'pmxi_plugin') ?></p> |
| 291 | <?php $this->tag() ?> |
| 292 | </td> |
| 293 | <?php endif ?> |
| 294 | </tr> |
| 295 | </table> |
| 296 | </form> |
| 297 | <div id="process" style="display:none;"> |
| 298 | <?php include PMXI_Plugin::ROOT_DIR . '/views/admin/import/process.php'; ?> |
| 299 | </div> |
| 300 | <script type="text/javascript"> |
| 301 | (function($){$(function(){ |
| 302 | $('select[name="custom_type"]').change(function () { |
| 303 | var type = $(this).val(); if ('' == type) type = 'post'; |
| 304 | $('tr.post_taxonomy').each(function () { |
| 305 | $(this)[$.inArray(type, $(this).data('type').split(' ')) < 0 ? 'hide' : 'fadeIn'](); |
| 306 | }); |
| 307 | }).change(); |
| 308 | });})(jQuery); |
| 309 | </script> |
| 310 |