Use new code style

This commit is contained in:
David Stone
2025-02-07 19:02:33 -07:00
parent 0181024ae1
commit 8433379d90
672 changed files with 37107 additions and 45249 deletions

View File

@ -7,34 +7,42 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<textarea id="field-<?php echo esc_attr($field->id); ?>" data-init="0" data-code-editor="<?php echo esc_attr($field->lang); ?>" class="form-control wu-w-full wu-my-1 <?php echo esc_attr($field->classes); ?>" name="<?php echo esc_attr($field->id); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" <?php echo $field->get_html_attributes(); ?>><?php echo esc_attr($field->value); ?></textarea>
<textarea id="field-<?php echo esc_attr($field->id); ?>" data-init="0" data-code-editor="<?php echo esc_attr($field->lang); ?>" class="form-control wu-w-full wu-my-1 <?php echo esc_attr($field->classes); ?>" name="<?php echo esc_attr($field->id); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" <?php echo $field->get_html_attributes(); ?>><?php echo esc_attr($field->value); ?></textarea>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</li>

View File

@ -7,38 +7,46 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block">
<div class="wu-block">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<div class="wu-mt-2">
<div class="wu-mt-2">
<color-picker class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="hidden" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>></color-picker>
<color-picker class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="hidden" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>></color-picker>
</div>
</div>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</li>

View File

@ -8,57 +8,65 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<select class="wu_select_icon" name="<?php echo esc_attr($field->id); ?>">
<select class="wu_select_icon" name="<?php echo esc_attr($field->id); ?>">
<option value=""><?php echo __('No Icon','wp-ultimo'); ?></option>
<option value=""><?php echo __('No Icon', 'wp-ultimo'); ?></option>
<?php foreach (wu_get_icons_list() as $category_label => $category_array) : ?>
<?php foreach (wu_get_icons_list() as $category_label => $category_array) : ?>
<optgroup label="<?php echo $category_label; ?>">
<optgroup label="<?php echo $category_label; ?>">
<?php foreach ($category_array as $option_key => $option_value) : ?>
<?php foreach ($category_array as $option_key => $option_value) : ?>
<option
value="<?php echo esc_attr($option_value); ?>"
<?php selected($field->value, $option_value); ?>
>
<?php echo $option_value; ?>
</option>
<option
value="<?php echo esc_attr($option_value); ?>"
<?php selected($field->value, $option_value); ?>
>
<?php echo $option_value; ?>
</option>
<?php endforeach; ?>
<?php endforeach; ?>
</optgroup>
</optgroup>
<?php endforeach; ?>
<?php endforeach; ?>
</select>
</select>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</li>

View File

@ -7,47 +7,55 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full <?php echo esc_attr($field->classes); ?>">
<div class="wu-block wu-w-full <?php echo esc_attr($field->classes); ?>">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php
<?php
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$form = new \WP_Ultimo\UI\Form($field->id, $field->fields, array(
'views' => 'admin-pages/fields',
'classes' => trim('wu-flex '.esc_attr($field->classes)),
'field_wrapper_classes' => 'wu-bg-transparent',
));
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$form = new \WP_Ultimo\UI\Form(
$field->id,
$field->fields,
array(
'views' => 'admin-pages/fields',
'classes' => trim('wu-flex ' . esc_attr($field->classes)),
'field_wrapper_classes' => 'wu-bg-transparent',
)
);
$form->render();
$form->render();
?>
?>
<?php if ($field->desc) : ?>
<?php if ($field->desc) : ?>
<div class="wu-mt-2 wu-block wu-bg-gray-100 wu-rounded wu-border-solid wu-border-gray-400 wu-border-t wu-border-l wu-border-b wu-border-r wu-text-2xs wu-py-2 wu-p-2">
<div class="wu-mt-2 wu-block wu-bg-gray-100 wu-rounded wu-border-solid wu-border-gray-400 wu-border-t wu-border-l wu-border-b wu-border-r wu-text-2xs wu-py-2 wu-p-2">
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</li>

View File

@ -7,30 +7,30 @@
?>
<li class="wu-bg-gray-100 wu-py-4 <?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<h3 class="wu-my-1 wu-text-base wu-text-gray-800">
<h3 class="wu-my-1 wu-text-base wu-text-gray-800">
<?php echo $field->title; ?>
<?php echo $field->title; ?>
<?php if ($field->tooltip) : ?>
<?php if ($field->tooltip) : ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php endif; ?>
<?php endif; ?>
</h3>
</h3>
<?php if ($field->desc) : ?>
<?php if ($field->desc) : ?>
<p class="wu-mt-1 wu-mb-0 wu-text-gray-700">
<p class="wu-mt-1 wu-mb-0 wu-text-gray-700">
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</p>
</p>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</li>

View File

@ -7,6 +7,6 @@
?>
<li class="wu-hidden wu-m-0">
<input class="form-control wu-w-full" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
</li>

View File

