Initial Commit

This commit is contained in:
David Stone
2024-11-30 18:24:12 -07:00
commit e8f7955c1c
5432 changed files with 1397750 additions and 0 deletions

View File

@ -0,0 +1,38 @@
<?php
/**
* Actions field view.
*
* @since 2.0.0
*/
?>
<li class="wu-bg-gray-100 <?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php foreach ($field->actions as $action_slug => $action) : ?>
<span class="wu-flex wu-flex-wrap wu-content-center">
<?php $action = new \WP_Ultimo\UI\Field($action_slug, $action); ?>
<button class="button <?php echo esc_attr($action->classes); ?>" id="action_button" data-action="<?php echo $action->action; ?>" data-object="<?php echo $action->object_id; ?>" value="<?php echo wp_create_nonce($action->action); ?>" <?php echo $field->get_html_attributes(); ?> >
<?php echo $action->title; ?>
<?php if ($action->tooltip) : ?>
<?php echo wu_tooltip($action->tooltip); ?>
<?php endif; ?>
</button>
<span data-loading="wu_action_button_loading_<?php echo $action->object_id; ?>" id="wu_action_button_loading" class="wu-blinking-animation wu-text-gray-600 wu-my-1 wu-text-2xs wu-uppercase wu-font-semibold wu-text-center wu-self-center wu-px-4 wu-py wu-mt-1 hidden" >
<?php echo $action->loading_text; ?>
</span>
</span>
<?php endforeach; ?>
</li>

View File

@ -0,0 +1,40 @@
<?php
/**
* Code editor field view.
*
* @since 2.0.0
*/
?>
<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
/**
* 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>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</li>

View File

@ -0,0 +1,44 @@
<?php
/**
* Color picker field view.
*
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block">
<?php
/**
* 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">
<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>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</li>

View File

@ -0,0 +1,64 @@
<?php
/**
* Select Dashicon field view.
*
* @since 2.0.0
*/
?>
<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
/**
* 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); ?>">
<option value=""><?php echo __('No Icon','wp-ultimo'); ?></option>
<?php foreach (wu_get_icons_list() as $category_label => $category_array) : ?>
<optgroup label="<?php echo $category_label; ?>">
<?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>
<?php endforeach; ?>
</optgroup>
<?php endforeach; ?>
</select>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</li>

View File

@ -0,0 +1,53 @@
<?php
/**
* Group field view.
*
* @since 2.0.0
*/
?>
<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); ?>">
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
?>
<?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',
));
$form->render();
?>
<?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">
<?php echo $field->desc; ?>
</div>
<?php endif; ?>
</div>
</li>

View File

@ -0,0 +1,36 @@
<?php
/**
* Header field view.
*
* @since 2.0.0
*/
?>
<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">
<h3 class="wu-my-1 wu-text-base wu-text-gray-800">
<?php echo $field->title; ?>
<?php if ($field->tooltip) : ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php endif; ?>
</h3>
<?php if ($field->desc) : ?>
<p class="wu-mt-1 wu-mb-0 wu-text-gray-700">
<?php echo $field->desc; ?>
</p>
<?php endif; ?>
</div>
</li>

View File

@ -0,0 +1,12 @@
<?php
/**
* Hidden field view.
*
* @since 2.0.0
*/
?>
<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(); ?>>
</li>

View File

@ -0,0 +1,41 @@
<?php
/**
* HTML field view.
*
* @since 2.0.0
*/
?>
<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
/**
* 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,
));
?>
<div class="wu-block wu-w-full wu-mt-4 <?php echo esc_attr($field->classes); ?>">
<?php echo $field->content; ?>
</div>
</div>
</li>

View File

@ -0,0 +1,110 @@
<?php
/**
* Image field view.
*
* @since 2.0.0
*/
/**
* Set the media query.
*
* When the stacked option is present
* and set to true, ignore the flex arrangement
* and make elements stacked.
*/
$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";
?>
<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-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,
));
?>
<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,
));
?>
</div>
</div>
<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-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 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">
<span class="dashicons-wu-eye1 wu-align-middle" style="top: -2px;"></span>
</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">
<span class="dashicons-wu-cross wu-align-middle"></span>
</a>
</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(); ?> />
<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">
<span class="dashicons-wu-upload"></span> <?php _e('Upload Image', 'wp-ultimo'); ?>
</a>
</div>
</div>
</div>
</div>
</li>

