PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.3.2
Pods – Custom Content Types and Fields v3.3.2
trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / components / Migrate-ACF / ui / wizard.php
pods / components / Migrate-ACF / ui Last commit date
wizard.php 1 year ago
wizard.php
231 lines
1 <div class="wrap pods-admin">
2 <div id="icon-pods" class="icon32"><br /></div>
3
4 <form action="" method="post" class="pods-submittable">
5 <div class="pods-submittable-fields">
6 <?php echo PodsForm::field( 'action', 'pods_admin_components', 'hidden' ); ?>
7 <?php echo PodsForm::field( 'component', $component, 'hidden' ); ?>
8 <?php echo PodsForm::field( 'method', $method, 'hidden' ); ?>
9 <?php echo PodsForm::field( '_wpnonce', wp_create_nonce( 'pods-component-' . $component . '-' . $method ), 'hidden' ); ?>
10 <?php echo PodsForm::field( 'cleanup', 0, 'hidden', array( 'attributes' => array( 'id' => 'pods_cleanup' ) ) ); ?>
11
12 <h2 class="italicized"><?php esc_html_e( 'Migrate: Import from Advanced Custom Fields', 'pods' ); ?></h2>
13
14 <img src="<?php echo esc_url( PODS_URL ); ?>ui/images/pods-logo-notext-rgb-transparent.png" class="pods-leaf-watermark-right" />
15
16 <div id="pods-wizard-box" class="pods-wizard-steps-2 pods-wizard-hide-first">
17 <div id="pods-wizard-heading">
18 <ul>
19 <li class="pods-wizard-menu-current" data-step="1">
20 <i></i> <span>1</span> <?php esc_html_e( 'Step 1: Setup', 'pods' ); ?>
21 <em></em>
22 </li>
23 <li data-step="2">
24 <i></i> <span>2</span> <?php esc_html_e( 'Step 2: Migrate', 'pods' ); ?>
25 <em></em>
26 </li>
27 </ul>
28 </div>
29 <div id="pods-wizard-main">
30 <div id="pods-wizard-panel-1" class="pods-wizard-panel">
31 <div class="pods-wizard-content">
32 <p><?php esc_html_e( 'Advanced Custom Fields provides an interface to create Custom Post Types and Custom Taxonomies. You can import these and their settings directly into Pods', 'pods' ); ?></p>
33 </div>
34
35 <div id="pods-wizard-options">
36 <div class="pods-wizard-options-list">
37 <div class="pods-wizard-option">
38 <a href="#pods-wizard-import" data-opt="0">
39 <div>
40 <h2><?php esc_html_e( 'Import Only', 'pods' ); ?></h2>
41
42 <p><?php esc_html_e( 'This will import your Custom Post Types and Taxonomies.', 'pods' ); ?></p>
43 <p><?php esc_html_e( 'Until you remove them from Advanced Custom Fields, these will be treated by Pods as extended content types.', 'pods' ); ?></p>
44 </div>
45 <span>&#10095;</span>
46 </a>
47 </div>
48 <div class="pods-wizard-option">
49 <a href="#pods-wizard-import-clean" data-opt="1">
50 <div>
51 <h2><?php esc_html_e( 'Import and Clean Up', 'pods' ); ?></h2>
52
53 <p><?php esc_html_e( 'This will import your Custom Post Types and Taxonomies, and then remove them from Advanced Custom Fields.', 'pods' ); ?></p>
54 </div>
55 <span>&#10095;</span>
56 </a>
57 </div>
58 </div>
59 </div>
60 </div>
61 <div id="pods-wizard-panel-2" class="pods-wizard-panel pods-wizard-option-content">
62 <div class="pods-wizard-content">
63 <p><?php esc_html_e( 'Choose below which Custom Post Types and Taxonomies you want to import into Pods', 'pods' ); ?></p>
64
65 <p>
66 <a href="#toggle" class="button pods-wizard-toggle-all"
67 data-toggle="all"><?php esc_html_e( 'Toggle everything on / off', 'pods' ); ?></a>
68 </p>
69 </div>
70
71 <div class="stuffbox">
72 <h3><label for="link_name"><?php esc_html_e( 'Choose Post Types to Import', 'pods' ); ?></label>
73 </h3>
74
75 <div class="inside pods-manage-field pods-dependency">
76 <?php
77 if ( ! empty( $post_types ) ) {
78 ?>
79 <div class="pods-field-option-group">
80 <p class="pods-field-option-group-label">
81 <?php esc_html_e( 'Available Post Types', 'pods' ); ?>
82 </p>
83
84 <div class="pods-pick-values pods-pick-checkbox">
85 <p>
86 <a href="#toggle" class="button pods-wizard-toggle-all"
87 data-toggle="post_type"><?php esc_html_e( 'Toggle all on / off', 'pods' ); ?></a>
88 </p>
89
90 <ul>
91 <?php
92 foreach ( $post_types as $post_type ) {
93 $post_type_name = pods_v( 'post_type', $post_type );
94 $post_type_label = pods_v( 'title', $post_type, ucwords( str_replace( '_', ' ', $post_type_name ) ) );
95 ?>
96 <li>
97 <div class="pods-field pods-boolean">
98 <?php
99 echo PodsForm::field( 'post_type[' . $post_type_name . ']', pods_v( 'post_type[' . $post_type_name . ']', 'post', true ), 'boolean', [
100 'boolean_yes_label' => $post_type_label . ' (' . $post_type_name . ')',
101 'disable_dfv' => true,
102 ] );
103 ?>
104 </div>
105 </li>
106 <?php
107 }
108 ?>
109 </ul>
110 </div>
111 </div>
112 <?php
113 } else {
114 ?>
115 <p class="padded"><?php esc_html_e( 'No Post Types were found.', 'pods' ); ?></p>
116 <?php
117 }//end if
118 ?>
119 </div>
120 </div>
121
122 <div class="stuffbox">
123 <h3><label for="link_name"><?php esc_html_e( 'Choose Taxonomies to Import', 'pods' ); ?></label>
124 </h3>
125
126 <div class="inside pods-manage-field pods-dependency">
127 <?php
128 if ( ! empty( $taxonomies ) ) {
129 ?>
130 <div class="pods-field-option-group">
131 <p class="pods-field-option-group-label">
132 <?php esc_html_e( 'Available Taxonomies', 'pods' ); ?>
133 </p>
134
135 <div class="pods-pick-values pods-pick-checkbox">
136 <p>
137 <a href="#toggle" class="button pods-wizard-toggle-all"
138 data-toggle="taxonomy"><?php esc_html_e( 'Toggle all on / off', 'pods' ); ?></a>
139 </p>
140
141 <ul>
142 <?php
143 foreach ( $taxonomies as $taxonomy ) {
144 $taxonomy_name = pods_v( 'taxonomy', $taxonomy );
145 $taxonomy_label = pods_v( 'title', $taxonomy, ucwords( str_replace( '_', ' ', $taxonomy_name ) ) );
146 ?>
147 <li>
148 <?php
149 echo PodsForm::field( 'taxonomy[' . $taxonomy_name . ']', pods_v( 'taxonomy[' . $taxonomy_name . ']', 'post', true ), 'boolean', [
150 'boolean_yes_label' => $taxonomy_label . ' (' . $taxonomy_name . ')',
151 'disable_dfv' => true,
152 ] );
153 ?>
154 </li>
155 <?php
156 }
157 ?>
158 </ul>
159 </div>
160 </div>
161 <?php
162 } else {
163 ?>
164 <p class="padded"><?php esc_html_e( 'No Taxonomies were found.', 'pods' ); ?></p>
165 <?php
166 }//end if
167 ?>
168 </div>
169 </div>
170 </div>
171
172 <div id="pods-wizard-actions" class="pods-wizard-button-interface">
173 <div id="pods-wizard-toolbar">
174 <button id="pods-wizard-start" class="button button-secondary"><?php esc_html_e( 'Start Over', 'pods' ); ?></button>
175 <button id="pods-wizard-next" class="button button-primary" data-next="<?php esc_attr_e( 'Next Step', 'pods' ); ?>" data-finished="<?php esc_attr_e( 'Finished', 'pods' ); ?>" data-processing="<?php esc_attr_e( 'Processing', 'pods' ); ?>.."><?php esc_html_e( 'Next Step', 'pods' ); ?></button>
176 </div>
177 <div id="pods-wizard-finished">
178
179 </div>
180 </div>
181 </div>
182 </div>
183 </div>
184 </form>
185 </div>
186 <script type="text/javascript">
187 var pods_admin_submit_callback = function ( id ) {
188 id = parseInt( id );
189 document.location = 'admin.php?page=pods&do=create';
190 };
191
192 var pods_admin_option_select_callback = function ( $opt ) {
193 jQuery( '#pods_cleanup' ).val( $opt.data( 'opt' ) );
194 };
195
196 const toggle_all = {
197 all: true
198 };
199
200 jQuery( function ( $ ) {
201 $( '.pods-wizard-toggle-all' ).on( 'click', function ( e ) {
202 e.preventDefault();
203
204 const toggleData = $( this ).data( 'toggle' );
205
206 if ( 'undefined' == typeof toggle_all[toggleData] ) {
207 toggle_all[toggleData] = true;
208 }
209
210 let $parent;
211
212 if ( 'all' !== toggleData ) {
213 $parent = $( this ).closest( '.pods-field-option-group' );
214 } else {
215 $parent = $( this ).closest( '.pods-wizard-option-content' );
216 }
217
218 $parent.find( '.pods-field.pods-boolean input[type="checkbox"]' ).prop( 'checked', (!toggle_all[toggleData]) );
219
220 toggle_all[toggleData] = (!toggle_all[toggleData]);
221 } );
222
223 $( document ).Pods( 'validate' );
224 $( document ).Pods( 'submit' );
225 $( document ).Pods( 'wizard' );
226 $( document ).Pods( 'dependency' );
227 $( document ).Pods( 'advanced' );
228 $( document ).Pods( 'confirm' );
229 } );
230 </script>
231