PATH:
home
/
lab2454c
/
adenbic.com
/
wp-content
/
plugins
/
yith-woocommerce-wishlist
/
plugin-fw
/
templates
/
fields
<?php /** * Template for displaying the text-array field * * @var array $field The field. * @package YITH\PluginFramework\Templates\Fields */ defined( 'ABSPATH' ) || exit; // Exit if accessed directly. list ( $field_id, $name, $value, $fields, $size, $columns, $inline ) = yith_plugin_fw_extract( $field, 'id', 'name', 'value', 'fields', 'size', 'columns', 'inline' ); if ( empty( $fields ) ) { return; } $value = isset( $value ) && is_array( $value ) ? $value : array(); $gap = 16; $columns = max( 1, absint( $columns ?? 2 ) ); $default_size = absint( ( 400 - ( $gap * ( $columns - 1 ) ) ) / $columns ); $size = max( 122, absint( $size ?? $default_size ) ); $max_width = $size * $columns + ( $gap * ( $columns - 1 ) ); // Let's build the text array! $text_array = array(); foreach ( $fields as $field_name => $single_field ) { $text_array[ $field_name ]['label'] = $single_field; $text_array[ $field_name ]['name'] = "{$name}[{$field_name}]"; $text_array[ $field_name ]['id'] = "{$field_id}_{$field_name}"; $text_array[ $field_name ]['value'] = isset( $value[ $field_name ] ) ? $value[ $field_name ] : ''; } if ( empty( $inline ) ) : ?> <table id="<?php echo esc_attr( $field_id ); ?>" class="yith-plugin-fw-text-array-table"> <?php foreach ( $text_array as $key => $single ) : ?> <tr> <td><?php echo esc_html( $single['label'] ); ?></td> <td> <input type="text" id="<?php echo esc_attr( $single['id'] ); ?>" name="<?php echo esc_attr( $single['name'] ); ?>" value="<?php echo esc_attr( $single['value'] ); ?>" <?php if ( isset( $size ) ) : ?> style="width: <?php echo absint( $size ); ?>px" <?php endif; ?> /> </td> </tr> <?php endforeach ?> </table> <?php else : ?> <div id="<?php echo esc_attr( $field_id ); ?>" class="yith-plugin-fw-text-array-inline" style="max-width: <?php echo absint( $max_width ); ?>px; grid-template-columns : repeat( auto-fit, <?php echo absint( $size ); ?>px ); gap: <?php echo absint( $gap ); ?>px" > <?php foreach ( $text_array as $key => $single ) : ?> <div class="yith-single-text"> <label for="<?php echo esc_attr( $single['id'] ); ?>"><?php echo esc_html( $single['label'] ); ?></label> <input type="text" id="<?php echo esc_attr( $single['id'] ); ?>" name="<?php echo esc_attr( $single['name'] ); ?>" value="<?php echo esc_attr( $single['value'] ); ?>" /> </div> <?php endforeach ?> </div> <?php endif; ?>
[-] buttons.php
[edit]
[-] title.php
[edit]
[-] multi-colorpicker.php
[edit]
[-] colorpicker.php
[edit]
[-] ajax-orders.php
[edit]
[-] onoff.php
[edit]
[-] slider.php
[edit]
[-] checkbox-array.php
[edit]
[-] ajax-posts.php
[edit]
[-] hidden.php
[edit]
[-] sidebars.php
[edit]
[-] image-dimensions.php
[edit]
[-] inline-fields.php
[edit]
[-] datepicker.php
[edit]
[-] textarea-editor.php
[edit]
[-] select-buttons.php
[edit]
[+]
..
[-] simple-text.php
[edit]
[-] upload.php
[edit]
[-] toggle-element-fixed.php
[edit]
[-] email.php
[edit]
[-] icons.php
[edit]
[-] sep.php
[edit]
[-] password.php
[edit]
[-] number.php
[edit]
[-] multi-select.php
[edit]
[-] ajax-terms.php
[edit]
[-] checkbox.php
[edit]
[-] customtabs.php
[edit]
[-] ajax-products.php
[edit]
[-] custom.php
[edit]
[-] select.php
[edit]
[+]
resources
[-] media.php
[edit]
[-] file.php
[edit]
[-] dimensions.php
[edit]
[-] list-table.php
[edit]
[-] textarea-codemirror.php
[edit]
[-] select-images.php
[edit]
[-] textarea.php
[edit]
[-] copy-to-clipboard.php
[edit]
[-] html.php
[edit]
[-] ajax-customers.php
[edit]
[-] date-format.php
[edit]
[-] image-gallery.php
[edit]
[-] preview.php
[edit]
[-] radio.php
[edit]
[-] text-array.php
[edit]
[-] toggle-element.php
[edit]
[-] select-mailchimp.php
[edit]
[-] text-button.php
[edit]
[-] text.php
[edit]
[-] sidebarlist.php
[edit]
[-] country-select.php
[edit]