@ -7,35 +7,43 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
<div class="wu-block wu-w-full wu-mt-4 <?php echo esc_attr($field->classes); ?>">
<div class="wu-block wu-w-full wu-mt-4 <?php echo esc_attr($field->classes); ?>">
<?php echo $field->content; ?>
<?php echo $field->content; ?>
</div>
</div>
</div>
</div>
</li>

View File

@ -7,7 +7,7 @@
/**
* Set the media query.
*
*
* When the stacked option is present
* and set to true, ignore the flex arrangement
* and make elements stacked.
@ -15,96 +15,104 @@
$mq = $field->stacked ? 'ignore-' : '';
$content_wrapper_classes = $field->content_wrapper_classes
? esc_attr(trim($field->content_wrapper_classes))
: "wu-ml-0 {$mq}md:wu-ml-4 {$mq}md:wu-w-4/12 wu-mt-4 {$mq}md:wu-mt-0 lg:wu-mt-2";
? esc_attr(trim($field->content_wrapper_classes))
: "wu-ml-0 {$mq}md:wu-ml-4 {$mq}md:wu-w-4/12 wu-mt-4 {$mq}md:wu-mt-0 lg:wu-mt-2";
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="<?php echo $mq; ?>md:wu-flex wu-items-center wu-w-full">
<div class="<?php echo $mq; ?>md:wu-flex wu-items-center wu-w-full">
<div class="<?php echo $mq; ?>md:wu-w-10/12">
<?php
<div class="<?php echo $mq; ?>md:wu-w-10/12">
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<div class="<?php echo $mq; ?>md:wu-w-9/12">
<?php
<div class="<?php echo $mq; ?>md:wu-w-9/12">
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</div>
</div>
<div class="<?php echo $content_wrapper_classes; ?>">
<div class="wu-wrapper-image-field wu-w-full wu-overflow-hidden">
<div class="<?php echo $content_wrapper_classes; ?>">
<div class="wu-wrapper-image-field wu-w-full wu-overflow-hidden">
<div class="wu-relative wu-w-full wu-overflow-hidden">
<div class="wu-relative wu-w-full wu-overflow-hidden">
<div class="wu-self-center wu-rounded wu-flex <?php echo $mq; ?>md:wu-max-w-full wu-min-w-full <?php echo $mq; ?>md:wu-max-h-20 wu-overflow-hidden">
<img
class="<?php echo $field->img ? '' : 'wu-absolute'; ?> wu-self-center wu-rounded sm:wu-max-w-full wu-min-w-full"
src="<?php echo $field->img; ?>"
>
<div class="wu-self-center wu-rounded wu-flex <?php echo $mq; ?>md:wu-max-w-full wu-min-w-full <?php echo $mq; ?>md:wu-max-h-20 wu-overflow-hidden">
<img
class="<?php echo $field->img ? '' : 'wu-absolute'; ?> wu-self-center wu-rounded sm:wu-max-w-full wu-min-w-full"
src="<?php echo $field->img; ?>"
>
</div>
</div>
<div class="wu-wrapper-image-field-upload-actions wu-absolute wu-top-4 wu-right-4 <?php echo $mq; ?>md:wu-top-2 <?php echo $mq; ?>md:wu-right-2 wu-scale-150 <?php echo $mq; ?>md:wu-scale-100">
<div class="wu-wrapper-image-field-upload-actions wu-absolute wu-top-4 wu-right-4 <?php echo $mq; ?>md:wu-top-2 <?php echo $mq; ?>md:wu-right-2 wu-scale-150 <?php echo $mq; ?>md:wu-scale-100">
<a title="<?php _e('Preview Image', 'wp-ultimo'); ?>" href="<?php echo $field->img; ?>" class="wubox wu-no-underline wu-text-center wu-inline-block wu-bg-black wu-opacity-60 wu-rounded-full wu-text-white wu-w-5 wu-h-5 wu-shadow-sm">
<a title="<?php _e('Preview Image', 'wp-ultimo'); ?>" href="<?php echo $field->img; ?>" class="wubox wu-no-underline wu-text-center wu-inline-block wu-bg-black wu-opacity-60 wu-rounded-full wu-text-white wu-w-5 wu-h-5 wu-shadow-sm">
<span class="dashicons-wu-eye1 wu-align-middle" style="top: -2px;"></span>
<span class="dashicons-wu-eye1 wu-align-middle" style="top: -2px;"></span>
</a>
</a>
<a title="<?php _e('Remove Image', 'wp-ultimo'); ?>" href="#" class="wu-remove-image wu-no-underline wu-text-center wu-inline-block wu-bg-black wu-opacity-60 wu-rounded-full wu-text-white wu-w-5 wu-h-5 wu-shadow-sm">
<a title="<?php _e('Remove Image', 'wp-ultimo'); ?>" href="#" class="wu-remove-image wu-no-underline wu-text-center wu-inline-block wu-bg-black wu-opacity-60 wu-rounded-full wu-text-white wu-w-5 wu-h-5 wu-shadow-sm">
<span class="dashicons-wu-cross wu-align-middle"></span>
<span class="dashicons-wu-cross wu-align-middle"></span>
</a>
</a>
</div>
</div>
</div>
</div>
<input name="<?php echo esc_attr($field_slug); ?>" type="hidden" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?> />
<input name="<?php echo esc_attr($field_slug); ?>" type="hidden" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?> />
<div class="wu-add-image-wrapper <?php echo $mq; ?>md:wu-mt-0 wu-w-full" style="display: none;">
<div class="wu-add-image-wrapper <?php echo $mq; ?>md:wu-mt-0 wu-w-full" style="display: none;">
<a class="button wu-w-full wu-text-center wu-add-image">
<a class="button wu-w-full wu-text-center wu-add-image">
<span class="dashicons-wu-upload"></span> <?php _e('Upload Image', 'wp-ultimo'); ?>
<span class="dashicons-wu-upload"></span> <?php _e('Upload Image', 'wp-ultimo'); ?>
</a>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</li>

View File

@ -7,38 +7,46 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<a class="form-control <?php echo esc_attr($field->classes); ?>" type="<?php echo esc_attr($field->type); ?>" <?php echo $field->get_html_attributes(); ?>>
<a class="form-control <?php echo esc_attr($field->classes); ?>" type="<?php echo esc_attr($field->type); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php echo $field->display_value; ?>
<?php echo $field->display_value; ?>
</a>
</a>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</li>

View File

@ -6,80 +6,88 @@
*/
?>
<li
class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>"
<?php echo $field->get_wrapper_html_attributes(); ?>
class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>"
<?php echo $field->get_wrapper_html_attributes(); ?>
>
<div class="wu-w-full">
<div class="wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
<ul data-columns="<?php echo esc_attr($field->columns); ?>" class='items wu--mx-1 wu-overflow-hidden wu-multiselect-content wu-static wu-my-2'>
<ul data-columns="<?php echo esc_attr($field->columns); ?>" class='items wu--mx-1 wu-overflow-hidden wu-multiselect-content wu-static wu-my-2'>
<?php foreach ($field->options as $value => $option) : ?>
<?php foreach ($field->options as $value => $option) : ?>
<li class="item wu-box-border wu-m-0 wu-my-2">
<li class="item wu-box-border wu-m-0 wu-my-2">
<div class="wu-bg-gray-100 wu-p-3 wu-m-0 wu-border-gray-300 wu-border-solid wu-border wu-rounded wu-items-center wu-flex wu-justify-between">
<div class="wu-bg-gray-100 wu-p-3 wu-m-0 wu-border-gray-300 wu-border-solid wu-border wu-rounded wu-items-center wu-flex wu-justify-between">
<span class="wu-block">
<span class="wu-block">
<span class="wu-my-1 wu-text-xs wu-font-bold wu-block">
<span class="wu-my-1 wu-text-xs wu-font-bold wu-block">
<?php echo $option['title']; ?>
<?php echo $option['title']; ?>
</span>
</span>
<?php if (isset($option['desc']) && !empty($option['desc'])) : ?>
<?php if (isset($option['desc']) && ! empty($option['desc'])) : ?>
<span class="wu-my-1 wu-inline-block wu-text-xs">
<span class="wu-my-1 wu-inline-block wu-text-xs">
<?php echo $option['desc']; ?>
<?php echo $option['desc']; ?>
</span>
</span>
<?php endif; ?>
<?php endif; ?>
</span>
</span>
<span class="wu-block wu-ml-2">
<span class="wu-block wu-ml-2">
<div class="wu-toggle">
<div class="wu-toggle">
<input <?php checked(in_array($value, (array) $field->value, true)); ?> value="<?php echo esc_attr($value); ?>" id="<?php echo esc_attr("{$field->id}_{$value}"); ?>" type="checkbox" name="<?php echo esc_attr("{$field->id}[]"); ?>" class="wu-tgl wu-tgl-ios" <?php echo $field->get_html_attributes(); ?>>
<input <?php checked(in_array($value, (array) $field->value, true)); ?> value="<?php echo esc_attr($value); ?>" id="<?php echo esc_attr("{$field->id}_{$value}"); ?>" type="checkbox" name="<?php echo esc_attr("{$field->id}[]"); ?>" class="wu-tgl wu-tgl-ios" <?php echo $field->get_html_attributes(); ?>>
<label for="<?php echo esc_attr("{$field->id}_{$value}"); ?>" class="wu-tgl-btn wp-ui-highlight"></label>
<label for="<?php echo esc_attr("{$field->id}_{$value}"); ?>" class="wu-tgl-btn wp-ui-highlight"></label>
</div>
</div>
</span>
</span>
</div>
</div>
</li>
</li>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
</ul>
</div>
</div>
</li>

