admin-metabox-sub-fields.html.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <div id="nf-sub-fields">
  2. <table class="nf-sub-custom-fields-table">
  3. <thead>
  4. <tr>
  5. <th><?php _e( 'Field', 'ninja-forms' ); ?></th>
  6. <th><?php _e( 'Value', 'ninja-forms' ); ?></th>
  7. </tr>
  8. </thead>
  9. <tbody>
  10. <?php foreach( $fields as $field ): ?>
  11. <?php if( in_array( $field->get_setting( 'type' ), $hidden_field_types ) ) continue; ?>
  12. <?php if( ! isset( Ninja_Forms()->fields[ $field->get_setting( 'type' ) ] ) ) continue; ?>
  13. <?php $field_class = Ninja_Forms()->fields[ $field->get_setting( 'type' ) ]; ?>
  14. <?php if( ! $field_class ) continue; ?>
  15. <tr>
  16. <td><?php echo ( $field->get_setting( 'admin_label' ) ) ? $field->get_setting( 'admin_label' ) : $field->get_setting( 'label' ) ; ?></td>
  17. <td><?php echo $field_class->admin_form_element( $field->get_id(), $sub->get_field_value( $field->get_id() ) ); ?></td>
  18. </tr>
  19. <?php endforeach; ?>
  20. </tbody>
  21. </table>
  22. <!-- TODO: Move to Style Sheet -->
  23. <style>
  24. .nf-sub-custom-fields-table {
  25. width: 100%;
  26. border-spacing: 0;
  27. }
  28. .nf-sub-custom-fields-table thead {
  29. background-color: #f1f1f1;
  30. }
  31. .nf-sub-custom-fields-table thead th {
  32. text-align: left;
  33. }
  34. .nf-sub-custom-fields-table th,
  35. .nf-sub-custom-fields-table td {
  36. padding: 10px 0 10px 10px;
  37. vertical-align: top;
  38. }
  39. .nf-sub-custom-fields-table textarea {
  40. height: 150px;
  41. }
  42. </style>
  43. </div>