PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / views / admin / export / template / add_new_field.php
wp-all-export / views / admin / export / template Last commit date
add_new_field.php 1 month ago advanced_field_options.php 1 month ago custom_xml_help.php 1 month ago functions_editor.php 1 month ago
add_new_field.php
177 lines
1 <?php defined( 'ABSPATH' ) || exit; ?>
2 <script type="text/javascript">
3 (function ($) {
4
5 var get_valid_ajaxurl = function () {
6 var $URL = ajaxurl;
7 if (typeof export_id != "undefined") {
8 if ($URL.indexOf("?") == -1) {
9 $URL += '?id=' + export_id;
10 }
11 else {
12 $URL += '&id=' + export_id;
13 }
14 }
15 return $URL;
16 };
17
18 function processElementName($element, $elementName) {
19 if ($element.find('input[name^=cc_type]').val().indexOf('image_') !== -1) {
20 $elementName = 'Image ' + $elementName;
21 }
22 if ($element.find('input[name^=cc_type]').val().indexOf('attachment_') !== -1) {
23 $elementName = 'Attachment ' + $elementName;
24 }
25 return $elementName;
26 }
27
28 $(function () {
29
30 var $addAnotherForm = $('fieldset.wp-all-export-edit-column');
31 $addAnotherForm.on('click', function () {
32 var rel = $addAnotherForm.attr('rel');
33 });
34
35 $('select[name="column_value_type"]').on('change', function(){
36 $('.column_name').val($(this).find('option:selected').text());
37 });
38
39 $('.column_name').keyup(function(){
40 if($(this).val != '' && $(this).hasClass('error')) {
41 $(this).removeClass('error');
42 }
43 });
44
45 $('.preview_action').off('click').on('click', function (event) {
46 return false;
47 });
48
49 $('input[name="combine_multiple_fields"]').on('change', function () {
50 if ($(this).val() == '1') {
51 $('#combine_multiple_fields_value_container').slideDown();
52 $('#combine_multiple_fields_data').slideDown();
53 $('.php_snipped').slideUp();
54 $('.wp-all-export-advanced-field-options-content').hide();
55 $('.export-single').slideUp();
56 $('.single-field-options').slideUp();
57 $('.column_name').val('');
58
59 $('.wpallexport-plugin .save_action').addClass('disabled');
60
61 } else {
62 $('#combine_multiple_fields_value_container').slideUp();
63 $('#combine_multiple_fields_data').slideUp();
64 $('.export-single').slideDown();
65 $('.php_snipped').slideDown();
66 $('.single-field-options').slideDown();
67 $('.column_name').val($('select[name="column_value_type"]').find('option:selected').text());
68 $('.wp-all-export-advanced-field-options-content').show();
69
70 $('.wpallexport-plugin .save_action').removeClass('disabled');
71 }
72 });
73
74 $('#combine_multiple_fields_value').droppable({
75 drop: function (event, ui) {
76
77 $('.add-new-field-notice').slideDown();
78 event.preventDefault();
79 event.stopPropagation();
80 return false;
81 }
82
83 });
84
85 $('#combine_multiple_fields_value').keydown(function (event, ui) {
86
87 $('.add-new-field-notice').slideDown();
88 event.preventDefault();
89 event.stopPropagation();
90 return false;
91 });
92
93 var availableNames = [
94 ];
95
96 $('#available_data .wpallexport-xml-element').each(function(){
97
98 var text = $(this).html();
99 if(availableNames.indexOf(text) < 0) {
100 availableNames.push(text);
101 }
102 });
103
104 $('.column_name').autocomplete({
105 source: availableNames,
106 close: function() {
107 return false;
108 }
109 });
110 });
111
112 })(jQuery);
113 </script>
114 <form>
115 <div class="wp-all-export-field-options" style="width: 54%; float:left; max-height: 70vh;">
116 <div class="input" style="margin-bottom: 15px;">
117 <label style="padding:4px; display: block;" class="wpae_column_name"><?php esc_html_e('Column name', 'wp-all-export'); ?></label>
118 <label style="padding:4px; display: none;" class="wpae_element_name"><?php esc_html_e('Element name', 'wp-all-export'); ?></label>
119 <div class="clear"></div>
120 <input type="text" class="column_name" value="" style="width:100%; padding: 8px; border-radius: 5px; color: #000;"/>
121 </div>
122 <!-- SINGLE ELEMENT -->
123 <div class="input">
124 <label>
125 <input type="radio" name="combine_multiple_fields" value="0" checked="checked" /> <?php esc_html_e('Select a field to export', 'wp-all-export') ?></label>
126 </div>
127 <div class="input export-single wpae-select-field" style="margin-left:25px; margin-top:10px;">
128 <div class="clear"></div>
129 <?php
130 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $available_fields_view is built from view templates with internal escaping
131 echo $available_fields_view; ?>
132 </div>
133
134 <!-- Advanced Field Options -->
135 <?php include_once 'advanced_field_options.php'; ?>
136
137 <!-- COMBINE ELEMENTS -->
138
139 <div class="input" style="margin-top: 5px;">
140 <label><input type="radio" name="combine_multiple_fields" value="1" /> <?php esc_html_e('Custom export field', 'wp-all-export') ?></label>
141 </div>
142
143 <div class="elements export-multiple" id="combine_multiple_fields_value_container" style="margin-top: 10px; margin-left: 25px; display: none;">
144 <div class="wpallexport-free-edition-notice add-new-field-notice" style="margin: 15px 0; display: none;">
145 <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=5839967&discount=welcome-upgrade-99&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=custom-export-fields">
146 <?php esc_html_e('Upgrade to Pro to use Custom Export Fields','wp-all-export');?></a>
147 </div>
148 <textarea placeholder="<?php esc_html_e('You can drag and drop fields from Available Data, add static text, and use PHP functions', 'wp-all-export'); ?>" id="combine_multiple_fields_value" style="width: 100%;" rows="7"></textarea>
149 </div>
150
151 <!-- Functions editor -->
152 <?php include_once 'functions_editor.php'; ?>
153
154 </div>
155 <div style="width: 35%; float: right; margin-right: 33px; margin-top:10px; display: none;" class="wpae_available_data export-multiple"
156 id="combine_multiple_fields_data">
157 <fieldset id="available_data" class="optionsset rad4 wpae_available_data dialog-available-data" style="margin-bottom: 10px; ">
158 <div class="title"><?php esc_html_e('Available Data', 'wp-all-export'); ?></div>
159 <div class="wpallexport-xml resetable wpallexport-pointer-data available-data">
160 <ul>
161 <?php
162 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $available_data_view is built from view templates with internal escaping
163 echo $available_data_view; ?>
164 </ul>
165 </div>
166 </fieldset>
167 </div>
168 <div style="clear:both;"></div>
169 <div class="input wp-all-export-edit-column-buttons">
170 <input type="button" class="close_action" value="<?php esc_html_e("Cancel", "wp-all-export"); ?>"
171 style="border: none;"/>
172 <input type="button" class="delete_action" value="<?php esc_html_e("Delete", "wp-all-export"); ?>"
173 style="border: none;"/>
174 <input type="button" class="save_action" value="<?php esc_html_e("Save", "wp-all-export"); ?>"
175 style="border: none;"/>
176 </div>
177 </form>