View File

@ -7,22 +7,26 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<div class="<?php echo esc_attr('wu-my-0 '.$field->classes); ?>">
<div class="<?php echo esc_attr('wu-my-0 ' . $field->classes); ?>">
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</div>
</div>
</li>

View File

@ -4,138 +4,142 @@
*
* @since 2.0.0
*/
?>
<?php if ($field->title) : ?>
<?php if ( $field->title ) : ?>
<li id="" class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li id=""
class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-w-full wu-block">
<div class="wu-w-full wu-block">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array('field' => $field)
);
?>
?>
<?php
<?php
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
?>
</div>
</div>
</li>
</li>
<?php endif; ?>
<?php
if (!$field->values && $field->value) {
if (! $field->values && $field->value) {
$_values = array();
$columns = array_keys($field->value);
$values = $field->value;
$_values = array();
foreach ($columns as $column) {
$count = count(array_pop($field->value));
for ($i = 0; $i < $count; $i++ ) {
$_values[ $i ][ $column ] = $field->value[ $column ][ $i ];
}
}
$columns = array_keys($field->value);
$field->values = $_values;
}
$values = $field->value;
$fields = array();
foreach ($columns as $column) {
foreach ($field->fields as $key => $value) {
$fields[ $key . '[]' ] = $field->fields[ $key ];
}
$count = count(array_pop($field->value));
if (is_array($field->values)) {
$position = 0;
$field_len = count($field->values);
foreach ($field->values as $key => $value) {
$field_id = esc_attr($field->id);
for ($i = 0; $i < $count; $i++) {
$field_id .= $position !== $field_len - 1 ? $key : '';
++$position;
?>
<li id="<?php echo esc_attr($field_id); ?>-line"
class="field-repeater wu-bg-gray-100 <?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-w-full <?php echo esc_attr($field->classes); ?>">
<?php
foreach ($value as $field_name => $field_value) {
$fields[ $field_name . '[]' ]['value'] = $field_value;
}
$_values[$i][$column] = $field->value[$column][$i];
(new \WP_Ultimo\UI\Form(
$field->id,
$fields,
array(
'views' => 'admin-pages/fields',
'classes' => 'wu-flex',
'field_wrapper_classes' => 'wu-bg-transparent',
)
))->render();
?>
</div>
</li>
<?php
}
} else {
?>
<li id="<?php echo esc_attr($field->id); ?>-line"
class="field-repeater wu-bg-gray-100 <?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
} // end if;
<div class="wu-w-full <?php echo esc_attr($field->classes); ?>">
} // end if;
<?php
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
(new \WP_Ultimo\UI\Form(
$field->id,
$fields,
array(
'views' => 'admin-pages/fields',
'classes' => 'wu-flex',
'field_wrapper_classes' => 'wu-bg-transparent',
)
))->render();
$field->values = $_values;
?>
} // end if;
</div>
$fields = array();
foreach ($field->fields as $key => $value) {
$fields[$key.'[]'] = $field->fields[$key];
}
if (is_array($field->values)) {
$position = 0;
$field_len = count($field->values);
foreach ($field->values as $key => $value) {
$field_id = esc_attr($field->id);
$field_id .= $position !== $field_len - 1 ? $key : '';
$position++;
?>
<li id="<?php echo esc_attr($field_id); ?>-line" class="field-repeater wu-bg-gray-100 <?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-w-full <?php echo esc_attr($field->classes); ?>">
<?php
foreach ($value as $field_name => $field_value) {
$fields[$field_name.'[]']['value'] = $field_value;
}
$form = new \WP_Ultimo\UI\Form($field->id, $fields, array(
'views' => 'admin-pages/fields',
'classes' => 'wu-flex',
'field_wrapper_classes' => 'wu-bg-transparent',
));
$form->render();
?>
</div>
</li>
<?php
}
} else {
?>
<li id="<?php echo esc_attr($field->id); ?>-line" class="field-repeater wu-bg-gray-100 <?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-w-full <?php echo esc_attr($field->classes); ?>">
<?php
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$form = new \WP_Ultimo\UI\Form($field->id, $fields, array(
'views' => 'admin-pages/fields',
'classes' => 'wu-flex',
'field_wrapper_classes' => 'wu-bg-transparent',
));
$form->render();
?>
</div>
</li>
<?php
}
</li>
<?php
}
?>
<li class="<?php echo esc_attr($field->wrapper_classes); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<a class="button wu-w-full wu-text-center" href="#" v-on:click.prevent="duplicate_and_clean($event, '.field-repeater')">
<?php _e('Add new Line', 'wp-ultimo'); ?>
</a>
<a class="button wu-w-full wu-text-center" href="#"
v-on:click.prevent="duplicate_and_clean($event, '.field-repeater')">
<?php esc_html_e('Add new Line', 'wp-ultimo'); ?>
</a>
</li>

