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