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