fields.php
64 lines
| 1 | <?php |
| 2 | // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- variables in template files inherited from controller render() scope |
| 3 | /** |
| 4 | * @var $addon \Wpae\AddonAPI\PMXE_Addon_Base |
| 5 | * @var $groups array |
| 6 | */ |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 9 | |
| 10 | use function Wpae\AddonAPI\isGroupVisible; |
| 11 | |
| 12 | ?> |
| 13 | |
| 14 | <p class="wpae-available-fields-group"> |
| 15 | <?php echo esc_html( $addon->name() ); ?><span class="wpae-expander">+</span> |
| 16 | </p> |
| 17 | |
| 18 | <div class="wp-all-export-jetengine-wrapper wpae-custom-field"> |
| 19 | <?php |
| 20 | foreach ( $groups as $key => $group ) { |
| 21 | $is_group_visible = isGroupVisible( $group ); |
| 22 | |
| 23 | if ( ! $is_group_visible ) { |
| 24 | continue; |
| 25 | } |
| 26 | |
| 27 | ?> |
| 28 | <div class="wpae-addon-field"> |
| 29 | <ul> |
| 30 | <li> |
| 31 | <div class="default_column" rel=""> |
| 32 | <label class="wpallexport-element-label"><?php echo esc_html( $group['label'] ); ?></label> |
| 33 | <input type="hidden" name="rules[]" |
| 34 | value="pmxe_<?php echo esc_attr( $addon->slug ); ?>_<?php echo esc_attr( ( ! empty( $group['ID'] ) ) ? $group['ID'] : $group['id'] ); ?>"/> |
| 35 | </div> |
| 36 | </li> |
| 37 | <?php foreach ( $group['fields'] as $field ) { ?> |
| 38 | <li class="pmxe_<?php echo esc_attr( $addon->slug ); ?>_<?php echo esc_attr( ( ! empty( $group['ID'] ) ) ? $group['ID'] : $group['id'] ); ?> wp_all_export_auto_generate"> |
| 39 | <div class="custom_column" rel="<?php echo esc_attr( ( $i + 1 ) ); ?>"> |
| 40 | <label class="wpallexport-xml-element"><?php echo esc_html( $field['label'] ); ?></label> |
| 41 | <input type="hidden" name="ids[]" value="1"/> |
| 42 | <input type="hidden" name="cc_label[]" value="<?php echo esc_attr( $field['key'] ); ?>"/> |
| 43 | <input type="hidden" name="cc_php[]" value=""/> |
| 44 | <input type="hidden" name="cc_code[]" value=""/> |
| 45 | <input type="hidden" name="cc_sql[]" value=""/> |
| 46 | <input type="hidden" name="cc_options[]" |
| 47 | value="<?php echo esc_attr( serialize( array_merge( $field, array( 'group_id' => ( ( ! empty( $group['ID'] ) ) ? $group['ID'] : $group['id'] ) ) ) ) ); ?>"/> |
| 48 | <input type="hidden" name="cc_type[]" value="<?php echo esc_attr( $addon->slug ); ?>"/> |
| 49 | <input type="hidden" name="cc_value[]" value="<?php echo esc_attr( $field['key'] ); ?>"/> |
| 50 | <input type="hidden" name="cc_name[]" value="<?php echo esc_attr( $field['label'] ); ?>"/> |
| 51 | <input type="hidden" name="cc_settings[]" value=""/> |
| 52 | <input type="hidden" name="cc_combine_multiple_fields[]" value=""> |
| 53 | <input type="hidden" name="cc_combine_multiple_fields_value[]" value=""> |
| 54 | </div> |
| 55 | </li> |
| 56 | <?php |
| 57 | $i ++; |
| 58 | } |
| 59 | ?> |
| 60 | </ul> |
| 61 | </div> |
| 62 | <?php } ?> |
| 63 | </div> |
| 64 |