field.php
4 months ago
form.php
4 months ago
list.php
4 months ago
single.php
4 months ago
view.php
4 months ago
form.php
75 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 | <style type="text/css"> |
| 11 | ol.pods_form_widget_form { |
| 12 | list-style: none; |
| 13 | padding-left: 0; |
| 14 | margin-left: 0; |
| 15 | } |
| 16 | |
| 17 | ol.pods_form_widget_form label { |
| 18 | display: block; |
| 19 | } |
| 20 | </style> |
| 21 | |
| 22 | <ol class="pods_form_widget_form"> |
| 23 | <li> |
| 24 | <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'pods' ); ?></label> |
| 25 | |
| 26 | <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $title ); ?>" /> |
| 27 | </li> |
| 28 | |
| 29 | <li> |
| 30 | <?php |
| 31 | $api = pods_api(); |
| 32 | $all_pods = $api->load_pods( array( 'names' => true ) ); |
| 33 | ?> |
| 34 | <label for="<?php echo esc_attr( $this->get_field_id( 'pod_type' ) ); ?>"> |
| 35 | <?php esc_html_e( 'Pod', 'pods' ); ?> |
| 36 | </label> |
| 37 | |
| 38 | <?php if ( 0 < count( $all_pods ) ) : ?> |
| 39 | <select id="<?php esc_attr( $this->get_field_id( 'pod_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'pod_type' ) ); ?>"> |
| 40 | <?php foreach ( $all_pods as $pod_name => $pod_label ) : ?> |
| 41 | <option value="<?php echo esc_attr( $pod_name ); ?>" <?php selected( $pod_name, $pod_type ); ?>> |
| 42 | <?php echo esc_html( $pod_label . ' (' . $pod_name . ')' ); ?> |
| 43 | </option> |
| 44 | <?php endforeach; ?> |
| 45 | </select> |
| 46 | <?php else : ?> |
| 47 | <strong class="red"><?php esc_html_e( 'None Found', 'pods' ); ?></strong> |
| 48 | <?php endif; ?> |
| 49 | </li> |
| 50 | |
| 51 | <li> |
| 52 | <label for="<?php echo esc_attr( $this->get_field_id( 'slug' ) ); ?>"><?php esc_html_e( 'ID or Slug', 'pods' ); ?></label> |
| 53 | |
| 54 | <input class="widefat" type="text" name="<?php echo esc_attr( $this->get_field_name( 'slug' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'slug' ) ); ?>" value="<?php echo esc_attr( $slug ); ?>" /> |
| 55 | </li> |
| 56 | |
| 57 | <li> |
| 58 | <label for="<?php echo esc_attr( $this->get_field_id( 'fields' ) ); ?>"><?php esc_html_e( 'Fields (comma-separated)', 'pods' ); ?></label> |
| 59 | |
| 60 | <input class="widefat" type="text" name="<?php echo esc_attr( $this->get_field_name( 'fields' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'fields' ) ); ?>" value="<?php echo esc_attr( $fields ); ?>" /> |
| 61 | </li> |
| 62 | |
| 63 | <li> |
| 64 | <label for="<?php echo esc_attr( $this->get_field_id( 'label' ) ); ?>"><?php esc_html_e( 'Submit Label', 'pods' ); ?></label> |
| 65 | |
| 66 | <input class="widefat" type="text" name="<?php echo esc_attr( $this->get_field_name( 'label' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'label' ) ); ?>" value="<?php echo esc_attr( $label ); ?>" /> |
| 67 | </li> |
| 68 | |
| 69 | <li> |
| 70 | <label for="<?php echo esc_attr( $this->get_field_id( 'thank_you' ) ); ?>"><?php esc_html_e( 'Thank You URL upon submission', 'pods' ); ?></label> |
| 71 | |
| 72 | <input class="widefat" type="text" name="<?php echo esc_attr( $this->get_field_name( 'thank_you' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'thank_you' ) ); ?>" value="<?php echo esc_attr( $thank_you ); ?>" /> |
| 73 | </li> |
| 74 | </ol> |
| 75 |