View File

@ -7,69 +7,80 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
<div class="wu-flex wu-flex-wrap wu--mx-2 wu-mt-2">
<div class="wu-flex wu-flex-wrap wu--mx-2 wu-mt-2">
<?php foreach ($field->options as $option_value => $option) : ?>
<?php foreach ($field->options as $option_value => $option) : ?>
<?php
<?php
/*
* Set the default keys.
*/
$option = wp_parse_args($option, array(
'tooltip' => '',
));
/*
* Set the default keys.
*/
$option = wp_parse_args(
$option,
array(
'tooltip' => '',
)
);
?>
?>
<div class="wu-p-2 wu-box-border wu-flex <?php echo esc_attr($field->classes); ?>" style="height: 110px;">
<div class="wu-p-2 wu-box-border wu-flex <?php echo esc_attr($field->classes); ?>" style="height: 110px;">
<label class="wu-w-full wu-relative wu-rounded wu-p-1 wu-border-solid wu-border wu-flex wu-items-center wu-justify-center wu-bg-gray-100 wu-text-gray-600 wu-border-gray-300" v-bind:class="require('<?php echo esc_attr($field->id); ?>', '<?php echo esc_attr($option_value); ?>') ? 'wu-bg-gray-200 wu-text-gray-700 wu-border-gray-400 selected' : '' " for="<?php echo esc_attr($field->id.'-'.$option_value); ?>">
<label class="wu-w-full wu-relative wu-rounded wu-p-1 wu-border-solid wu-border wu-flex wu-items-center wu-justify-center wu-bg-gray-100 wu-text-gray-600 wu-border-gray-300" v-bind:class="require('<?php echo esc_attr($field->id); ?>', '<?php echo esc_attr($option_value); ?>') ? 'wu-bg-gray-200 wu-text-gray-700 wu-border-gray-400 selected' : '' " for="<?php echo esc_attr($field->id . '-' . $option_value); ?>">
<div class="wu-text-center" <?php echo wu_tooltip_text($option['tooltip']); ?>>
<div class="wu-text-center" <?php echo wu_tooltip_text($option['tooltip']); ?>>
<span class="wu-block wu-text-2xl wu-mb-2 <?php echo esc_attr($option['icon']); ?>"></span>
<span class="wu-block wu-text-2xl wu-mb-2 <?php echo esc_attr($option['icon']); ?>"></span>
<input class="wu-w-0 wu-h-0 wu-hidden" id="<?php echo esc_attr($field->id.'-'.$option_value); ?>" type="radio" <?php checked($option_value, $field->value); ?> value="<?php echo esc_attr($option_value); ?>" name="<?php echo esc_attr($field->id); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="wu-w-0 wu-h-0 wu-hidden" id="<?php echo esc_attr($field->id . '-' . $option_value); ?>" type="radio" <?php checked($option_value, $field->value); ?> value="<?php echo esc_attr($option_value); ?>" name="<?php echo esc_attr($field->id); ?>" <?php echo $field->get_html_attributes(); ?>>
<span class="wu-uppercase wu-text-2xs wu-font-semibold">
<span class="wu-uppercase wu-text-2xs wu-font-semibold">
<?php echo $option['title']; ?>
<?php echo $option['title']; ?>
</span>
</span>
</div>
</div>
</label>
</label>
</div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</li>

