PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.3.6
Pods – Custom Content Types and Fields v3.3.6
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 / ui / admin / view.php
pods / ui / admin Last commit date
callouts 4 months ago upgrade 4 months ago widgets 4 months ago components-admin.php 4 months ago help-addons-row.php 4 months ago help-addons.php 4 months ago help.php 4 months ago postbox-header.php 4 months ago settings-reset.php 4 months ago settings-settings.php 4 months ago settings-tools.php 4 months ago settings.php 4 months ago setup-add.php 4 months ago setup-edit.php 4 months ago shortcode.php 4 months ago view.php 4 months ago
view.php
279 lines
1 <?php
2
3 // Don't load directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 die( '-1' );
6 }
7
8 // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
9
10 pods_form_enqueue_style( 'pods-form' );
11
12 /**
13 * @var array $fields
14 * @var PodsUI $obj
15 */
16 ?>
17
18 <div class="pods-submittable-fields">
19 <div id="poststuff" class="poststuff metabox-holder has-right-sidebar">
20 <!-- class "has-right-sidebar" preps for a sidebar... always present? -->
21 <div id="side-info-column" class="inner-sidebar">
22 <div id="side-sortables" class="meta-box-sortables ui-sortable">
23 <!-- BEGIN PUBLISH DIV -->
24 <div id="submitdiv" class="postbox">
25 <?php PodsForm::render_postbox_header( __( 'Manage', 'pods' ) ); ?>
26
27 <div class="inside">
28 <div class="submitbox" id="submitpost">
29 <?php
30 if ( isset( $pod->pod_data['fields']['created'] ) || isset( $pod->pod_data['fields']['modified'] ) || 0 < strlen( (string) pods_v_sanitized( 'detail_url', $pod->pod_data['options'] ) ) ) {
31 ?>
32 <div id="minor-publishing">
33 <?php
34 if ( 0 < strlen( (string) pods_v_sanitized( 'detail_url', $pod->pod_data['options'] ) ) ) {
35 ?>
36 <div id="minor-publishing-actions">
37 <div id="preview-action">
38 <a class="button"
39 href="<?php echo esc_url( $pod->field( 'detail_url' ) ); ?>"
40 target="_blank" rel="noopener noreferrer">
41 <?php
42 // translators: %s is the item label.
43 echo esc_html( sprintf( __( 'View %s', 'pods' ), $obj->item ) );
44 ?>
45 </a>
46 </div>
47 <div class="clear"></div>
48 </div>
49 <?php
50 }
51
52 if ( isset( $pod->pod_data['fields']['created'] ) || isset( $pod->pod_data['fields']['modified'] ) ) {
53 ?>
54 <div id="misc-publishing-actions">
55 <?php
56 $datef = __( 'M j, Y @ G:i', 'pods' );
57
58 if ( isset( $pod->pod_data['fields']['created'] ) ) {
59 $date = date_i18n( $datef, strtotime( $pod->field( 'created' ) ) );
60 ?>
61 <div class="misc-pub-section curtime">
62 <span
63 id="timestamp"><?php esc_html_e( 'Created on', 'pods' ); ?>: <b><?php echo esc_html( $date ); ?></b></span>
64 </div>
65 <?php
66 }
67
68 if ( isset( $pod->pod_data['fields']['modified'] ) && $pod->display( 'created' ) != $pod->display( 'modified' ) ) {
69 $date = date_i18n( $datef, strtotime( $pod->field( 'modified' ) ) );
70 ?>
71 <div class="misc-pub-section curtime">
72 <span id="timestamp"><?php esc_html_e( 'Last Modified', 'pods' ); ?>: <b><?php echo esc_html( $date ); ?></b></span>
73 </div>
74 <?php
75 }
76 ?>
77 </div>
78 <?php
79 }//end if
80 ?>
81 </div>
82 <!-- /#minor-publishing -->
83 <?php
84 }//end if
85 ?>
86
87 <div id="major-publishing-actions">
88 <?php
89 if ( pods_is_admin(
90 [
91 'pods',
92 'pods_delete_' . $pod->pod,
93 ]
94 ) && ! in_array( 'delete', $obj->actions_disabled, true ) && ! in_array( 'delete', $obj->actions_hidden, true ) ) {
95 ?>
96 <div id="delete-action">
97 <a class="submitdelete deletion"
98 href="<?php echo esc_url( pods_query_arg( [ 'action' => 'delete' ] ) ); ?>"
99 onclick="return confirm('You are about to permanently delete this item\n Choose \'Cancel\' to stop, \'OK\' to delete.');"><?php esc_html_e( 'Delete', 'pods' ); ?></a>
100 </div>
101 <!-- /#delete-action -->
102 <?php } ?>
103
104 <div class="clear"></div>
105 </div>
106 <!-- /#major-publishing-actions -->
107 </div>
108 <!-- /#submitpost -->
109 </div>
110 <!-- /.inside -->
111 </div>
112 <!-- /#submitdiv --><!-- END PUBLISH DIV --><!-- TODO: minor column fields -->
113 <?php
114 if ( ! in_array( 'navigate', $obj->actions_disabled, true ) && ! in_array( 'navigate', $obj->actions_hidden, true ) ) {
115 if ( ! isset( $singular_label ) ) {
116 $singular_label = ucwords( str_replace( '_', ' ', $pod->pod_data['name'] ) );
117 }
118
119 $singular_label = pods_v( 'label', $pod->pod_data['options'], $singular_label, true );
120 $singular_label = pods_v( 'label_singular', $pod->pod_data['options'], $singular_label, true );
121
122 $prev = $pod->prev_id();
123 $next = $pod->next_id();
124
125 if ( 0 < $prev || 0 < $next ) {
126 ?>
127 <div id="navigatediv" class="postbox">
128 <?php PodsForm::render_postbox_header( __( 'Navigate', 'pods' ) ); ?>
129
130 <div class="inside">
131 <div class="pods-admin" id="navigatebox">
132 <div id="navigation-actions">
133 <?php
134 if ( 0 < $prev ) {
135 ?>
136 <a class="previous-item"
137 href="<?php echo esc_url( pods_query_arg( [ 'id' => $prev ], null, 'do' ) ); ?>">
138 <span>&laquo;</span>
139 <?php
140 // translators: %s is the singular label for the content type.
141 echo esc_html( sprintf( __( 'Previous %s', 'pods' ), $singular_label ) );
142 ?>
143 </a>
144 <?php
145 }
146
147 if ( 0 < $next ) {
148 ?>
149 <a class="next-item"
150 href="<?php echo esc_url( pods_query_arg( [ 'id' => $next ], null, 'do' ) ); ?>">
151 <?php
152 // translators: %s is the singular label for the content type.
153 echo esc_html( sprintf( __( 'Next %s', 'pods' ), $singular_label ) );
154 ?>
155 <span>&raquo;</span> </a>
156 <?php
157 }
158 ?>
159
160 <div class="clear"></div>
161 </div>
162 <!-- /#navigation-actions -->
163 </div>
164 <!-- /#navigatebox -->
165 </div>
166 <!-- /.inside -->
167 </div> <!-- /#navigatediv -->
168 <?php
169 }//end if
170 }//end if
171 ?>
172 </div>
173 <!-- /#side-sortables -->
174 </div>
175 <!-- /#side-info-column -->
176
177 <div id="post-body">
178 <div id="post-body-content">
179 <?php
180 $more = false;
181
182 if ( $pod->pod_data['field_index'] != $pod->pod_data['field_id'] ) {
183 foreach ( $fields as $k => $field ) {
184 if ( $pod->pod_data['field_index'] != $field['name'] || 'text' !== $field['type'] ) {
185 continue;
186 }
187
188 $more = true;
189 $extra = '';
190
191 $max_length = (int) pods_v_sanitized( 'maxlength', $field['options'], pods_v_sanitized( $field['type'] . '_max_length', $field['options'], 0 ), true );
192
193 if ( 0 < $max_length ) {
194 $extra .= ' maxlength="' . $max_length . '"';
195 }
196 ?>
197 <div id="titlediv">
198 <div id="titlewrap">
199 <h3><?php echo esc_html( $pod->index() ); ?></h3>
200 </div>
201 <!-- /#titlewrap -->
202 </div>
203 <!-- /#titlediv -->
204 <?php
205 unset( $fields[ $k ] );
206 }//end foreach
207 }//end if
208
209 if ( 0 < count( $fields ) ) {
210 if ( $more ) {
211 $title = __( 'More Fields', 'pods' );
212 } else {
213 $title = __( 'Fields', 'pods' );
214 }
215
216 /** This filter is documented in classes/PodsMeta.php */
217 $title = apply_filters( 'pods_meta_default_box_title', $title, $pod->pod_data, $fields, $pod->pod_data['type'], $pod->pod );
218 ?>
219 <div id="normal-sortables" class="meta-box-sortables ui-sortable">
220 <div id="pods-meta-box" class="postbox" style="">
221 <?php PodsForm::render_postbox_header( $title ); ?>
222
223 <div class="inside">
224 <table class="form-table pods-metabox">
225 <?php
226 foreach ( $fields as $field ) {
227 if ( isset( $field['custom_display'] ) && is_callable( $field['custom_display'] ) ) {
228 $value = call_user_func_array(
229 $field['custom_display'], [
230 $pod->row(),
231 $obj,
232 $pod->field( $field['name'] ),
233 $field['name'],
234 $field,
235 ]
236 );
237 } else {
238 $value = $pod->display( $field['name'] );
239 }
240 ?>
241 <tr class="form-field pods-field <?php echo esc_attr( 'pods-form-ui-row-type-' . $field['type'] . ' pods-form-ui-row-name-' . PodsForm::clean( $field['name'], true ) ); ?>">
242 <th scope="row" valign="top">
243 <strong><?php echo esc_html( $field['label'] ); ?></strong>
244 </th>
245 <td>
246 <?php echo wp_kses_post( $value ); ?>
247 </td>
248 </tr>
249 <?php
250 }//end foreach
251 ?>
252 </table>
253 </div>
254 <!-- /.inside -->
255 </div>
256 <!-- /#pods-meta-box -->
257 </div>
258 <!-- /#normal-sortables -->
259
260 <?php
261 }//end if
262 ?>
263
264 <!-- <div id="advanced-sortables" class="meta-box-sortables ui-sortable"></div> -->
265 <!-- /#advanced-sortables -->
266
267 </div>
268 <!-- /#post-body-content -->
269
270 <br class="clear" />
271 </div>
272 <!-- /#post-body -->
273
274 <br class="clear" />
275 </div>
276 <!-- /#poststuff -->
277 </div>
278 <!-- /#pods-record -->
279