View File

@ -0,0 +1,44 @@
<?php
/**
* Link field view.
*
* @since 2.0.0
*/
?>
<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
/**
* 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(); ?>>
<?php echo $field->display_value; ?>
</a>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</li>

View File

@ -0,0 +1,85 @@
<?php
/**
* Multi-select field view.
*
* @since 2.0.0
*/
?>
<li
class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>"
<?php echo $field->get_wrapper_html_attributes(); ?>
>
<div class="wu-w-full">
<?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-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'>
<?php foreach ($field->options as $value => $option) : ?>
<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">
<span class="wu-block">
<span class="wu-my-1 wu-text-xs wu-font-bold wu-block">
<?php echo $option['title']; ?>
</span>
<?php if (isset($option['desc']) && !empty($option['desc'])) : ?>
<span class="wu-my-1 wu-inline-block wu-text-xs">
<?php echo $option['desc']; ?>
</span>
<?php endif; ?>
</span>
<span class="wu-block wu-ml-2">
<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(); ?>>
<label for="<?php echo esc_attr("{$field->id}_{$value}"); ?>" class="wu-tgl-btn wp-ui-highlight"></label>
</div>
</span>
</div>
</li>
<?php endforeach; ?>
</ul>
</div>
</li>

View File

@ -0,0 +1,28 @@
<?php
/**
* Note field view.
*
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
/**
* 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); ?>">
<?php echo $field->desc; ?>
</div>
</li>

View File

@ -0,0 +1,141 @@
<?php
/**
* Repeater field view.
*
* @since 2.0.0
*/
?>
<?php if ($field->title) : ?>
<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">
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
?>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</li>
<?php endif; ?>
<?php
if (!$field->values && $field->value) {
$_values = array();
$columns = array_keys($field->value);
$values = $field->value;
foreach ($columns as $column) {
$count = count(array_pop($field->value));
for ($i = 0; $i < $count; $i++) {
$_values[$i][$column] = $field->value[$column][$i];
} // end if;
} // end if;
$field->values = $_values;
} // end if;
$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 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>
</li>

View File

@ -0,0 +1,75 @@
<?php
/**
* Select icon field view.
*
* @since 2.0.0
*/
?>
<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
/**
* 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,
));
?>
<div class="wu-flex wu-flex-wrap wu--mx-2 wu-mt-2">
<?php foreach ($field->options as $option_value => $option) : ?>
<?php
/*
* 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;">
<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']); ?>>
<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(); ?>>
<span class="wu-uppercase wu-text-2xs wu-font-semibold">
<?php echo $option['title']; ?>
</span>
</div>
</label>
</div>
<?php endforeach; ?>
</div>
</div>
</li>

View File

@ -0,0 +1,58 @@
<?php
/**
* Select field view.
*
* @since 2.0.0
*/
?>
<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
/**
* 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; ?>">
<?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); ?>">
<?php echo $option_label; ?>
</option>
<?php endforeach; ?>
<?php if ($field->options_template) : ?>
<?php echo $field->options_template; ?>
<?php endif; ?>
</select>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</li>

View File

@ -0,0 +1,32 @@
<?php
/**
* Small header field view.
*
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block">
<?php
/**
* 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) : ?>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; ?></span>
<?php endif; ?>
</div>
</li>

View File

@ -0,0 +1,16 @@
<?php
/**
* Submit field view.
*
* @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(); ?>>
<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; ?>
</button>
</li>

View File

@ -0,0 +1,29 @@
<?php
/**
* Tab select field view.
*
* @since 2.0.0
*/
?>
<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">
<?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' : ''"
>
<?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(); ?>>
</label>
<?php endforeach; ?>
</div>
</li>

View File