View File

@ -7,52 +7,60 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<select class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?><?php echo isset($field->html_attr['multiple']) && $field->html_attr['multiple'] ? '[]' : ''; ?>" <?php echo $field->get_html_attributes(); ?> placeholder="<?php echo $field->placeholder; ?>">
<select class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?><?php echo isset($field->html_attr['multiple']) && $field->html_attr['multiple'] ? '[]' : ''; ?>" <?php echo $field->get_html_attributes(); ?> placeholder="<?php echo $field->placeholder; ?>">
<?php foreach ($field->options as $option_value => $option_label) : ?>
<?php foreach ($field->options as $option_value => $option_label) : ?>
<option <?php selected($option_value === $field->value || (is_array($field->value) && in_array($option_value, $field->value))); ?> value="<?php echo esc_attr($option_value); ?>">
<option <?php selected($option_value === $field->value || (is_array($field->value) && in_array($option_value, $field->value))); ?> value="<?php echo esc_attr($option_value); ?>">
<?php echo $option_label; ?>
<?php echo $option_label; ?>
</option>
</option>
<?php endforeach; ?>
<?php endforeach; ?>
<?php if ($field->options_template) : ?>
<?php if ($field->options_template) : ?>
<?php echo $field->options_template; ?>
<?php echo $field->options_template; ?>
<?php endif; ?>
<?php endif; ?>
</select>
</select>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</li>

View File

@ -7,26 +7,30 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block">
<div class="wu-block">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->desc) : ?>
<?php if ($field->desc) : ?>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; ?></span>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; ?></span>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</li>

View File

