PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.2.2
Pods – Custom Content Types and Fields v3.2.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 3 years ago
wizard.php
185 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 _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 _e( 'Setup', 'pods' ); ?>
21 <em></em>
22 </li>
23 <li data-step="2">
24 <i></i> <span>2</span> <?php _e( '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 _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 <div id="pods-wizard-options">
35 <div class="pods-wizard-option">
36 <a href="#pods-wizard-import" data-opt="0">
37 <h2><?php _e( 'Import Only', 'pods' ); ?></h2>
38
39 <p><?php _e( 'This will import your Custom Post Types and Taxonomies.', 'pods' ); ?></p>
40 <p><?php _e( 'Until you remove them from Advanced Custom Fields, these will be treated by Pods as extended content types.', 'pods' ); ?></p>
41 </a>
42
43 <p><br /></p>
44 </div>
45 <div class="pods-wizard-option">
46 <a href="#pods-wizard-import-clean" data-opt="1">
47 <h2><?php _e( 'Import and Clean Up', 'pods' ); ?></h2>
48
49 <p><?php _e( 'This will import your Custom Post Types and Taxonomies, and then remove them from Advanced Custom Fields.', 'pods' ); ?></p>
50 </a>
51
52 <p><br /></p>
53 </div>
54 </div>
55 </div>
56 <div id="pods-wizard-panel-2" class="pods-wizard-panel">
57 <div class="pods-wizard-content">
58 <p><?php _e( 'Choose below which Custom Post Types and Taxonomies you want to import into Pods', 'pods' ); ?></p>
59 </div>
60
61 <div class="stuffbox">
62 <h3><label for="link_name"><?php _e( 'Choose Post Types to Import', 'pods' ); ?></label>
63 </h3>
64
65 <div class="inside pods-manage-field pods-dependency">
66 <?php
67 if ( ! empty( $post_types ) ) {
68 ?>
69 <div class="pods-field-option-group">
70 <p class="pods-field-option-group-label">
71 <?php _e( 'Available Post Types', 'pods' ); ?>
72 </p>
73
74 <div class="pods-pick-values pods-pick-checkbox">
75 <ul>
76 <?php
77 foreach ( $post_types as $post_type ) {
78 $post_type_name = pods_v( 'post_type', $post_type );
79 $post_type_label = pods_v( 'title', $post_type, ucwords( str_replace( '_', ' ', $post_type_name ) ) );
80 ?>
81 <li>
82 <div class="pods-field pods-boolean">
83 <?php
84 echo PodsForm::field( 'post_type[' . $post_type_name . ']', pods_v( 'post_type[' . $post_type_name . ']', 'post', true ), 'boolean', [
85 'boolean_yes_label' => $post_type_label . ' (' . $post_type_name . ')',
86 'disable_dfv' => true,
87 ] );
88 ?>
89 </div>
90 </li>
91 <?php
92 }
93 ?>
94 </ul>
95 </div>
96 </div>
97 <?php
98 } else {
99 ?>
100 <p class="padded"><?php _e( 'No Post Types were found.', 'pods' ); ?></p>
101 <?php
102 }//end if
103 ?>
104 </div>
105 </div>
106
107 <div class="stuffbox">
108 <h3><label for="link_name"><?php _e( 'Choose Taxonomies to Import', 'pods' ); ?></label>
109 </h3>
110
111 <div class="inside pods-manage-field pods-dependency">
112 <?php
113 if ( ! empty( $taxonomies ) ) {
114 ?>
115 <div class="pods-field-option-group">
116 <p class="pods-field-option-group-label">
117 <?php _e( 'Available Taxonomies', 'pods' ); ?>
118 </p>
119
120 <div class="pods-pick-values pods-pick-checkbox">
121 <ul>
122 <?php
123 foreach ( $taxonomies as $taxonomy ) {
124 $taxonomy_name = pods_v( 'taxonomy', $taxonomy );
125 $taxonomy_label = pods_v( 'title', $taxonomy, ucwords( str_replace( '_', ' ', $taxonomy_name ) ) );
126 ?>
127 <li>
128 <?php
129 echo PodsForm::field( 'taxonomy[' . $taxonomy_name . ']', pods_v( 'taxonomy[' . $taxonomy_name . ']', 'post', true ), 'boolean', [
130 'boolean_yes_label' => $taxonomy_label . ' (' . $taxonomy_name . ')',
131 'disable_dfv' => true,
132 ] );
133 ?>
134 </li>
135 <?php
136 }
137 ?>
138 </ul>
139 </div>
140 </div>
141 <?php
142 } else {
143 ?>
144 <p class="padded"><?php _e( 'No Taxonomies were found.', 'pods' ); ?></p>
145 <?php
146 }//end if
147 ?>
148 </div>
149 </div>
150 </div>
151
152 <div id="pods-wizard-actions" class="pods-wizard-button-interface">
153 <div id="pods-wizard-toolbar">
154 <button id="pods-wizard-start" class="button button-secondary"><?php _e( 'Start Over', 'pods' ); ?></button>
155 <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 _e( 'Next Step', 'pods' ); ?></button>
156 </div>
157 <div id="pods-wizard-finished">
158
159 </div>
160 </div>
161 </div>
162 </div>
163 </div>
164 </form>
165 </div>
166 <script type="text/javascript">
167 var pods_admin_submit_callback = function ( id ) {
168 id = parseInt( id );
169 document.location = 'admin.php?page=pods&do=create';
170 };
171
172 var pods_admin_option_select_callback = function ( $opt ) {
173 jQuery( '#pods_cleanup' ).val( $opt.data( 'opt' ) );
174 };
175
176 jQuery( function ( $ ) {
177 $( document ).Pods( 'validate' );
178 $( document ).Pods( 'submit' );
179 $( document ).Pods( 'wizard' );
180 $( document ).Pods( 'dependency' );
181 $( document ).Pods( 'advanced' );
182 $( document ).Pods( 'confirm' );
183 } );
184 </script>
185