@ -0,0 +1,82 @@
<?php
/**
* Text display field view.
*
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block">
<?php
/**
* 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 (wu_validate_date($field->value)) {
$date = $field->value;
$time = strtotime(get_date_from_gmt($date));
$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));
} else {
_e('None', 'wp-ultimo');
} // end if;
?>
<?php else : ?>
<span class="wu-my-1 wu-inline-block">
<span id="<?php echo $field->id; ?>_value"><?php echo $field->display_value; ?></span>
<?php if ($field->copy) : ?>
<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 class="dashicons-wu-copy wu-align-middle"></span>
</a>
<?php endif; ?>
</span>
<?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>
</li>

View File

@ -0,0 +1,118 @@
<?php
/**
* Text edit field view.
*
* @since 2.0.0
*/
?>
<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">
<?php
/**
* 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 (wu_validate_date($field->value)) {
if ($field->display_value == false) {
echo __('No date', 'wp-ultimo');
} else {
$date = $field->value;
$time = strtotime(get_date_from_gmt($date));
$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));
} // end if;
} else {
_e('None', 'wp-ultimo');
} // end if;
?>
<?php else : ?>
<span class="wu-my-1 wu-inline-block">
<?php echo $field->display_value; ?>
</span>
<?php endif; ?>
</div>
<?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>
<div v-cloak class="wu-block wu-w-full" v-show="edit">
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
?>
<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; ?>
</li>

View File

@ -0,0 +1,76 @@
<?php
/**
* Text field view.
*
* @since 2.0.0
*/
?>
<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
/**
* 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') : ?>
<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>
<?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>
<?php endif; ?>
</div>
<?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>
<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 : ?>
<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
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</li>

View File

@ -0,0 +1,40 @@
<?php
/**
* Textarea field view.
*
* @since 2.0.0
*/
?>
<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
/**
* 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>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</li>

View File

@ -0,0 +1,44 @@
<?php
/**
* Toggle field view.
*
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block">
<?php
/**
* 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) : ?>
<span class="wu-my-1 wu-inline-block wu-text-xs"><?php echo $field->desc; ?></span>
<?php endif; ?>
</div>
<div class="wu-block wu-ml-2">
<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(); ?> />
<label class="wu-tgl-btn wp-ui-highlight wu-bg-blue-500" for="wu-tg-<?php echo esc_attr($field->id); ?>"></label>
</div>
</div>
</li>

View File

@ -0,0 +1,57 @@
<?php
/**
* WP editor field view.
*
* @since 2.0.0
*/
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<label for="<?php echo esc_attr($field->id); ?>">
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
?>
</label>
<div class="wu-my-1">
<wp-editor
name="<?php echo esc_attr($field->id); ?>"
id="<?php echo esc_attr($field->id); ?>"
value="<?php echo esc_html($field->value); ?>"
<?php echo $field->get_html_attributes(); ?>
/>
</div>
<div>
<?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

@ -0,0 +1,41 @@
<?php
/**
* Form view.
*
* @since 2.0.0
*/
?>
<div class="wu-styling">
<?php echo $form->before; ?>
<div class="wu-flex wu-flex-wrap">
<?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(); ?>
>
<?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(); ?>>
<?php echo $rendered_fields; ?>
</ul>
<?php if ($form->wrap_in_form_tag) : ?>
</form>
<?php endif; ?>
<?php echo $form->after; ?>
</div>
</div>

View File

@ -0,0 +1,17 @@
<?php
/**
* Description field partial view.
*
* @since 2.0.0
*/
?>
<?php if ($field->desc) : ?>
<p class="description wu-text-2xs" id="<?php echo $field->id; ?>-desc">
<?php echo $field->desc; ?>
</p>
<?php endif; ?>

View File

@ -0,0 +1,23 @@
<?php
/**
* Title field partial view.
*
* @since 2.0.0
*/
?>
<?php if ($field->title && is_string($field->title)) : ?>
<span class="wu-my-1 wu-text-2xs wu-uppercase wu-font-bold wu-block">
<?php echo $field->title; ?>
<?php if ($field->tooltip) : ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php endif; ?>
</span>
<?php endif; ?>