@ -5,12 +5,12 @@
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes).(strpos($field->wrapper_classes, '-bg-') === false ? ' wu-bg-gray-200' : '')); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<li class="<?php echo esc_attr(trim($field->wrapper_classes) . (strpos($field->wrapper_classes, '-bg-') === false ? ' wu-bg-gray-200' : '')); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<button id="<?php echo esc_attr($field->id); ?>" type="submit" name="submit_button" value="<?php echo esc_attr($field->id); ?>" <?php echo $field->get_html_attributes(); ?> class="<?php echo esc_attr(trim($field->classes)); ?>">
<button id="<?php echo esc_attr($field->id); ?>" type="submit" name="submit_button" value="<?php echo esc_attr($field->id); ?>" <?php echo $field->get_html_attributes(); ?> class="<?php echo esc_attr(trim($field->classes)); ?>">
<?php echo $field->title; ?>
<?php echo $field->title; ?>
</button>
</button>
</li>

View File

@ -7,23 +7,23 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?> wu-bg-gray-200" style="margin-bottom: -1px;" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu--m-4 wu-px-1">
<div class="wu--m-4 wu-px-1">
<?php foreach ($field->options as $option_value => $option_label) : ?>
<?php foreach ($field->options as $option_value => $option_label) : ?>
<label
class="wu-mt-1 wu-inline-block wu-uppercase wu-text-xs wu-text-gray-500 wu-px-4 wu-py-3 wu-font-bold wu-border-solid wu-border wu-border-b-0 wu-border-transparent wu-rounded-tl wu-rounded-tr "
v-bind:class="'<?php echo esc_attr($option_value); ?>' == <?php echo esc_attr($field->id); ?> ? 'wu-bg-white wu-text-gray-600 wu-border-gray-300' : ''"
>
<label
class="wu-mt-1 wu-inline-block wu-uppercase wu-text-xs wu-text-gray-500 wu-px-4 wu-py-3 wu-font-bold wu-border-solid wu-border wu-border-b-0 wu-border-transparent wu-rounded-tl wu-rounded-tr "
v-bind:class="'<?php echo esc_attr($option_value); ?>' == <?php echo esc_attr($field->id); ?> ? 'wu-bg-white wu-text-gray-600 wu-border-gray-300' : ''"
>
<?php echo $option_label; ?>
<?php echo $option_label; ?>
<input class="wu-w-0 wu-h-0 wu-overflow-hidden wu-hidden" type="radio" name="<?php echo esc_attr($field->id); ?>" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="wu-w-0 wu-h-0 wu-overflow-hidden wu-hidden" type="radio" name="<?php echo esc_attr($field->id); ?>" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?>>
</label>
</label>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</div>
</li>

View File

@ -7,76 +7,80 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block">
<div class="wu-block">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->type === 'date' || $field->date === true) : ?>
<?php if ($field->type === 'date' || $field->date === true) : ?>
<?php
<?php
if (wu_validate_date($field->value)) {
if (wu_validate_date($field->value)) {
$date = $field->value;
$date = $field->value;
$time = strtotime(get_date_from_gmt($date));
$time = strtotime(get_date_from_gmt($date));
$formatted_value = date_i18n(get_option('date_format'), $time);
$formatted_value = date_i18n(get_option('date_format'), $time);
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-ultimo') : __('In %s', 'wp-ultimo'); // phpcs:ignore
echo sprintf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', $formatted_value, sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp'))), get_date_from_gmt($date));
printf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', $formatted_value, sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp'))), get_date_from_gmt($date));
} else {
_e('None', 'wp-ultimo');
} // end if;
} else {
?>
_e('None', 'wp-ultimo');
<?php else : ?>
} // end if;
<span class="wu-my-1 wu-inline-block">
?>
<span id="<?php echo $field->id; ?>_value"><?php echo $field->display_value; ?></span>
<?php else : ?>
<?php if ($field->copy) : ?>
<span class="wu-my-1 wu-inline-block">
<a <?php echo wu_tooltip_text(__('Copy', 'wp-ultimo')); ?> class="wu-no-underline wp-ui-text-highlight wu-copy" data-clipboard-action="copy" data-clipboard-target="#<?php echo $field->id; ?>_value">
<span id="<?php echo $field->id; ?>_value"><?php echo $field->display_value; ?></span>
<span class="dashicons-wu-copy wu-align-middle"></span>
<?php if ($field->copy) : ?>
</a>
<a <?php echo wu_tooltip_text(__('Copy', 'wp-ultimo')); ?> class="wu-no-underline wp-ui-text-highlight wu-copy" data-clipboard-action="copy" data-clipboard-target="#<?php echo $field->id; ?>_value">
<?php endif; ?>
<span class="dashicons-wu-copy wu-align-middle"></span>
</span>
</a>
<?php endif; ?>
<?php endif; ?>
<?php
</span>
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
<?php endif; ?>
?>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</div>
</li>

View File

@ -7,112 +7,116 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" data-wu-app="<?php echo esc_attr($field->id); ?>" data-state='{"edit":false}'>
<div class="wu-block" v-show="!edit">
<div class="wu-block" v-show="!edit">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->type === 'date' || $field->date === true) : ?>
<?php if ($field->type === 'date' || $field->date === true) : ?>
<?php
<?php
if (wu_validate_date($field->value)) {
if (wu_validate_date($field->value)) {
if ($field->display_value == false) {
echo __('No date', 'wp-ultimo');
} else {
$date = $field->value;
if ($field->display_value == false) {
$time = strtotime(get_date_from_gmt($date));
echo __('No date', 'wp-ultimo');
$formatted_value = date_i18n(get_option('date_format'), $time);
} else {
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-ultimo') : __('In %s', 'wp-ultimo'); // phpcs:ignore
$date = $field->value;
printf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', $formatted_value, sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp'))), get_date_from_gmt($date));
} // end if;
} else {
_e('None', 'wp-ultimo');
} // end if;
$time = strtotime(get_date_from_gmt($date));
?>
$formatted_value = date_i18n(get_option('date_format'), $time);
<?php else : ?>
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-ultimo') : __('In %s', 'wp-ultimo'); // phpcs:ignore
<span class="wu-my-1 wu-inline-block">
echo sprintf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', $formatted_value, sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp'))), get_date_from_gmt($date));
<?php echo $field->display_value; ?>
} // end if;
</span>
} else {
<?php endif; ?>
_e('None', 'wp-ultimo');
</div>
} // end if;
<?php if ($field->edit) : ?>
?>
<div class="wu-block" v-show="!edit">
<a href="#" class="wu-p-2 wu--m-2 wp-ui-text-highlight" v-on:click="open($event)" data-field="<?php echo esc_attr($field_slug); ?>">
<?php echo wu_tooltip(__('Edit'), 'dashicons-edit'); ?>
</a>
</div>
<?php else : ?>
<div v-cloak class="wu-block wu-w-full" v-show="edit">
<span class="wu-my-1 wu-inline-block">
<?php
<?php echo $field->display_value; ?>
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
</span>
?>
<?php endif; ?>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="text" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
</div>
<?php
<?php if ($field->edit) : ?>
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
<div class="wu-block" v-show="!edit">
<a href="#" class="wu-p-2 wu--m-2 wp-ui-text-highlight" v-on:click="open($event)" data-field="<?php echo esc_attr($field_slug); ?>">
<?php echo wu_tooltip(__('Edit'), 'dashicons-edit'); ?>
</a>
</div>
?>
<div v-cloak class="wu-block wu-w-full" v-show="edit">
</div>
<?php
<?php endif; ?>
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
<?php if ($field->copy) : ?>
?>
<div class="wu-block" v-show="!edit">
<a href="#" class="wu-p-2 wu--m-2" v-on:click="edit($event, '<?php echo esc_js($field_slug); ?>')" data-field="<?php echo esc_attr($field_slug); ?>">
<?php echo wu_tooltip(__('Copy'), 'dashicons-admin-page'); ?>
</a>
</div>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="text" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
<?php endif; ?>
<?php if ($field->copy) : ?>
<div class="wu-block" v-show="!edit">
<a href="#" class="wu-p-2 wu--m-2" v-on:click="edit($event, '<?php echo esc_js($field_slug); ?>')" data-field="<?php echo esc_attr($field_slug); ?>">
<?php echo wu_tooltip(__('Copy'), 'dashicons-admin-page'); ?>
</a>
</div>
<?php endif; ?>
<?php endif; ?>
</li>

View File

@ -7,70 +7,78 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->type === 'model') : ?>
<?php if ($field->type === 'model') : ?>
<div class="wu-flex">
<div class="wu-flex">
<div class="wu-w-full wu-my-1">
<input class="form-control wu-w-full" name="<?php echo esc_attr($field->id); ?>" type="text" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
</div>
<div class="wu-w-full wu-my-1">
<input class="form-control wu-w-full" name="<?php echo esc_attr($field->id); ?>" type="text" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
</div>
<?php if (wu_get_isset($field->html_attr, 'data-base-link')) : ?>
<?php if (wu_get_isset($field->html_attr, 'data-base-link')) : ?>
<div class="wu-ml-1 wu-my-1" v-cloak>
<a
v-bind:href="'<?php echo wu_get_isset($field->html_attr, 'data-base-link'); ?>' + '=' + <?php echo wu_get_isset($field->html_attr, 'v-model'); ?>"
target="_blank"
class="button"
v-show='<?php echo wu_get_isset($field->html_attr, 'v-model'); ?>'
<?php echo wu_tooltip_text(__('View', 'wp-ultimo')); ?>
>
<span class="dashicons-wu-popup wu-m-0 wu-p-0"></span>
</a>
</div>
<div class="wu-ml-1 wu-my-1" v-cloak>
<a
v-bind:href="'<?php echo wu_get_isset($field->html_attr, 'data-base-link'); ?>' + '=' + <?php echo wu_get_isset($field->html_attr, 'v-model'); ?>"
target="_blank"
class="button"
v-show='<?php echo wu_get_isset($field->html_attr, 'v-model'); ?>'
<?php echo wu_tooltip_text(__('View', 'wp-ultimo')); ?>
>
<span class="dashicons-wu-popup wu-m-0 wu-p-0"></span>
</a>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<?php elseif ($field->money) : ?>
<?php elseif ($field->money) : ?>
<money class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>></money>
<money class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>></money>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?> v-if="false">
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?> v-if="false">
<?php else : ?>
<?php else : ?>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full wu-my-1" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php endif; ?>
<?php endif; ?>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</li>

View File

@ -7,34 +7,42 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<textarea class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" name="<?php echo esc_attr($field->id); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" <?php echo $field->get_html_attributes(); ?>><?php echo esc_attr($field->value); ?></textarea>
<textarea class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" name="<?php echo esc_attr($field->id); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" <?php echo $field->get_html_attributes(); ?>><?php echo esc_attr($field->value); ?></textarea>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</li>

View File

@ -7,38 +7,42 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block">
<div class="wu-block">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->desc) : ?>
<?php if ($field->desc) : ?>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; ?></span>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; ?></span>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<div class="wu-block wu-ml-2">
<div class="wu-block wu-ml-2">
<div class="wu-toggle">
<div class="wu-toggle">
<input class="wu-tgl wu-tgl-ios" value="1" <?php checked($field->value == 1); ?> id="wu-tg-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field_slug); ?>" <?php echo $field->get_html_attributes(); ?> />
<input class="wu-tgl wu-tgl-ios" value="1" <?php checked($field->value == 1); ?> id="wu-tg-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field_slug); ?>" <?php echo $field->get_html_attributes(); ?> />
<label class="wu-tgl-btn wp-ui-highlight wu-bg-blue-500" for="wu-tg-<?php echo esc_attr($field->id); ?>"></label>
<label class="wu-tgl-btn wp-ui-highlight wu-bg-blue-500" for="wu-tg-<?php echo esc_attr($field->id); ?>"></label>
</div>
</div>
</div>
</div>
</li>

View File

@ -15,11 +15,15 @@
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
@ -42,11 +46,15 @@
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
?>

View File

@ -7,35 +7,35 @@
?>
<div class="wu-styling">
<?php echo $form->before; ?>
<?php echo $form->before; ?>
<div class="wu-flex wu-flex-wrap">
<div class="wu-flex wu-flex-wrap">
<?php if ($form->wrap_in_form_tag) : ?>
<?php if ($form->wrap_in_form_tag) : ?>
<form
id="<?php echo esc_attr($form_slug); ?>"
action="<?php echo esc_attr($form->action); ?>"
method="<?php echo esc_attr($form->method); ?>"
<?php echo $form->get_html_attributes(); ?>
>
<form
id="<?php echo esc_attr($form_slug); ?>"
action="<?php echo esc_attr($form->action); ?>"
method="<?php echo esc_attr($form->method); ?>"
<?php echo $form->get_html_attributes(); ?>
>
<?php endif; ?>
<?php endif; ?>
<ul id="wp-ultimo-form-<?php echo esc_attr($form->id); ?>" class="wu-flex-grow <?php echo esc_attr(trim($form->classes)); ?>" <?php echo $form->get_html_attributes(); ?>>
<ul id="wp-ultimo-form-<?php echo esc_attr($form->id); ?>" class="wu-flex-grow <?php echo esc_attr(trim($form->classes)); ?>" <?php echo $form->get_html_attributes(); ?>>
<?php echo $rendered_fields; ?>
<?php echo $rendered_fields; ?>
</ul>
</ul>
<?php if ($form->wrap_in_form_tag) : ?>
<?php if ($form->wrap_in_form_tag) : ?>
</form>
</form>
<?php endif; ?>
<?php endif; ?>
<?php echo $form->after; ?>
<?php echo $form->after; ?>
</div>
</div>
</div>

View File

@ -8,10 +8,10 @@
<?php if ($field->desc) : ?>
<p class="description wu-text-2xs" id="<?php echo $field->id; ?>-desc">
<p class="description wu-text-2xs" id="<?php echo $field->id; ?>-desc">
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</p>
</p>
<?php endif; ?>

View File

@ -8,16 +8,16 @@
<?php if ($field->title && is_string($field->title)) : ?>
<span class="wu-my-1 wu-text-2xs wu-uppercase wu-font-bold wu-block">
<span class="wu-my-1 wu-text-2xs wu-uppercase wu-font-bold wu-block">
<?php echo $field->title; ?>
<?php echo $field->title; ?>
<?php if ($field->tooltip) : ?>
<?php if ($field->tooltip) : ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php endif; ?>
<?php endif; ?>
</span>
</span>
<?php endif; ?>