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

205
views/about.php Normal file
View File

@ -0,0 +1,205 @@
<?php
/**
* About view.
*
* @since 2.0.0
*/
?>
<style>
.wu-about-content a {
text-decoration: none;
font-weight: 500;
color: #333;
}
.wu-about-content a::after {
content: "↖︎";
transform: scale(-0.7, 0.7);
display: inline-block;
}
</style>
<a class="wu-fixed wu-inline-block wu-bottom-0 wu-left-1/2 wu-transform wu--translate-x-1/2 wu-bg-white wu-p-4 wu-rounded-full wu-shadow wu-m-4 wu-no-underline wu-z-10 wu-border-gray-300 wu-border-solid wu-border" href="<?php echo esc_attr(network_admin_url()); ?>">
<?php _e('&larr; Back to the Dashboard', 'wp-ultimo'); ?>
</a>
<div id="wp-ultimo-wrap" class="wrap wu-about-content">
<div style="max-width: 730px;" class="wu-max-w-screen-md wu-mx-auto wu-my-10 wu-p-12 wu-bg-white wu-shadow wu-text-justify">
<p class="wu-text-lg wu-leading-relaxed">
A new release strategy
</p>
<h1 class="wu-text-3xl">
Here's <span class="wu-font-bold">Erasmo</span>:<br>
WP Ultimo version 2.3.0
</h1>
<p class="wu-text-lg wu-leading-relaxed">
Hi guys!
</p>
<p class="wu-text-lg wu-leading-relaxed">
With WP Ultimo 2.3.0 we start a new streamlined approach of releases, focusing on a central feature in minors and rolling out fixes as soon as they are ready in patches. Less time waiting and leaner versions.
</p>
<p class="wu-text-lg wu-leading-relaxed">
This way we intend to avoid a significant gap in time between updates and an extensive scope of changes and fixes, all bundled into one massive release.
</p>
<p class="wu-text-lg wu-leading-relaxed">
This version focuses on allowing custom meta fields for customers in the admin area. This tool lets you collect additional information from your users. The potential for automation and WP Ultimo customizations is now expanded, as these fields may help tailor and streamline your operations.
</p>
<p class="wu-text-lg wu-leading-relaxed">
We also added a bunch of improvements and fixes that go from more translated strings for Spanish, Brazilian Portuguese, and French, to better PHP 8.2 compatibility, to webhook triggering.
</p>
<div class="wu-inline-block wu-float-right wu-ml-8 wu-mb-4">
<img class="wu-block wu-rounded" src="<?php echo wu_get_asset('erasmo-carlos.jpg'); ?>" width="200">
<small class="wu-block wu-mt-1">Gilberto Gil</small>
</div>
<p class="wu-text-lg wu-leading-relaxed">
This version is called Erasmo in honor of the Brazilian singer and songwriter
<a href="https://en.wikipedia.org/wiki/Erasmo_Carlos" target="_blank">
Erasmo Carlos
</a>
, who left us in 2022, at the age of 81.
</p>
<p class="wu-text-lg wu-leading-relaxed">
Erasmo was one of the faces of Jovem Guarda, a Brazilian musical TV show aired during the 1960s. The show was highly influenced by American rockn roll and the British Invasion of rock bands of that decade.
</p>
<p class="wu-text-lg wu-leading-relaxed">
Erasmo's songs are about love, friendship, ecology, and many other subjects distributed along more than two dozen albums. Here, you can listen to one of his classic songs
<a href="https://www.youtube.com/watch?v=ICnivS25bDc" target="_blank">Minha fama de mau</a>.
If youre feeling more romantic, go for this version of
<a href="https://www.youtube.com/watch?v=I5KJyKsLNGk" target="_blank">Do fundo do meu coração</a>,
with Adriana Calcanhoto. And dont forget to check out this
<a href="https://open.spotify.com/playlist/37i9dQZF1DZ06evO3F0tyd?si=6bb306446698495f" target="_blank">awesome playlist</a>.
</p>
<p class="wu-text-lg wu-leading-relaxed">
As always, let me know if you have any questions.
</p>
<p class="wu-text-lg wu-leading-relaxed wu-mb-8">
Yours truly,
</p>
<p class="wu-text-lg wu-leading-relaxed wu-mb-0">
<?php echo get_avatar('arindo@wpultimo.com', 64, '', 'Arindo Duque', [
'class' => 'wu-rounded-full',
]); ?>
<strong class="wu-block">Arindo Duque</strong>
<small class="wu-block">Founder and CEO of NextPress, the makers of WP Ultimo</small>
</p>
</div>
<div style="max-width: 700px;" class="wu-max-w-screen-md wu-mx-auto wu-mb-10">
<hr class="hr-text wu-my-4 wu-text-gray-800" data-content="THIS VERSION WAS CRAFTED WITH LOVE BY">
<?php
$key_people = [
'arindo' => [
'email' => 'arindo@wpultimo.com',
'signature' => 'arindo.png',
'name' => 'Arindo Duque',
'position' => 'Founder and CEO',
],
'allyson' => [
'email' => 'allyson@wpultimo.com',
'signature' => '',
'name' => 'Allyson Souza',
'position' => 'Developer',
],
'anyssa' => [
'email' => 'anyssa@wpultimo.com',
'signature' => '',
'name' => 'Anyssa Ferreira',
'position' => 'Designer',
],
'gustavo' => [
'email' => 'gustavo@wpultimo.com',
'signature' => '',
'name' => 'Gustavo Modesto',
'position' => 'Developer',
],
'juliana' => [
'email' => 'juliana@wpultimo.com',
'signature' => '',
'name' => 'Juliana Dias Gomes',
'position' => 'Do-it-all',
],
'lucas-carvalho' => [
'email' => 'lucas@wpultimo.com',
'signature' => '',
'name' => 'Lucas Carvalho',
'position' => 'Developer',
],
'yan' => [
'email' => 'yan@wpultimo.com',
'signature' => '',
'name' => 'Yan Kairalla',
'position' => 'Developer',
],
];
?>
<div class="wu-flex wu-flex-wrap wu-mt-8">
<?php foreach ($key_people as $person) { ?>
<div class="wu-text-center wu-w-1/4 wu-mb-5">
<?php
echo get_avatar($person['email'], 64, '', 'Arindo Duque', [
'class' => 'wu-rounded-full',
]);
?>
<strong class="wu-text-base wu-block"><?php echo $person['name']; ?></strong>
<small class="wu-text-xs wu-block"><?php echo $person['position']; ?></small>
</div>
<?php } ?>
</div>
</div>
</div>
<style>
.hr-text {
line-height: 1em;
position: relative;
outline: 0;
border: 0;
/* color: black; */
text-align: center;
height: 1.5em;
opacity: .5;
}
.hr-text:before {
content: '';
background: -webkit-gradient(linear, left top, right top, from(transparent), color-stop(#818078), to(transparent));
background: linear-gradient(to right, transparent, #818078, transparent);
position: absolute;
left: 0;
top: 50%;
width: 100%;
height: 1px;
}
.hr-text:after {
content: attr(data-content);
position: relative;
display: inline-block;
/* color: black; */
padding: 0 .5em;
line-height: 1.5em;
color: #818078;
background-color: #eef2f5;
}
</style>

54
views/admin-notices.php Normal file
View File

@ -0,0 +1,54 @@
<?php
/**
* Displays the Admin Notices on the admin panels (network, sub-sites, and user)
*
* @package WP_Ultimo/Views
* @subpackage Admin_Notices
* @since 2.0.0
*/
foreach ($notices as $key => $notice) : ?>
<div class="notice wu-hidden wu-admin-notice wu-styling hover:wu-styling notice-<?php echo esc_attr($notice['type']); ?> <?php echo $notice['dismissible_key'] ? esc_attr('is-dismissible') : ''; ?>">
<?php if (strpos($notice['message'], '<p>') !== false) : ?>
<?php echo $notice['message']; ?>
<?php else : ?>
<p class="wu-py-2"><?php echo $notice['message']; // phpcs:ignore ?></p>
<?php endif; ?>
<?php if (isset($notice['actions']) && !empty($notice['actions'])) : ?>
<div class="wu-border wu-border-solid wu-border-gray-300 wu-border-r-0 wu-border-l-0 wu-border-b-0 wu-bg-gray-100 wu--ml-2 wu--mb-1 wu--mr-2 sm:wu--mr-7.5 sm:wu--ml-3 sm:wu--mb-px">
<ul class="wu-text-right wu-p-0 wu-m-0 wu-flex wu-justify-end">
<?php foreach ($notice['actions'] as $action) : ?>
<li class="wu-inline-block wu-p-0 wu-m-0 wu-flex-shrink">
<a class="wu-bg-white wu-uppercase wu-no-underline wu-font-bold wu-text-gray-600 hover:wu-text-gray-700 wu-text-xs wu-inline-block wu-px-4 wu-py-2 wu-border wu-border-solid wu-border-gray-300 wu-border-r-0 wu-border-t-0 wu-border-b-0 wu-transition-all wu-mr-px" title="<?php echo esc_attr($action['title']); ?>" href="<?php echo esc_attr($action['url']); ?>"><?php echo $action['title']; ?></a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php if (isset($notice['dismissible_key']) && $notice['dismissible_key']) : ?>
<input type='hidden' name='notice_id' value='<?php echo esc_attr($notice['dismissible_key']); ?>'>
<input type='hidden' name='nonce' value='<?php echo esc_attr($nonce); ?>'>
<?php endif; ?>
</div>
<?php endforeach; ?>

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; ?>

375
views/base/addons.php Normal file
View File

@ -0,0 +1,375 @@
<?php
/**
* Add-ons list page.
*
* @since 2.0.0
*/
?>
<style>
body .theme-browser .theme .theme-name {
height: auto;
}
</style>
<div id="wp-ultimo-wrap" class="<?php wu_wrap_use_container() ?> wrap wu-wrap <?php echo esc_attr($classes); ?>">
<h1 class="wp-heading-inline">
<?php echo $page->get_title(); ?> <span v-cloak v-if="count > 0" class="title-count theme-count" v-text="count"></span>
<?php
/**
* You can filter the get_title_link using wu_page_list_get_title_link, see class-wu-page-list.php
*
* @since 1.8.2
*/
foreach ($page->get_title_links() as $action_link) :
$action_classes = isset($action_link['classes']) ? $action_link['classes'] : '';
?>
<a title="<?php echo esc_attr($action_link['label']); ?>" href="<?php echo esc_url($action_link['url']); ?>" class="page-title-action <?php echo esc_attr($action_classes); ?>">
<?php if ($action_link['icon']) : ?>
<span class="dashicons dashicons-<?php echo esc_attr($action_link['icon']); ?> wu-text-sm wu-align-middle wu-h-4 wu-w-4">
&nbsp;
</span>
<?php endif; ?>
<?php echo $action_link['label']; ?>
</a>
<?php endforeach; ?>
<?php
/**
* Allow plugin developers to add additional buttons to list pages
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_addon_after_title', $page);
?>
</h1>
<?php if (wu_request('updated')) : ?>
<div id="message" class="updated notice wu-admin-notice notice-success is-dismissible below-h2">
<p><?php _e('Settings successfully saved.', 'wp-ultimo') ?></p>
</div>
<?php endif; ?>
<hr class="wp-header-end">
<form method="post">
<div id="poststuff" class="md:wu-flex">
<div class="wu-w-full md:wu-w-4/12 lg:wu-w-2/12">
<div class="wu-py-4 wu-relative" id="search-addons">
<input
type="text"
placeholder="<?php esc_attr_e('Search Add-ons', 'wp-ultimo'); ?>"
class="wu-w-full"
v-model="search"
>
</div>
<!-- Navigator -->
<ul id="addons-menu">
<li class="md:wu-hidden wu-p-4 wu-font-bold wu-uppercase wu-text-xs wu-text-gray-700">
<?php _e('Menu', 'wp-ultimo'); ?>
</li>
<?php
/**
* We need to set a couple of flags in here to control clickable navigation elements.
* This flag makes sure only steps the user already went through are clickable.
*/
$is_pre_current_section = true;
?>
<?php foreach ($sections as $section_name => $section) : ?>
<?php
/**
* Updates the flag after the current section is looped.
*/
if ($current_section === $section_name) {
$is_pre_current_section = false;
} // end if;
?>
<?php if (wu_get_isset($section, 'separator')) : ?>
<!-- Separator Item -->
<li class="wu-sticky wu-py-2 wu-px-4">&nbsp;</li>
<?php else : ?>
<!-- Menu Item -->
<li class="wu-sticky">
<!-- Menu Link -->
<a
href="<?php echo esc_url($page->get_section_link($section_name)); ?>"
class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-sm wu-rounded wu-text-gray-600 hover:wu-text-gray-700"
:class="category === '<?php echo esc_attr($section_name); ?>' ? 'wu-bg-gray-300 wu-text-gray-800' : 'wu-text-gray-600 hover:wu-text-gray-700'"
@click.prevent="set_category('<?php echo esc_attr($section_name); ?>')"
>
<span class="<?php echo esc_attr($section['icon']); ?> wu-align-text-bottom wu-mr-1"></span>
<?php echo $section['title']; ?>
</a>
<!-- End Menu Link -->
<?php if (!empty($section['sub-sections'])) : ?>
<!-- Sub-menu -->
<ul class="classes" v-show="false" v-cloak>
<?php foreach ($section['sub-sections'] as $sub_section_name => $sub_section) : ?>
<li class="classes">
<a href="<?php echo esc_url($page->get_section_link($section_name)."#".$sub_section_name); ?>" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-gray-500 hover:wu-text-gray-600 wu-text-sm">
&rarr; <?php echo $sub_section['title']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<!-- End Sub-menu -->
<?php endif; ?>
</li>
<!-- End Menu Item -->
<?php endif; ?>
<?php endforeach; ?>
</ul>
<!-- End Navigator -->
<div class="wu-mt-10 wu-p-4">
<div>
<span class="wu-bg-orange-600 wu-text-gray-100 wu-text-xs wu-inline-block wu-rounded wu-py-1 wu-px-2 wu-font-bold wu-uppercase wu-opacity-50">
<?php _e('Beta', 'wp-ultimo'); ?>
</span>
<span class="wu-block wu-mt-2 wu-text-xs wu-text-gray-600"><?php _e('Ready for testing, but not necessarily production-ready.', 'wp-ultimo'); ?></span>
</div>
<div class="wu-mt-4">
<span class="wu-bg-gray-800 wu-text-gray-200 wu-text-xs wu-inline-block wu-rounded wu-py-1 wu-px-2 wu-font-bold wu-uppercase wu-opacity-50">
<?php _e('Coming Soon', 'wp-ultimo'); ?>
</span>
<span class="wu-block wu-mt-2 wu-text-xs wu-text-gray-600"><?php _e('In active development, but not yet available.', 'wp-ultimo'); ?></span>
</div>
<div class="wu-mt-4">
<span class="wu-bg-purple-800 wu-text-gray-200 wu-text-xs wu-inline-block wu-rounded wu-py-1 wu-px-2 wu-font-bold wu-uppercase wu-opacity-50">
<?php _e('Legacy', 'wp-ultimo'); ?>
</span>
<span class="wu-block wu-mt-2 wu-text-xs wu-text-gray-600"><?php _e('Developed for 1.X, but compatible with 2.X.', 'wp-ultimo'); ?></span>
</div>
</div>
</div>
<div class="wu-w-full md:wu-w-8/12 lg:wu-w-10/12 md:wu-pl-4 metabox-holder">
<div id="wu-addon" class="wu-relative">
<!--
<div class="wp-filter" v-cloak>
<ul class="filter-links">
<li :class="category == 'all' ? '' : 'selector-inactive'">
<a
v-cloak
href="#"
:class="category == 'all' ? 'current wu-font-medium' : ''"
@click.prevent="category = 'all'"
>{{ i18n.all }}</a>
</li>
<li
v-for="_category in categories"
:class="category == _category ? '' : 'selector-inactive'"
>
<a
v-cloak
href="#"
:class="category == _category.toLowerCase() ? 'current wu-font-medium' : ''"
@click.prevent="category = _category.toLowerCase()"
>{{ _category }}</a>
</li>
</ul>
</div> -->
<div class="theme-browser rendered">
<div v-if="loading"
class="">
<?php echo wu_render_empty_state(array(
'message' => __("Loading...", 'wp-ultimo'),
'sub_message' => __('We are fetching the list of WP Ultimo add-ons.', 'wp-ultimo'),
'link_url' => false,
)); ?>
</div>
<div class="themes wp-clearfix wu-grid wu-gap-6 wu-grid-cols-1 sm:wu-grid-cols-2 lg:wu-grid-cols-3">
<div
class="theme wu-col-span-1"
style="width: 100% !important; margin: 0 !important;"
tabindex="0"
v-cloak
v-for="addon in addons_list"
:data-slug="addon.slug"
>
<div class="theme-screenshot wu-bg-gray-100">
<img :class="addon.available ? '' : 'wu-opacity-50'" :src="addon.image_url" :alt="addon.name" />
</div>
<span class="wu-absolute wu-m-6 wu-bg-gray-800 wu-text-gray-200 wu-text-xs wu-inline-block wu-rounded wu-top-0 wu-right-0 wu-py-1 wu-px-2 wu-font-bold wu-uppercase" v-cloak v-if="!addon.available">
<?php _e('Coming Soon', 'wp-ultimo'); ?>
</span>
<span class="wu-absolute wu-m-6 wu-bg-purple-800 wu-text-gray-200 wu-text-xs wu-inline-block wu-rounded wu-top-0 wu-right-0 wu-py-1 wu-px-2 wu-font-bold wu-uppercase" v-cloak v-show="addon.legacy">
<?php _e('Legacy', 'wp-ultimo'); ?>
</span>
<span class="wu-absolute wu-m-6 wu-bg-orange-600 wu-text-gray-100 wu-text-xs wu-inline-block wu-rounded wu-top-0 wu-right-0 wu-py-1 wu-px-2 wu-font-bold wu-uppercase" v-cloak v-show="addon.beta">
<?php _e('Beta', 'wp-ultimo'); ?>
</span>
<a
class="more-details wubox wu-no-underline"
:title="addon.name"
:href="'<?php echo $more_info_url; ?>'.replace('ADDON_SLUG', addon.slug)"
>
<?php _e('Add-on Details', 'wp-ultimo'); ?>
</a>
<div class="theme-author">
<?php _e('By WP Ultimo', 'wp-ultimo'); ?>
</div>
<h2 class="theme-name" :id="addon.slug" :class="addon.available ? '' : 'wu-opacity-50'" >
{{ addon.name }}
<div class="wu-pt-1 wu-block">
<span
v-cloak
class="wu-text-gray-600 wu-font-normal wu-text-xs"
v-if="addon.free"
>
<?php _e('Free Add-on', 'wp-ultimo'); ?>
</span>
<span
v-cloak
class="wu-text-gray-600 wu-font-normal wu-text-xs"
v-else
>
<?php _e('Premium Add-on', 'wp-ultimo'); ?>
</span>
<span
v-cloak
class="wu-ml-2 wu-text-green-600 wu-font-normal wu-text-xs"
v-if="addon.installed"
>
<span class="dashicons-wu-check"></span>
<?php _e('Installed', 'wp-ultimo'); ?>
</span>
</div>
</h2>
</div>
</div>
</div>
<div class="theme-overlay"></div>
<div
v-cloak
v-if="! loading && addons_list.length == 0"
>
<?php echo wu_render_empty_state(array(
'message' => __("No add-ons found...", 'wp-ultimo'),
'sub_message' => __('Check the search terms or navigate between categories to see what add-ons we have available.', 'wp-ultimo'),
'link_label' => __('See all add-ons', 'wp-ultimo'),
'link_url' => remove_query_arg('tab'),
'link_classes' => '',
'link_icon' => 'dashicons-wu-reply',
)); ?>
</div>
</div>
</div>
</div>
<?php
/**
* Allow plugin developers to add scripts to the bottom of the page
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_addon_footer', $page);
?>
</form>
</div>

View File

@ -0,0 +1,712 @@
<?php
/**
* Add-on details modal.
*
* @since 2.0.0
*/
?>
<style type="text/css">
#plugin-information {
position: static;
}
#plugin-information-footer {
height: auto !important;
}
#plugin-information-title.with-banner {
background-position: center;
background-image: url("<?php echo $addon->image_url; ?>");
}
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
#plugin-information-title.with-banner {
background-position: center;
background-image: url("<?php echo $addon->image_url; ?>");
}
}
</style>
<div id="plugin-information">
<div id="plugin-information-scrollable">
<div id="plugin-information-title" class="with-banner">
<div class="vignette"></div>
<h2><?php echo $addon->name; ?></h2>
</div>
<div id="plugin-information-tabs" class="with-banner">
<a name="description" href="#" class="current">
<?php _e('Description', 'wp-ultimo'); ?>
</a>
<!--
<a name="faq" href="#">
<?php _e('FAQ', 'wp-ultimo'); ?>
</a>
<a name="changelog" href="#">
<?php _e('Changelog', 'wp-ultimo'); ?>
</a>
<a name="screenshots" href="#">
<?php _e('Screenshots', 'wp-ultimo'); ?>
</a>
<a name="reviews" href="#">
<?php _e('Reviews', 'wp-ultimo'); ?>
</a>
-->
</div>
<div id="plugin-information-content" class="with-banner">
<div class="fyi">
<ul>
<li>
<strong><?php _e('Author:', 'wp-ultimo'); ?></strong>
<a class="wu-no-underline" href="<?php echo $addon->author_url; ?>" target="_blank">
<?php echo $addon->author; ?>
</a>
</li>
<!-- <li><strong>Version:</strong> 1.6</li>
<li><strong>Last Updated:</strong> 2 months ago</li>
<li>
<strong>Requires WordPress Version:</strong>
4.9 or higher
</li>
<li><strong>Compatible up to:</strong> 5.5.1</li> -->
<?php if (isset($addon->requires_version)) : ?>
<li>
<strong><?php _e('Requires WP Ultimo Version:', 'wp-ultimo'); ?></strong>
<?php echo sprintf(__('%s or higher', 'wp-ultimo'), $addon->requires_version); ?>
</li>
<?php endif; ?>
<li>
<a class="wu-no-underline" target="_blank" href="https://wpultimo.com/addons?addon=<?php echo $addon_slug; ?>">
<?php _e('See on the Oficial Site »', 'wp-ultimo'); ?>
</a>
</li>
</ul>
<!--
<h3>Average Rating</h3>
<div class="star-rating">
<span class="screen-reader-text">5.0 rating based on 890 ratings</span>
<div class="star star-full" aria-hidden="true"></div>
<div class="star star-full" aria-hidden="true"></div>
<div class="star star-full" aria-hidden="true"></div>
<div class="star star-full" aria-hidden="true"></div>
<div class="star star-full" aria-hidden="true"></div>
</div>
<p aria-hidden="true" class="fyi-description">
(based on 890 ratings)
</p>
<h3>Reviews</h3>
<p class="fyi-description">Read all reviews on WordPress.org or write your own!</p>
<div class="counter-container">
<span class="counter-label"> <a href="https://wordpress.org/support/plugin/classic-editor/reviews/?filter=5" target="_blank" aria-label="Reviews with 5 stars: 859. Opens in a new tab.">5 stars</a> </span>
<span class="counter-back">
<span class="counter-bar" style="width: 88.795505617978px;"></span>
</span>
<span class="counter-count" aria-hidden="true">859</span>
</div>
<div class="counter-container">
<span class="counter-label"> <a href="https://wordpress.org/support/plugin/classic-editor/reviews/?filter=4" target="_blank" aria-label="Reviews with 4 stars: 15. Opens in a new tab.">4 stars</a> </span>
<span class="counter-back">
<span class="counter-bar" style="width: 1.5505617977528px;"></span>
</span>
<span class="counter-count" aria-hidden="true">15</span>
</div>
<div class="counter-container">
<span class="counter-label"> <a href="https://wordpress.org/support/plugin/classic-editor/reviews/?filter=3" target="_blank" aria-label="Reviews with 3 stars: 6. Opens in a new tab.">3 stars</a> </span>
<span class="counter-back">
<span class="counter-bar" style="width: 0.62022471910112px;"></span>
</span>
<span class="counter-count" aria-hidden="true">6</span>
</div>
<div class="counter-container">
<span class="counter-label"> <a href="https://wordpress.org/support/plugin/classic-editor/reviews/?filter=2" target="_blank" aria-label="Reviews with 2 stars: 1. Opens in a new tab.">2 stars</a> </span>
<span class="counter-back">
<span class="counter-bar" style="width: 0.10337078651685px;"></span>
</span>
<span class="counter-count" aria-hidden="true">1</span>
</div>
<div class="counter-container">
<span class="counter-label"> <a href="https://wordpress.org/support/plugin/classic-editor/reviews/?filter=1" target="_blank" aria-label="Reviews with 1 star: 9. Opens in a new tab.">1 star</a> </span>
<span class="counter-back">
<span class="counter-bar" style="width: 0.93033707865169px;"></span>
</span>
<span class="counter-count" aria-hidden="true">9</span>
</div>
<h3>Contributors</h3>
<ul class="contributors">
<li>
<a href="https://profiles.wordpress.org/wordpressdotorg" target="_blank">
<img src="https://secure.gravatar.com/avatar/61ee2579b8905e62b4b4045bdc92c11a?s=36&amp;d=monsterid&amp;r=g" width="18" height="18" alt="" />WordPress.org
</a>
</li>
<li>
<a href="https://profiles.wordpress.org/azaozz" target="_blank">
<img src="https://secure.gravatar.com/avatar/4e84843ebff0918d72ade21c6ee7b1e4?s=36&amp;d=monsterid&amp;r=g" width="18" height="18" alt="" />Andrew Ozz
</a>
</li>
<li>
<a href="https://profiles.wordpress.org/melchoyce" target="_blank">
<img src="https://secure.gravatar.com/avatar/9ffb8027a6f8cb090148a2ea8310b64f?s=36&amp;d=monsterid&amp;r=g" width="18" height="18" alt="" />Mel Choyce-Dwan
</a>
</li>
<li>
<a href="https://profiles.wordpress.org/chanthaboune" target="_blank">
<img src="https://secure.gravatar.com/avatar/da526066c9f187ca1e16263158d2e9a3?s=36&amp;d=monsterid&amp;r=g" width="18" height="18" alt="" />Josepha
</a>
</li>
<li>
<a href="https://profiles.wordpress.org/alexislloyd" target="_blank">
<img src="https://secure.gravatar.com/avatar/41261ee7861fe1331bf1cd32bb24f4ea?s=36&amp;d=monsterid&amp;r=g" width="18" height="18" alt="" />Alexis Lloyd
</a>
</li>
<li>
<a href="https://profiles.wordpress.org/pento" target="_blank">
<img src="https://secure.gravatar.com/avatar/1ad9e5c98d81c6815a65dab5b6e1f669?s=36&amp;d=monsterid&amp;r=g" width="18" height="18" alt="" />Gary Pendergast
</a>
</li>
<li>
<a href="https://profiles.wordpress.org/youknowriad" target="_blank">
<img src="https://secure.gravatar.com/avatar/9929daa7594d5afa910a777ccb9e88e4?s=36&amp;d=monsterid&amp;r=g" width="18" height="18" alt="" />Riad Benguella
</a>
</li>
<li>
<a href="https://profiles.wordpress.org/desrosj" target="_blank">
<img src="https://secure.gravatar.com/avatar/f22c0ec09eb5a6df4da4239a37dbdf9d?s=36&amp;d=monsterid&amp;r=g" width="18" height="18" alt="" />Jonathan Desrosiers
</a>
</li>
<li>
<a href="https://profiles.wordpress.org/luciano-croce" target="_blank">
<img src="https://secure.gravatar.com/avatar/e598c948e82a783e0f40634c0766c965?s=36&amp;d=monsterid&amp;r=g" width="18" height="18" alt="" />luciano-croce
</a>
</li>
</ul> -->
</div>
<div id="section-holder">
<!-- Description Section -->
<div id="section-description" class="section" style="display: block; min-height: 200px;">
<?php echo $addon->description; ?>
</div>
<!-- /Description Section -->
<!-- <div id="section-faq" class="section" style="display: none;">
<h4>
Default settings
</h4>
<p></p>
<p>
When activated this plugin will restore the previous (“classic”) WordPress editor and hide the new block editor (“Gutenberg”).<br />
These settings can be changed at the Settings =&gt; Writing screen.
</p>
<p></p>
<h4>
Default settings for network installation
</h4>
<p></p>
<p>There are two options:</p>
<ul>
<li>
When network-activated this plugin will set the classic editor as default and prevent site administrators and users from changing editors.<br />
The settings can be changed and default network-wide editor can be selected on the Network Settings screen.
</li>
<li>When not network-activated each site administrator will be able to activate the plugin and choose options for their users.</li>
</ul>
<p></p>
<h4>
Cannot find the “Switch to classic editor” link
</h4>
<p></p>
<p>It is in the main block editor menu, see this <a href="https://ps.w.org/classic-editor/assets/screenshot-7.png?rev=2023480" target="_blank">screenshot</a>.</p>
<p></p>
</div> -->
<!-- <div id="section-changelog" class="section" style="display: none;">
<h4>1.6</h4>
<ul>
<li>Updated for WordPress 5.5.</li>
<li>Fixed minor issues with calling deprecated functions, needlessly registering uninstall hook, and capitalization of some strings.</li>
</ul>
<h4>1.5</h4>
<ul>
<li>Updated for WordPress 5.2 and Gutenberg 5.3.</li>
<li>Enhanced and fixed the “open posts in the last editor used to edit them” logic.</li>
<li>Fixed adding post state so it can easily be accessed from other plugins.</li>
</ul>
<h4>1.4</h4>
<ul>
<li>On network installations removed the restriction for only network activation.</li>
<li>Added support for network administrators to choose the default network-wide editor.</li>
<li>Fixed the settings link in the warning on network About screen.</li>
<li>Properly added the “Switch to classic editor” menu item to the block editor menu.</li>
</ul>
<h4>1.3</h4>
<ul>
<li>Fixed removal of the “Try Gutenberg” dashboard widget.</li>
<li>Fixed condition for displaying of the after upgrade notice on the “Whats New” screen. Shown when the classic editor is selected and users cannot switch editors.</li>
</ul>
<h4>1.2</h4>
<ul>
<li>Fixed switching editors from the Add New (post) screen before a draft post is saved.</li>
<li>Fixed typo that was appending the edit URL to the <code>classic-editor</code> query var.</li>
<li>Changed detecting of WordPress 5.0 to not use version check. Fixes a bug when testing 5.1-alpha.</li>
<li>Changed the default value of the option to allow users to switch editors to false.</li>
<li>Added disabling of the Gutenberg plugin and lowered the required WordPress version to 4.9.</li>
<li>Added <code>classic_editor_network_default_settings</code> filter.</li>
</ul>
<h4>1.1</h4>
<p>Fixed a bug where it may attempt to load the block editor for post types that do not support editor when users are allowed to switch editors.</p>
<h4>1.0</h4>
<ul>
<li>Updated for WordPress 5.0.</li>
<li>Changed all “Gutenberg” names/references to “block editor”.</li>
<li>Refreshed the settings UI.</li>
<li>
Removed disabling of the Gutenberg plugin. This was added for testing in WordPress 4.9. Users who want to continue following the development of Gutenberg in WordPress 5.0 and beyond will not need another plugin
to disable it.
</li>
<li>Added support for per-user settings of default editor.</li>
<li>Added support for admins to set the default editor for the site.</li>
<li>Added support for admins to allow users to change their default editor.</li>
<li>Added support for network admins to prevent site admins from changing the default settings.</li>
<li>Added support to store the last editor used for each post and open it next time. Enabled when users can choose default editor.</li>
<li>Added “post editor state” in the listing of posts on the Posts screen. Shows the editor that will be opened for the post. Enabled when users can choose default editor.</li>
<li>
Added <code>classic_editor_enabled_editors_for_post</code> and <code>classic_editor_enabled_editors_for_post_type</code> filters. Can be used by other plugins to control or override the editor used for a
particular post of post type.
</li>
<li>Added <code>classic_editor_plugin_settings</code> filter. Can be used by other plugins to override the settings and disable the settings UI.</li>
</ul>
<h4>0.5</h4>
<ul>
<li>Updated for Gutenberg 4.1 and WordPress 5.0-beta1.</li>
<li>Removed some functionality that now exists in Gutenberg.</li>
<li>Fixed redirecting back to the classic editor after looking at post revisions.</li>
</ul>
<h4>0.4</h4>
<ul>
<li>Fixed removing of the “Try Gutenberg” call-out when the Gutenberg plugin is not activated.</li>
<li>Fixed to always show the settings and the settings link in the plugins list table.</li>
<li>Updated the readme text.</li>
</ul>
<h4>0.3</h4>
<ul>
<li>Updated the option from a checkbox to couple of radio buttons, seems clearer. Thanks to @designsimply for the label text suggestions.</li>
<li>Some general updates and cleanup.</li>
</ul>
<h4>0.2</h4>
<ul>
<li>Update for Gutenberg 1.9.</li>
<li>Remove warning and automatic deactivation when Gutenberg is not active.</li>
</ul>
<h4>0.1</h4>
<p>Initial release.</p>
</div> -->
<!-- <div id="section-screenshots" class="section" style="display: none;">
<ol>
<li>
<a href="https://ps.w.org/classic-editor/assets/screenshot-1.png?rev=1998671" target="_blank">
<img src="https://ps.w.org/classic-editor/assets/screenshot-1.png?rev=1998671" alt="Admin settings on the Settings -> Writing screen." />
</a>
<p>Admin settings on the Settings -&gt; Writing screen.</p>
</li>
<li>
<a href="https://ps.w.org/classic-editor/assets/screenshot-2.png?rev=1998671" target="_blank">
<img src="https://ps.w.org/classic-editor/assets/screenshot-2.png?rev=1998671" alt="User settings on the Profile screen. Visible when the users are allowed to switch editors." />
</a>
<p>User settings on the Profile screen. Visible when the users are allowed to switch editors.</p>
</li>
<li>
<a href="https://ps.w.org/classic-editor/assets/screenshot-3.png?rev=1998671" target="_blank">
<img src="https://ps.w.org/classic-editor/assets/screenshot-3.png?rev=1998671" alt='"Action links" to choose alternative editor. Visible when the users are allowed to switch editors.' />
</a>
<p>"Action links" to choose alternative editor. Visible when the users are allowed to switch editors.</p>
</li>
<li>
<a href="https://ps.w.org/classic-editor/assets/screenshot-4.png?rev=1998671" target="_blank">
<img
src="https://ps.w.org/classic-editor/assets/screenshot-4.png?rev=1998671"
alt="Link to switch to the block editor while editing a post in the classic editor. Visible when the users are allowed to switch editors."
/>
</a>
<p>Link to switch to the block editor while editing a post in the classic editor. Visible when the users are allowed to switch editors.</p>
</li>
<li>
<a href="https://ps.w.org/classic-editor/assets/screenshot-5.png?rev=1998671" target="_blank">
<img
src="https://ps.w.org/classic-editor/assets/screenshot-5.png?rev=1998671"
alt="Link to switch to the classic editor while editing a post in the block editor. Visible when the users are allowed to switch editors."
/>
</a>
<p>Link to switch to the classic editor while editing a post in the block editor. Visible when the users are allowed to switch editors.</p>
</li>
<li>
<a href="https://ps.w.org/classic-editor/assets/screenshot-6.png?rev=1998671" target="_blank">
<img src="https://ps.w.org/classic-editor/assets/screenshot-6.png?rev=1998671" alt="Network settings to select the default editor for the network and allow site admins to change it." />
</a>
<p>Network settings to select the default editor for the network and allow site admins to change it.</p>
</li>
<li>
<a href="https://ps.w.org/classic-editor/assets/screenshot-7.png?rev=2023480" target="_blank">
<img src="https://ps.w.org/classic-editor/assets/screenshot-7.png?rev=2023480" alt='The "Switch to classic editor" link.' />
</a>
<p>The "Switch to classic editor" link.</p>
</li>
</ol>
</div> -->
<!-- <div id="section-reviews" class="section" style="display: none;">
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>Great!</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/sandrardillard" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/46635dba153f976268f9f9206c8de3eb?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/sandrardillard" target="_blank">sandrardillard</a> on <span class="review-date">October 4, 2020</span>
</p>
</div>
</div>
<div class="review-body">Nice tool!</div>
</div>
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>Best Editor Out</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/rechtvanhuyssteen" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/61569e7b98df7fa0e961638f2fe4e493?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/rechtvanhuyssteen" target="_blank">rechtvanhuyssteen</a> on <span class="review-date">September 30, 2020</span>
</p>
</div>
</div>
<div class="review-body">The best, can we get it updateted for latest WP seems to conflict with some other plugins after update. Will never use another plugin except this for editing. Well done</div>
</div>
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>Must need plugin</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/adeebc" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/68cee995a65b40da73d51818576c9007?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/adeebc" target="_blank">adeebc</a> on <span class="review-date">September 30, 2020</span>
</p>
</div>
</div>
<div class="review-body">I'm using WordPress because of this editor. Classic Editor changed my life. I'm using this plugin for more than 50 websites.</div>
</div>
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>Must have</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/cleoni" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/1e5d1686cc26b244794744b07cb74ee4?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/cleoni" target="_blank">cleoni</a> on <span class="review-date">September 24, 2020</span>
</p>
</div>
</div>
<div class="review-body">Must have plugin. Watch out, it seems it currently does not work under WP 5.5 due to deprecated jquery methods.</div>
</div>
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>Until at least 2022</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/kirbyfoster" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/5eda3070b8145f285e03561e7bccb249?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/kirbyfoster" target="_blank">kirbyfoster</a> on <span class="review-date">September 23, 2020</span>
</p>
</div>
</div>
<div class="review-body">
Thankfully this is still available on WP. However it states that 'Classic Editor is an official WordPress plugin, and will be fully supported and maintained until at least 2022' What's going to happen after 2022?
Am I going to have to rewrite my websites? Maybe I ought to start looking at other options instead of WP? Gutenberg is really starting to piss me off. I wish I'd never heard of WP and instead just use html/css/js
like I used to do.
</div>
</div>
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>So much better!</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/sknydrinks" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/368188434b0840cba8c31e15a8208132?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/sknydrinks" target="_blank">sknydrinks</a> on <span class="review-date">September 21, 2020</span>
</p>
</div>
</div>
<div class="review-body">This is so much better. Thank you!</div>
</div>
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>Please go back to Classic Editor</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/passegua" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/4c8f34536195de842099db7de654dc64?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/passegua" target="_blank">passegua</a> on <span class="review-date">September 17, 2020</span>
</p>
</div>
</div>
<div class="review-body">Please get rid of Gutenberg horrible Block Editor! Please ask WordPress user about it, no one uses block editor! Please please go back to the beautiful classic editor!</div>
</div>
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>BROKEN</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-empty"></span><span class="star dashicons dashicons-star-empty"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/lexiol" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/06251c1360f2d474b199c130c7ce509c?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/lexiol" target="_blank">Lexiol</a> on <span class="review-date">September 13, 2020</span>
</p>
</div>
</div>
<div class="review-body">Not sure how to remove my review</div>
</div>
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>I still use the classic editor</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/janejsmaster" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/8a823e5639bc30c2ac79be5168d82285?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/janejsmaster" target="_blank">Jane (janejsmaster)</a> on <span class="review-date">September 10, 2020</span>
</p>
</div>
</div>
<div class="review-body">
I still prefer the classic editor compared to the Gutenberg one. The classic editor is what we have used for years and I hope it will always be maintained by its developers. Many of us still depend on it
everyday.
</div>
</div>
<div class="review">
<div class="review-head">
<div class="reviewer-info">
<div class="review-title-section">
<h4>Gave up</h4>
<div class="star-rating">
<div class="wporg-ratings">
<span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span><span class="star dashicons dashicons-star-filled"></span>
<span class="star dashicons dashicons-star-empty"></span><span class="star dashicons dashicons-star-empty"></span>
</div>
</div>
</div>
<p>
By
<a href="https://profiles.wordpress.org/kielce" target="_blank">
<img alt="" src="https://secure.gravatar.com/avatar/036809f4dfd63fcf041af812ac28a4cb?s=16&amp;d=monsterid&amp;r=g" class="avatar avatar-16 photo" />
</a>
<a href="https://profiles.wordpress.org/kielce" target="_blank">kielce</a> on <span class="review-date">September 8, 2020</span>
</p>
</div>
</div>
<div class="review-body">I gave up on Classic Editor and shifted to the "Disable Gutenberg" plugin months ago. "Disable Gutenberg" has no issues with the WordPress 5.5 update.</div>
</div>
</div> -->
</div>
</div>
</div>
<div id="plugin-information-footer">
<?php if (!$addon->free) : ?>
<span class="wu-text-green-800 wu-inline-block wu-py-1">
<?php _e('This is a Premium Add-on.', 'wp-ultimo'); ?>
</span>
<?php endif; ?>
<form id="plugin-install" class="wu_form">
<?php if ($addon->installed) : ?>
<button
disabled="disabled"
data-slug="<?php echo $addon_slug; ?>"
class="button button-disabled right"
>
<?php _e('Already Installed', 'wp-ultimo'); ?>
</button>
<?php else : ?>
<?php if ($addon->available) : ?>
<?php if ($license->allowed('wpultimo') || $addon->free) : ?>
<button
type="submit"
name="install"
data-slug="<?php echo $addon_slug; ?>"
class="button button-primary right"
>
<?php _e('Install Now', 'wp-ultimo'); ?>
</button>
<?php else : ?>
<a
href="<?php echo $upgrade_url; ?>"
class="button button-primary right"
>
<?php _e('Upgrade your License', 'wp-ultimo'); ?>
</a>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="action" value="wu_form_handler">
<input type="hidden" name="addon" value="<?php echo $addon_slug; ?>">
<input type="hidden" name="wu-when" value="<?php echo base64_encode('after_setup_theme'); ?>">
<?php wp_nonce_field('wu_form_addon_more_info'); ?>
<?php endif; ?>
</div>
</div>

196
views/base/centered.php Normal file
View File

@ -0,0 +1,196 @@
<?php
/**
* Dash view.
*
* @since 2.0.0
*/
?>
<div id="wp-ultimo-wrap" class="wrap wu-styling">
<div class="sm:wu-container sm:wu-mx-auto">
<h1 class="wp-heading-inline">
<?php echo $page_title; ?>
<?php
/**
* You can filter the get_title_link using wu_page_list_get_title_link, see class-wu-page-list.php
*
* @since 1.8.2
*/
foreach ($page->get_title_links() as $action_link) :
$action_classes = isset($action_link['classes']) ? $action_link['classes'] : '';
?>
<a title="<?php echo esc_attr($action_link['label']); ?>" href="<?php echo esc_url($action_link['url']); ?>" class="page-title-action <?php echo esc_attr($action_classes); ?>">
<?php if ($action_link['icon']) : ?>
<span class="dashicons dashicons-<?php echo esc_attr($action_link['icon']); ?> wu-text-sm wu-align-middle wu-h-4 wu-w-4">
&nbsp;
</span>
<?php endif; ?>
<?php echo $action_link['label']; ?>
</a>
<?php endforeach; ?>
<?php
/**
* Allow plugin developers to add additional buttons to list pages
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_centered_after_title', $page);
?>
</h1>
<?php if (isset($_GET['updated'])) : ?>
<div id="message" class="updated notice wu-admin-notice notice-success is-dismissible below-h2">
<p><?php echo $labels['updated_message']; ?></p>
</div>
<?php endif; ?>
<hr class="wp-header-end">
<?php do_action('wu_centered_before_metaboxes', $page); ?>
<?php if (apply_filters('wu_dashboard_display_widgets', true)) : ?>
<div id="dashboard-widgets-wrap">
<div id="dashboard-widgets" class="metabox-holder">
<div class="wu-grid wu-grid-cols-1 md:wu-grid-cols-3 lg:wu-grid-cols-4">
<div id="postbox-container" class="wu-order-2 md:wu-order-1">
<?php
/**
* Print Advanced Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'left', null);
?>
</div>
<div id="postbox-container" class="md:wu-col-span-2 wu-order-1 md:wu-order-2">
<?php if ($content) : ?>
<div class="wu-mx-2">
<div id="wp-ultimo-checkout-element" class="postbox">
<div class="wu-p-4 wu-flex wu-items-center wu-bg-gray-100 wu-border-solid wu-border-0 wu-border-b wu-border-gray-200 wu-leading-snug">
<h3 class="wu-m-0 wu-widget-title">
<?php _e('Change Membership', 'wp-ultimo'); ?>
</h3>
</div>
<div class="wu-mx-2 wu-mt-2 wu-p-2">
<div class="inside">
<?php echo $content; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php
/**
* Print Advanced Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'normal', null);
?>
<div class="wu-px-2">
<?php
/**
* Allow plugin developers to add additional buttons to list pages
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_centered_content', $page);
?>
</div>
</div>
<div id="postbox-container" class="wu--mt-3 sm:wu-ml-2 wu-order-3 md:wu-order-3">
<?php
/**
* Allow plugin developers to add additional buttons to list pages
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_centered_right', $page);
/**
* Print Advanced Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'right', null);
?>
</div>
</div>
</div>
<?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
</div>
<!-- dashboard-widgets-wrap -->
<?php endif; ?>
</div>
</div>

View File

@ -0,0 +1,142 @@
<?php
/**
* JS templates view.
*
* @since 2.0.0
*/
?>
<script type="text/x-template" id="wu-table">
<table class="wp-list-table widefat fixed striped">
<thead>
<tr>
<th v-for="(header_label, header) in headers" :key="header" scope="col" v-html="header_label" :class="'manage-column column-' + header"></th>
</tr>
</thead>
<tbody v-if="list.length === 0">
<tr class="no-items">
<td :colspan="Object.keys(headers).length" class="colspanchange">
<div class="wu-p-6 wu-text-gray-600 wu-text-base wu-text-center">
<span><?php _e('Add the first field!', 'wp-ultimo'); ?></span>
</div>
</td>
</tr>
</tbody>
<draggable
:list="list"
:tag="'tbody'"
group="field"
handle=".wu-placeholder-sortable"
ghost-class="wu-draggable-field-ghost"
drag-class="wu-bg-white"
>
<tr v-for="(field, idx) in list" :key="field.id" :id="'wp-ultimo-field-' + field.id">
<td class="order column-order has-row-actions column-primary" data-colname="<?php _e('Order', 'wp-ultimo'); ?>">
<span
class="wu-inline-block wu-bg-gray-100 wu-text-center wu-align-middle wu-p-1 wu-font-mono wu-px-3 wu-border wu-border-gray-300 wu-border-solid wu-rounded">
{{ parseInt(idx, 10) + 1 }}
</span>
<button type="button" class="toggle-row">
<span class="screen-reader-text"><?php _e('Show more details', 'wp-ultimo'); ?></span>
</button>
</td>
<td class="name column-name" data-colname="<?php _e('Name', 'wp-ultimo'); ?>">
<span class="wu-inline-block wu-font-medium">
{{ field.name ? field.name : "<?php echo __('(no label)', 'wp-ultimo'); ?>" }}
<!-- Visibility -->
<span
v-if="field.logged && field.logged == 'guests_only'"
class="wu-px-1 wu-ml-1 wu-text-xs wu-align-text-bottom wu-inline-block wu-rounded wu-bg-blue-100 wu-text-blue-600"
>
<?php echo wu_tooltip('Guests only', 'dashicons-wu-eye'); ?>
</span>
<span
v-if="field.logged && field.logged == 'logged_only'"
class="wu-px-1 wu-ml-1 wu-text-xs wu-align-text-bottom wu-inline-block wu-rounded wu-bg-blue-100 wu-text-blue-600"
>
<?php echo wu_tooltip('Logged-in users only', 'dashicons-wu-eye'); ?>
</span>
<!-- Visibility - End -->
</span>
<div class="row-actions">
<span class="edit">
<a
title="Edit Field"
class="wubox"
:href="'<?php echo wu_get_form_url('add_new_form_field', array(
'checkout_form' => $checkout_form,
'step' => '',
)); ?>=' + step_name + '&field=' + field.id"
>
<?php _e('Edit'); ?>
</a>
|
</span>
<span class="delete">
<a
v-show="delete_field_id !== field.id"
v-on:click.prevent="delete_field_id = field.id"
title="<?php _e('Delete'); ?>"
href="#"
><?php _e('Delete'); ?></a>
<a
v-show="delete_field_id === field.id"
v-on:click.prevent="remove_field(field.id)"
title="<?php _e('Delete'); ?>"
href="#"
class="wu-font-bold"
><?php _e('Confirm?', 'wp-ultimo'); ?></a>
</span>
</div>
<button type="button" class="toggle-row">
<span class="screen-reader-text">
<?php _e('Show more details', 'wp-ultimo'); ?>
</span>
</button>
</td>
<td class="type column-type" data-colname="<?php _e('Type', 'wp-ultimo'); ?>">
<span class="wu-bg-gray-200 wu-text-gray-700 wu-py-1 wu-px-2 wu-rounded-sm wu-text-xs wu-font-mono">{{ field.type }}</span>
</td>
<td class="type column-slug" data-colname="<?php _e('Slug', 'wp-ultimo'); ?>">
<span class="wu-bg-gray-200 wu-text-gray-700 wu-py-1 wu-px-2 wu-rounded-sm wu-text-xs wu-font-mono">{{ field.id }}</span>
</td>
<td class="move column-move wu-text-right" data-colname="<?php _e('Move', 'wp-ultimo'); ?>">
<span class="wu-placeholder-sortable dashicons-wu-menu"></span>
</td>
</tr>
</draggable>
</table>
</script>

View File

@ -0,0 +1,313 @@
<?php
/**
* Steps view.
*
* @since 2.0.0
*/
?>
<div id="wu-checkout-editor-app">
<!-- Add new Step Section -->
<div id="wp-ultimo-list-table-add-new-1" class="postbox wu-mb-0" v-cloak>
<div class="wu-bg-white wu-px-4 wu-py-3 wu-flex wu-items-center">
<div class="wu-w-1/2">
<span class="wu-text-gray-600 wu-my-1 wu-text-2xs wu-uppercase wu-font-semibold">
<?php printf(__('%1$s steps and %2$s fields', 'wp-ultimo'), '{{ steps.length }}', '{{ field_count }}'); ?>
</span>
</div>
<div class="wu-w-1/2 wu-text-right">
<ul class="wu-m-0 wu-overflow-hidden wu-flex wu-justify-end">
<li class="wu-m-0 wu-ml-4">
<a
title="<?php _e('Preview', 'wp-ultimo'); ?>"
href="#"
type="button"
class="wu-uppercase wu-text-2xs wu-font-semibold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-text-gray-600 hover:wu-text-gray-800"
@click.prevent="get_preview()"
>
<span class="dashicons-wu-eye wu-align-middle"></span>
<span v-show="!preview"><?php _e('Preview', 'wp-ultimo'); ?></span>
<span v-cloak v-show="preview"><?php _e('Editor', 'wp-ultimo'); ?></span>
</a>
</li>
<li class="wu-m-0 wu-ml-4" v-show="!preview">
<a
title="<?php _e('Add new Checkout Step', 'wp-ultimo'); ?>"
href="<?php echo wu_get_form_url('add_new_form_step', array(
'checkout_form' => $checkout_form,
)); ?>"
type="button"
class="wubox wu-uppercase wu-text-2xs wu-font-semibold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-text-gray-600 hover:wu-text-gray-800"
>
<span class="dashicons-wu-circle-with-plus wu-align-middle"></span>
<?php _e('Add new Checkout Step', 'wp-ultimo'); ?>
</a>
</li>
</ul>
</div>
</div>
</div>
<!-- /Add new Step Section -->
<!-- Editor -->
<div
v-cloak
class="wu-px-4 wu-py-1 wu-bg-gray-200 wu-border wu-border-solid wu-border-gray-400 wu-border-t-0 wu-border-b-0"
:class="dragging ? 'is-dragging' : ''"
>
<!-- Editor Proper -->
<draggable
:list="steps"
:tag="'div'"
group="step"
handle=".hndle"
ghost-class="wu-draggable-ghost"
drag-class="wu-hide-inside"
@start="dragging = true"
@end="dragging = false"
v-show="!preview"
>
<div
:id="'wp-ultimo-list-table-' + step.id"
class="postbox wu-my-4"
v-cloak
v-for="(step, idx) in steps"
>
<div class="postbox-header">
<h2 class="hndle ui-sortable-handle">
<span class="wu-text-gray-700 ">
<span class="wu-text-2xs wu-font-mono wu-uppercase wu-mr-4"><?php printf(__('Step %s', 'wp-ultimo'), '{{ idx + 1 }}'); ?></span> {{ step.name }}
</span>
</h2>
</div>
<div class="inside" style="margin-top: 0 !important;">
<!-- Visibility -->
<div v-if="step.logged && step.logged !== 'always'" class="wu-py-2 wu-px-4 wu--mx-3 wu-bg-blue-100 wu-text-blue-600 wu-border-solid wu-border-0 wu-border-b wu-border-gray-400">
<span class="dashicons-wu-eye wu-mr-1 wu-align-middle"></span>
<span v-if="step.logged == 'guests_only'">
<?php _e('This step is only visible for <strong>guests</strong>', 'wp-ultimo'); ?>
</span>
<span v-else>
<?php _e('This step is only visible for <strong>logged-in users</strong>', 'wp-ultimo'); ?>
</span>
</div>
<!-- Visibility - End -->
<div class="wu-advanced-filters wu-widget-list-table wu--mx-3 wu--mb-3">
<div id="wu-checkout_form_section_list_table" class="wu-list-table wu-mode-list">
<wu-draggable-table
:list="step.fields"
:headers="headers"
:step_name="step.id"
></wu-draggable-table>
</div>
</div>
<div
class="wu-bg-gray-100 wu-px-4 wu-py-3 wu--m-3 wu-mt-3 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-400 wu-border-solid wu-text-right">
<ul class="wu-m-0 wu-overflow-hidden md:wu-flex wu-w-full md:wu-w-auto wu-justify-end">
<li class="wu-m-0 md:wu-ml-4 wu-text-center">
<a
v-show="delete_step_id !== step.id"
v-on:click.prevent="delete_step_id = step.id"
title="<?php _e('Delete'); ?>"
href="#"
class="wu-text-red-500 wu-uppercase wu-text-2xs wu-font-semibold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-p-4 md:wu-p-0 wu-inline-block"
>
<?php _e('Delete Step'); ?>
</a>
<a
v-show="delete_step_id === step.id"
v-on:click.prevent="remove_step(step.id)"
title="<?php _e('Delete'); ?>"
href="#"
class="wu-text-red-700 wu-uppercase wu-text-2xs wu-font-bold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-p-4 md:wu-p-0 wu-inline-block"
>
<?php _e('Confirm?', 'wp-ultimo'); ?>
</a>
</li>
<li class="wu-m-0 md:wu-ml-4 wu-text-center">
<a title="<?php _e('Edit Section', 'wp-ultimo'); ?>"
:href="'<?php echo wu_get_form_url('add_new_form_step', array(
'checkout_form' => $checkout_form,
'step' => '',
)); ?>=' + step.id"
type="button"
class="wu-uppercase wu-text-2xs wu-font-semibold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-text-gray-600 hover:wu-text-gray-800 wubox wu-p-4 md:wu-p-0 wu-inline-block"
>
<?php _e('Edit Section', 'wp-ultimo'); ?>
</a>
</li>
<li class="wu-m-0 md:wu-ml-4 wu-text-center">
<a title="<?php _e('Add new Field', 'wp-ultimo'); ?>"
:href="'<?php echo wu_get_form_url('add_new_form_field', array(
'checkout_form' => $checkout_form,
'width' => 600,
'step' => '',
)); ?>=' + step.id"
type="button" class="wu-uppercase wu-text-2xs wu-font-semibold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-text-gray-600 hover:wu-text-gray-800 wubox wu-p-4 md:wu-p-0 wu-inline-block">
<span class="dashicons-wu-circle-with-plus wu-align-text-bottom"></span>
<?php _e('Add new Field', 'wp-ultimo'); ?>
</a>
</li>
</ul>
</div>
</div>
</div>
</draggable>
<!-- /Editor Proper -->
<!-- Preview Block -->
<div v-show="preview">
<div v-show="!loading_preview && !preview_error" class="wu-text-center wu-mt-3">
<a @click.prevent="get_preview('user')" href="#" class="wu-m-2 wu-uppercase wu-text-2xs wu-font-semibold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-text-gray-600 hover:wu-text-gray-800">
<?php _e('See as existing user', 'wp-ultimo'); ?>
</a>
<a @click.prevent="get_preview('visitor')" href="#" class="wu-m-2 wu-uppercase wu-text-2xs wu-font-semibold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-text-gray-600 hover:wu-text-gray-800">
<?php _e('See as visitor', 'wp-ultimo'); ?>
</a>
</div>
<!-- Preview Loading -->
<div v-show="loading_preview" class="wu-block wu-p-4 wu-py-8 wu-bg-white wu-text-center wu-my-4 wu-border wu-border-solid wu-rounded wu-border-gray-400">
<span class="wu-blinking-animation wu-text-gray-600 wu-my-1 wu-text-2xs wu-uppercase wu-font-semibold">
<?php _e('Loading Preview...', 'wp-ultimo'); ?>
</span>
</div>
<!-- /Preview Loading -->
<!-- Error -->
<div v-show="preview_error" class="wu-block wu-p-4 wu-py-8 wu-bg-white wu-text-center wu-my-4 wu-border wu-border-solid wu-rounded wu-border-gray-400">
<span class="wu-text-red-600 wu-my-1 wu-text-2xs wu-uppercase wu-font-semibold">
<?php _e('Something wrong happened along the way =(', 'wp-ultimo'); ?>
</span>
</div>
<!-- /Error -->
<!-- Preview Proper -->
<!-- <div v-show="!loading_preview && !preview_error" class="wu-block wu-p-8 wu-bg-white wu-my-4 wu-border wu-border-solid wu-rounded wu-border-gray-400" v-html="preview_content"></div> -->
<div v-show="!loading_preview && !preview_error" id="wu-iframe-content" class="wu-w-full wu-relative">
<iframe id="wp-ultimo-checkout-preview" v-bind:src="iframe_preview_url" class="wu-w-full wu-h-full wu-m-0 wu-mt-4 wu-mb-2 wu-p-0 wu-overflow-hidden wu-border-radius wu-border wu-border-solid wu-rounded wu-border-gray-400">
<?php _e('Your browser doesn\'t support iframes', 'wp-ultimo'); ?>
</iframe>
</div>
<!-- /Preview Proper -->
</div>
<!-- /Preview Block -->
</div>
<!-- /Editor -->
<!-- Add new Step Section -->
<div id="wp-ultimo-list-table-add-new-2" class="postbox" v-cloak>
<div class="wu-bg-white wu-px-4 wu-py-3 wu-flex wu-items-center">
<div class="wu-w-1/2">
<span class="wu-text-gray-600 wu-my-1 wu-text-2xs wu-uppercase wu-font-semibold">
<?php printf(__('%1$s steps and %2$s fields', 'wp-ultimo'), '{{ steps.length }}', '{{ field_count }}'); ?>
</span>
</div>
<div class="wu-w-1/2 wu-text-right">
<ul class="wu-m-0 wu-overflow-hidden wu-flex wu-justify-end">
<li class="wu-m-0 wu-ml-4">
<a
title="<?php _e('Preview', 'wp-ultimo'); ?>"
href="#"
type="button"
class="wu-uppercase wu-text-2xs wu-font-semibold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-text-gray-600 hover:wu-text-gray-800"
@click.prevent="get_preview('user')"
>
<span class="dashicons-wu-eye wu-align-middle"></span>
<span v-show="!preview"><?php _e('Preview', 'wp-ultimo'); ?></span>
<span v-cloak v-show="preview"><?php _e('Editor', 'wp-ultimo'); ?></span>
</a>
</li>
<li class="wu-m-0 wu-ml-4" v-show="!preview">
<a
title="<?php _e('Add new Checkout Step', 'wp-ultimo'); ?>"
href="<?php echo wu_get_form_url('add_new_form_step', array(
'checkout_form' => $checkout_form,
)); ?>"
type="button"
class="wubox wu-uppercase wu-text-2xs wu-font-semibold wu-no-underline wu-outline-none hover:wu-shadow-none focus:wu-shadow-none wu-text-gray-600 hover:wu-text-gray-800"
>
<span class="dashicons-wu-circle-with-plus wu-align-middle"></span>
<?php _e('Add new Checkout Step', 'wp-ultimo'); ?>
</a>
</li>
</ul>
</div>
</div>
</div>
<!-- /Add new Step Section -->
<textarea class="wu-hidden" v-cloak name="_settings" v-html="JSON.stringify(steps)"></textarea>
</div>

View File

@ -0,0 +1,136 @@
<?php
/**
* Grid item view.
*
* @since 2.0.0
*/
?>
<div class="wu-border-transparent" tabindex="0">
<div class="wu-grid-item wu-border wu-border-solid wu-border-gray-300 wu-py-8 wu-bg-white wu-text-center">
<div
class="wu--mt-8 wu-py-8 wu-bg-gray-100 wu-bg-cover wu-bg-center"
style="opacity: 0.15; background-image: url(<?php echo get_avatar_url($item->get_user_id(), array(
'default' => 'identicon',
'size' => 320,
)); ?>)"
>
&nbsp;
</div>
<div class="customer-avatar wu-relative wu--mt-8">
<?php echo get_avatar($item->get_user_id(), 92, 'identicon', '', array('force_display' => true, 'class' => 'wu-rounded-full wu-border wu-border-solid wu-border-gray-300 wu-bg-white')); ?>
</div>
<div class="wu-text-base wu-mt-1">
<div>
<span class="wu-font-semibold"><?php echo $item->get_display_name(); ?></span>
<small>#<?php echo $item->get_id(); ?></small>
</div>
<div class="wu-text-xs wu-my-1">
<?php if ($item->get_email_address()) : ?>
<a class="wu-no-underline" href="mailto:<?php echo $item->get_email_address(); ?>">
<?php echo $item->get_email_address(); ?>
</a>
<?php else : ?>
<?php _e('No email address', 'wp-ultimo'); ?>
<?php endif; ?>
</div>
<div class="wu-text-xs">
<span class="<?php echo $item->is_vip() ? esc_attr('wu-font-semibold') : ''; ?>">
<?php echo $item->is_vip() ? __('VIP Customer', 'wp-ultimo') : __('Regular Customer', 'wp-ultimo'); ?>
</span>
</div>
</div>
<div class="customer-secondary-info wu-mt-5">
<div class="wu-flex wu-justify-between wu-border-0 wu-border-t wu-border-solid wu-border-gray-300 wu-py-2 wu-px-3">
<span>
<?php _e( 'Last Login:', 'wp-ultimo' ); ?>
</span>
<span class="wu-font-semibold">
<?php
if ($item->is_online()) {
echo '<span class="wu-inline-block wu-mr-1 wu-rounded-full wu-h-2 wu-w-2 wu-bg-green-500"></span>'.__('Online', 'wp-ultimo');
} else {
if ( '0000-00-00 00:00:00' !== $item->get_last_login() ) {
echo human_time_diff( strtotime( $item->get_last_login() ), time() ).' '.__('ago', 'wp-ultimo');
} else {
_e('Never logged in', 'wp-ultimo');
}
}
?>
</span>
</div>
<div class="wu-flex wu-justify-between wu-border-0 wu-border-t wu-border-solid wu-border-gray-300 wu-py-2 wu-px-3">
<span>
<?php _e( 'Customer Since:', 'wp-ultimo' ); ?>
</span>
<span class="wu-font-semibold">
<?php echo human_time_diff( strtotime( $item->get_date_registered() ), time() ).' '.__('ago', 'wp-ultimo'); ?>
</span>
</div>
<div class="wu-flex wu-justify-between wu-border-0 wu-border-gray-300 wu-border-t wu-border-b-0 wu-border-solid wu-py-2 wu-px-3">
<span>
<?php _e( 'Memberships:', 'wp-ultimo' ); ?>
</span>
<div>
<span class="wu-font-semibold">
<?php echo count($item->get_memberships()); ?>
</span>
<?php
if (!empty($item->get_memberships())) {
?>
<a href="<?php echo wu_network_admin_url('wp-ultimo-memberships', array( 'customer_id' => $item->get_id() ) ); ?>">
<?php _e( 'View', 'wp-ultimo' ); ?>
</a>
<?php
}
?>
</div>
</div>
<div class="wu-flex wu-justify-between wu-border-0 wu-border-gray-300 wu-border-t wu-border-b-0 wu-border-solid wu-py-2 wu-px-3">
<span>
<?php _e( 'Actions:', 'wp-ultimo' ); ?>
</span>
<div>
<?php
// Concatenate switch to url
$is_modal_switch_to = \WP_Ultimo\User_Switching::get_instance()->check_user_switching_is_activated() ? '' : 'wubox';
$url_switch_to = sprintf('<a title="%s" class="%s" href="%s">%s</a>', __('Switch To', 'wp-ultimo'), $is_modal_switch_to, \WP_Ultimo\User_Switching::get_instance()->render($item->get_user_id()), __('Switch To', 'wp-ultimo'));
$actions = array(
'switch-to' => $item->get_user_id() !== get_current_user_id() ? $url_switch_to : __('None', 'wp-ultimo'),
);
echo implode("<br />", $actions);
?>
</div>
</div>
</div>
<div class="wu-flex wu-justify-between wu-items-center wu--mb-8 wu-p-4 wu-bg-gray-100 wu-border wu-border-solid wu-border-gray-300 wu-border-l-0 wu-border-r-0 wu-border-b-0">
<label>
<input class="wu-rounded-none" type="checkbox" name="bulk-delete[]" value="<?php echo $item->get_id(); ?>" />
<?php _e( 'Select Customer', 'wp-ultimo' ); ?>
</label>
<a href="<?php echo wu_network_admin_url('wp-ultimo-edit-customer', array( 'id' => $item->get_id() ) ); ?>" class="button button-primary">
<?php _e('Manage', 'wp-ultimo'); ?>
</a>
</div>
</div>
</div>

146
views/base/dash.php Normal file
View File

@ -0,0 +1,146 @@
<?php
/**
* Dash view.
*
* @since 2.0.0
*/
?>
<div id="wp-ultimo-wrap" class="<?php wu_wrap_use_container() ?> wrap wu-styling">
<h1 class="wp-heading-inline">
<?php echo $page_title; ?>
<?php
/**
* You can filter the get_title_link using wu_page_list_get_title_link, see class-wu-page-list.php
*
* @since 1.8.2
*/
foreach ($page->get_title_links() as $action_link) :
$action_classes = isset($action_link['classes']) ? $action_link['classes'] : '';
?>
<a title="<?php echo esc_attr($action_link['label']); ?>" href="<?php echo esc_url($action_link['url']); ?>" class="page-title-action <?php echo esc_attr($action_classes); ?>">
<?php if ($action_link['icon']) : ?>
<span class="dashicons dashicons-<?php echo esc_attr($action_link['icon']); ?> wu-text-sm wu-align-middle wu-h-4 wu-w-4">
&nbsp;
</span>
<?php endif; ?>
<?php echo $action_link['label']; ?>
</a>
<?php endforeach; ?>
<?php
/**
* Allow plugin developers to add additional buttons to list pages
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_dash_after_title', $page);
?>
</h1>
<hr class="wp-header-end">
<?php do_action('wu_dash_before_metaboxes', $page); ?>
<?php if (apply_filters('wu_dashboard_display_widgets', true)) : ?>
<div id="dashboard-widgets-wrap">
<div id="dashboard-widgets" class="metabox-holder">
<?php if ($has_full_position) : ?>
<div id="postbox-container" class="postbox-container wu-w-full wu--mb-5" style="width: 100% !important;">
<?php
/**
* Print Advanced Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'full', null);
?>
</div>
<div class="wu-mx-2">
<?php do_action('wu_dash_after_full_metaboxes', $page); ?>
</div>
<?php endif; ?>
<div class="sm:wu-grid md:wu-grid-cols-2 xl:wu-grid-cols-3">
<div id="postbox-container" class="wu-postbox-container">
<?php
/**
* Print Advanced Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'normal', null);
?>
</div>
<div id="postbox-container" class="wu-postbox-container">
<?php
/**
* Print Advanced Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'side', null);
?>
</div>
<div id="postbox-container" class="wu-postbox-container">
<?php
/**
* Print Advanced Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'column3', null);
?>
</div>
</div>
</div>
<?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
</div>
<!-- dashboard-widgets-wrap -->
<?php endif; ?>
</div>

249
views/base/edit.php Normal file
View File

@ -0,0 +1,249 @@
<?php
/**
* Edit view.
*
* @since 2.0.0
*/
?>
<div id="wp-ultimo-wrap" class="<?php wu_wrap_use_container() ?> wrap">
<h1 class="wp-heading-inline">
<?php echo $page->edit ? $labels['edit_label'] : $labels['add_new_label']; ?>
<?php
/**
* You can filter the get_title_link using wu_page_list_get_title_link, see class-wu-page-list.php
*
* @since 1.8.2
*/
foreach ($page->get_title_links() as $action_link) :
$action_classes = isset($action_link['classes']) ? $action_link['classes'] : '';
$attrs = isset($action_link['attrs']) ? $action_link['attrs'] : '';
?>
<a title="<?php echo esc_attr($action_link['label']); ?>" href="<?php echo esc_url($action_link['url']); ?>" class="page-title-action <?php echo esc_attr($action_classes); ?>" <?php echo $attrs; ?>>
<?php if ($action_link['icon']) : ?>
<span class="dashicons dashicons-<?php echo esc_attr($action_link['icon']); ?> wu-text-sm wu-align-middle wu-h-4 wu-w-4">
&nbsp;
</span>
<?php endif; ?>
<?php echo $action_link['label']; ?>
</a>
<?php endforeach; ?>
<?php
/**
* Allow plugin developers to add additional buttons to edit pages
*
* @since 1.8.2
* @param object Object holding the information
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_edit_after_title', $object, $page);
?>
</h1>
<?php if (isset($_GET['updated'])) : ?>
<div id="message" class="updated notice wu-admin-notice notice-success is-dismissible below-h2">
<p><?php echo $labels['updated_message']; ?></p>
</div>
<?php endif; ?>
<?php if (isset($_GET['notice'])) : ?>
<div id="message" class="updated notice wu-admin-notice notice-success is-dismissible below-h2">
<p><?php echo $labels['updated_message']; ?></p>
</div>
<?php endif; ?>
<?php
/**
* Allow plugin developers to add additional handlers to URL query redirects
*
* @since 2.0.0
*
* @param WP_Ultimo\Admin_Pages\Base_Admin_Page $page The page object.
*/
do_action('wu_page_edit_redirect_handlers', $page);
?>
<hr class="wp-header-end">
<form id="form-<?php echo esc_attr($page->get_id()); ?>" name="post" method="post" autocomplete="off">
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-2">
<?php if ($page->has_title()) : ?>
<div id="post-body-content">
<div id="titlediv">
<div id="titlewrap">
<input placeholder="<?php echo $labels['title_placeholder']; ?>" type="text" name="name" size="30" value="<?php echo method_exists($object, 'get_name') ? esc_attr($object->get_name()) : ''; ?>" id="title" spellcheck="true" autocomplete="off">
<?php if (!empty($labels['title_description'])) : ?>
<span class="wu-block wu-bg-gray-100 wu-rounded wu-border-solid wu-border-gray-400 wu-border-t-0 wu-border-l wu-border-b wu-border-r wu-text-xs wu-py-2 wu-p-2 wu-pt-3 wu--mt-2">
<?php echo $labels['title_description']; ?>
</span>
<?php endif; ?>
<?php
/**
* Allow plugin developers to add additional information below the text input
*
* @since 1.8.2
* @param object Object holding the information
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_edit_page_after_title_input', $object, $page);
?>
</div>
</div>
<!-- /titlediv -->
<?php if ($page->has_editor()) : ?>
<div class="wu-mt-5">
<?php remove_editor_styles(); ?>
<?php $content = method_exists($object, 'get_content') ? esc_attr($object->get_content()) : ''; ?>
<?php wp_editor( html_entity_decode($content) , 'content', array(
'height' => 500,
)); ?>
</div>
<?php endif; ?>
</div>
<!-- /post-body-content -->
<?php endif; ?>
<div id="postbox-container-1" class="postbox-container">
<?php
/**
* Print Side Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'side', $object);
?>
<?php
/**
* Print Side Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'side-bottom', $object);
?>
</div>
<div id="postbox-container-2" class="postbox-container">
<?php
/**
* Print Normal Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'normal', $object);
/**
* Allow developers to add additional elements after the modals are printed.
*
* @since 2.0.0
* @param object Object being edited right now
*/
do_action("wu_edit_{$screen->id}_after_normal", $object);
/**
* Print Advanced Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'advanced', $object);
?>
</div>
<!-- /normal-sortables -->
</div>
<!-- /post-body -->
<br class="clear">
<?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
<?php wp_nonce_field(sprintf('saving_%s', $page->object_id), sprintf('saving_%s', $page->object_id), false); ?>
<?php wp_nonce_field(sprintf('saving_%s', $page->object_id), '_wpultimo_nonce'); ?>
<?php if ($page->edit) : ?>
<?php wp_nonce_field(sprintf('deleting_%s', $page->object_id), sprintf('deleting_%s', $page->object_id), false); ?>
<?php wp_nonce_field(sprintf('deleting_%s', $page->object_id), 'delete_wpultimo_nonce'); ?>
<input type="hidden" name="id" value="<?php echo $object->get_id(); ?>">
<?php endif; ?>
</div>
<!-- /poststuff -->
</form>
<?php
/**
* Allow plugin developers to add scripts to the bottom of the page
*
* @since 1.8.2
* @param object Object holding the information
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_edit_footer', $object, $page);
?>
</div>

View File

@ -0,0 +1,74 @@
<?php
/**
* Display notes widget view.
*
* @since 2.0.0
*/
?>
<?php if (empty($notes)) : ?>
<?php echo wu_render_empty_state(array(
'message' => __("No notes yet.", 'wp-ultimo'),
'sub_message' => __('Use the "Add new Note" to create the first one.', 'wp-ultimo'),
'link_url' => false,
'display_background_image' => false,
)); ?>
<?php else : ?>
<?php foreach ($notes as $note) : ?>
<div class="wu-flex wu-justify-end wu-items-end wu-flex-col wu-mt-4">
<div class="wu-m-0 wu-p-3 wu-rounded wu-bg-gray-200 wu-text-right" id="wu-text-note">
<?php echo wu_remove_empty_p($note->text); ?>
</div>
<div class="wu-m-0 wu-mb-4 wu-p-0" id="wu-date-avatar">
<?php $user = get_user_by('ID', $note->author_id); ?>
<div class="wu-flex wu-overflow-hidden wu-ml-3 wu-mt-1">
<?php echo wp_kses_post(get_avatar($note->author_id, 20, 'identicon', '', array('force_display' => true, 'class' => 'wu-rounded-full wu-mr-2'))); ?> <?php echo $user->display_name; ?>
</div>
<div class="wu-text-right">
<span class="wu-text-xs wu-text-gray-500">
<?php echo esc_html(date_i18n('M d, H:i', strtotime($note->date_created))); ?>
</span>
<?php if (current_user_can('delete_notes')) : ?>
<?php $modal_atts = array(
'object_id' => wu_request('id'),
'model' => $model,
'note_id' => $note->note_id,
'height' => 306,
); ?>
<span class="wu-ml-2">
<a class="dashicons-wu-trash wu-p-0 wu-border-none wu-text-red-600 wu-button-delete wu-no-underline wubox" href="<?php echo esc_url(wu_get_form_url('delete_note', $modal_atts)); ?>"
title="<?php echo esc_attr__('Clear Note', 'wp-ultimo'); ?>"></a>
</span>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>

View File

@ -0,0 +1,52 @@
<?php
/**
* Customizer editor view.
*
* @since 2.0.0
*/
?>
<div id="preview-stage">
<div v-show="preview">
<div class="wu-block wu-flex wu-justify-center wu-p-4 wu-py-8 wu-bg-white wu-text-center wu-border wu-border-solid wu-rounded wu-border-gray-400 wu-h-screen">
<span class="wu-self-center wu-blinking-animation wu-text-gray-600 wu-my-1 wu-text-2xs wu-uppercase wu-font-semibold">
<?php echo _e('Loading Preview...', 'wp-ultimo'); ?>
</span>
</div>
</div>
<div v-show="!preview" v-cloak>
<div id="wp-ultimo-list-table-add-new-1" class="postbox wu-mb-0">
<div class="wu-bg-white wu-px-4 wu-py-3 wu-flex wu-items-center">
<div class="wu-w-1/2">
<span class="wu-text-gray-600 wu-my-1 wu-text-2xs wu-uppercase wu-font-semibold">
<?php echo __('Template Preview', 'wp-ultimo'); ?>
</span>
</div>
</div>
</div>
<div id="preview_content" class="wu-block wu-bg-gray wu-text-center wu-mb-5 wu-border wu-border-t-0 wu-border-solid wu-rounded wu-border-gray-400">
<iframe id="preview-stage-iframe" class="preview-stage-iframe" width="100%" style="height: <?php echo $preview_height; ?>;" frameborder="0" data-src="<?php echo esc_url($preview_iframe_url); ?>" src="<?php echo esc_url($preview_iframe_url); ?>"></iframe>
</div>
</div>
</div>

View File

@ -0,0 +1,37 @@
<?php
/**
* List table widget view.
*
* @since 2.0.0
*/
?>
<?php echo $before; ?>
<?php if ($page->edit) : ?>
<div class="wu-advanced-filters wu-widget-list-table wu--m-3 wu--mt-1 wu--mb-3">
<?php $table->prepare_items(); ?>
<!-- <form id="posts-filter" method="post"> -->
<input type="hidden" name="page" value="<?php echo $page->get_id(); ?>">
<?php $table->display(); ?>
<!-- </form> -->
</div>
<?php else : ?>
<div class="wu-p-12 wu-h-12 wu--mt-1 wu--mx-3 wu--mb-3 wu-bg-gray-100 wu-text-gray-500 wu-text-xs wu-text-center">
<span class="dashicons dashicons-warning wu-h-8 wu-w-8 wu-mx-auto wu-text-center wu-text-4xl wu-block"></span>
<span class="wu-block wu-text-sm wu-mt-2">
<?php printf(__('%s will show up here once this item is saved.', 'wp-ultimo'), $title); ?>
</span>
</div>
<?php endif; ?>
<?php echo $after; ?>

View File

@ -0,0 +1,22 @@
<?php
/**
* Save widget view.
*
* @since 2.0.0
*/
?>
<?php if (!empty($labels['save_description'])) : ?>
<p class="wu-mb-5">
<?php echo $labels['save_description']; ?>
</p>
<?php endif; ?>
<div class="wu-bg-gray-200 wu-p-4 wu--m-3 wu--mt-2 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-400 wu-border-solid">
<button type="submit" name="action" value="save" class="button button-primary wu-w-full">
<?php echo $labels['save_button_label']; ?>
</button>
</div>

View File

@ -0,0 +1,137 @@
<?php
/**
* Tabs widget view.
*
* @since 2.0.0
*/
?>
<div
class="wu-m-0"
data-wu-app="<?php echo esc_attr($html_attr['data-wu-app']); ?>"
data-state="<?php echo htmlspecialchars(json_encode(($html_attr['data-state']))); ?>"
<?php echo wu_get_isset($html_attr, 'data-on-load') ? 'data-on-load="'.esc_attr($html_attr['data-on-load']).'"' : ''; ?>
>
<div
class="wu-widget-inside md:wu-flex wu-flex-none md:wu--mx-3 md:wu--mb-3 wu--m-2"
v-bind:class="display_all ? 'wu-display-all' : ''"
>
<div
class="wu-block md:wu-px-3 wu-w-full md:wu-w-1/4 wu-bg-gray-100 md:wu-border-solid wu-border-gray-400 wu-border-t-0 wu-border-l-0 wu-border-b-0 wu-border-r"
>
<ul class="wu-text-sm">
<ul>
<!-- Menu Item -->
<li v-show="display_all" v-cloak>
<!-- Menu Link -->
<a class="wu-cursor-pointer wu-block wu-py-2 wu-px-4 wu-no-underline wu-rounded wu-bg-gray-300 wu-text-gray-800">
<span class="wu-text-base wu-w-4 wu-h-4 wu-pt-2px wu-mr-1 dashicons dashicons-wu-chevron-with-circle-down">&nbsp;</span>
<?php _e('All Options', 'wp-ultimo'); ?>
</a>
<!-- End Menu Link -->
</li>
<!-- End Menu Item -->
<?php foreach ($sections as $section_id => $section) : ?>
<!-- Menu Item -->
<li v-show="!display_all && <?php echo esc_attr($section['v-show']); ?>">
<!-- Menu Link -->
<a
class="wu-cursor-pointer wu-block md:wu-py-2 md:wu-px-4 wu-p-4 wu-no-underline wu-rounded wu-text-gray-600"
v-bind:class="section == '<?php echo esc_attr($section_id); ?>' ? 'wu-bg-gray-300 wu-text-gray-800' : ''"
v-on:click.prevent="section = '<?php echo esc_attr($section_id); ?>'"
>
<?php if ($section['icon']) : ?>
<span class="wu-text-base wu-w-4 wu-h-4 wu-pt-2px wu-mr-1 dashicons <?php echo esc_attr($section['icon']); ?>">&nbsp;</span>
<?php else : ?>
<span class="wu-text-base wu-w-4 wu-h-4 wu-pt-2px wu-mr-1 dashicons dashicons-wu-sound-mix">&nbsp;</span>
<?php endif; ?>
<?php echo $section['title']; ?>
</a>
<!-- End Menu Link -->
</li>
<!-- End Menu Item -->
<?php endforeach; ?>
</ul>
<a v-on:click="display_all = !display_all;" class="wu-cursor-pointer wu-block wu-py-2 wu-px-4 wu-pt-10 wu-no-underline wu-text-xs wu-rounded">
<span v-show="!display_all">
<?php _e('Display all fields', 'wp-ultimo'); ?>
</span>
<span v-cloak v-show="display_all">
<?php _e('Hide other fields', 'wp-ultimo'); ?>
</span>
</a>
</ul>
</div>
<div class="md:wu-w-3/4 wu-w-full">
<div v-show="false" class="wu-text-center wu-rounded wu-flex wu-items-center wu-justify-center wu-uppercase wu-font-semibold wu-text-xs wu-h-full wu-text-gray-700">
<span class="wu-blinking-animation">
<?php _e('Loading...', 'wp-ultimo'); ?>
</span>
</div>
<?php foreach ($sections as $section_id => $section) : ?>
<div
class="wu-tab-content"
v-cloak
id="<?php echo esc_attr("wu_tab_$section_id"); ?>"
>
<?php
/**
* Render Form
*/
$section['form']->render();
?>
</div>
<?php endforeach; ?>
</div>
</div>
<?php echo $after; ?>
</div>

View File

@ -0,0 +1,61 @@
<?php
/**
* Empty List Table View
*
* @since 2.0.0
*/
?>
<div
class="wu-flex wu-justify-center wu-items-center wu-text-center wu-bg-contain wu-bg-no-repeat wu--mb-12 wu-pb-12"
style="background-image: url(<?php echo $display_background_image ? wu_get_asset('empty-state-bg.png', 'img') : ''; ?>); <?php echo $display_background_image ? "height: calc(100vh - 300px); background-position: center -30px;" : ''; ?>"
>
<div class="wu-block wu-p-4 md:wu-pt-12 wu-self-center">
<span class="wu-block wu-text-2xl wu-text-gray-600">
<?php echo $message; ?>
</span>
<?php if (!empty($link_url)) : ?>
<div class="wu-block wu-text-base wu-text-gray-500 wu-py-6">
<?php echo $sub_message; ?>
</div>
<div>
<a
href="<?php echo esc_attr($link_url); ?>"
title="<?php echo esc_attr($link_label); ?>"
class="button button-primary button-hero <?php echo esc_attr($link_classes); ?>"
>
<?php if (!empty($link_icon)) : ?>
<span class="<?php echo esc_attr($link_icon); ?> wu-align-middle"></span>
<?php endif; ?>
<?php echo $link_label; ?>
</a>
</div>
<?php else : ?>
<div class="wu-block wu-text-base wu-text-gray-500 wu-py-6">
<?php echo $sub_message; ?>
</div>
<?php endif; ?>
</div>
</div>

219
views/base/filter.php Normal file
View File

@ -0,0 +1,219 @@
<?php
/**
* Filter view.
*
* @since 2.0.0
*/
?>
<div
id="<?php echo esc_attr($filters_el_id); ?>"
class="wp-filter wu-filter <?php echo !$table->has_items() ? 'wu-opacity-50 wu-pointer-events-none' : ''; ?>"
>
<?php if (!empty($views)) : ?>
<ul class="filter-links">
<?php foreach ($views as $view_slug => $view) : ?>
<li
class="<?php echo wu_request($view['field'], 'all') == $view_slug ? esc_attr('current') : ''; ?>"
:class="view && view === '<?php echo esc_attr($view_slug); ?>' ? 'current wu-font-medium' : ''"
>
<a
v-on:click.prevent="set_view('<?php echo esc_attr($view['field']); ?>', '<?php echo esc_attr($view_slug); ?>')"
href="<?php echo esc_attr($view['url']); ?>"
class="<?php echo wu_request($view['field'], 'all') == $view_slug ? esc_attr('current wu-font-medium') : ''; ?>"
:class="view && view === '<?php echo esc_attr($view_slug); ?>' ? 'current wu-font-medium' : ''"
>
<?php echo esc_attr($view['label']); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if (false) : ?>
<button
v-show="!open"
v-on:click.prevent="open_filters"
type="button"
class="button drawer-toggle"
v-bind:aria-expanded="open ? 'true' : 'false'"
>
<?php _e('Advanced Filters', 'wp-ultimo'); ?>
</button>
<div class="wu-py-3 wu-px-2 wu-inline-block wu-uppercase wu-font-semibold wu-text-gray-600 wu-text-xs" v-show="open" v-cloak>
<?php _e('Advanced Filters', 'wp-ultimo'); ?>
</div>
<button
v-show="open"
v-on:click.prevent="close_filters"
type="button"
class="button drawer-toggle"
>
<?php _e('Close', 'wp-ultimo'); ?>
</button>
<?php endif; ?>
<form class="search-form">
<?php if (isset($has_search) && $has_search) : ?>
<label class="screen-reader-text" for="wp-filter-search-input">
<?php echo esc_html($search_label); ?>
</label>
<input
name='s' id="s"
value="<?php echo esc_attr(isset($_REQUEST['s']) ? $_REQUEST['s'] : ''); ?>"
placeholder="<?php echo esc_attr($search_label); ?>"
type="search"
aria-describedby="live-search-desc"
id="wp-filter-search-input"
class="wp-filter-search"
>
<?php endif; ?>
</form>
<?php if (isset($has_view_switch) && $has_view_switch) : ?>
<?php $table->view_switcher($table->current_mode); ?>
<?php endif; ?>
<div v-cloak v-show="false" class="wu-hidden">
<div class="wu-clear-both"></div>
<div class="wu-mb-3">
<div
v-for="(filter, index) in filters"
class="wu-row wu-flex wu-p-4 wu-mt-0 wu-my-3 wu-bg-gray-100 wu-rounded wu-border wu-border-solid wu-border-gray-200"
>
<div class="wu-w-1/12 wu-mx-2 wu-text-right wu-self-center">
<span
class="wu-uppercase wu-font-semibold wu-text-gray-600 wu-text-xs"
v-if="index === 0"
>
<?php _e('Where', 'wp-ultimo'); ?>
</span>
<select
class="form-control wu-w-full"
v-if="index === 1"
v-model="relation"
>
<option value="and"><?php _e('and', 'wp-ultimo'); ?></option>
<option value="or"><?php _e('or', 'wp-ultimo'); ?></option>
</select>
<span
class="wu-uppercase wu-font-semibold wu-text-gray-600 wu-text-xs"
v-if="index > 1"
>
<span v-show="relation === 'and'"><?php _e('and', 'wp-ultimo'); ?></span>
<span v-show="relation === 'or'"><?php _e('or', 'wp-ultimo'); ?></span>
</span>
</div>
<div class="wu-w-2/12">
<select class="form-control wu-w-full" v-model="filter.field">
<option
v-for="available_filter in available_filters"
:value="available_filter.field"
v-html="available_filter.label"
>
&nbsp;
</option>
</select>
</div>
<div class="wu-w-2/12 wu-mx-2">
<select class="form-control wu-w-full" v-if="get_filter_type(filter.field) == 'bool'" v-model="filter.value">
<option value="1"><?php _e('is true.', 'wp-ultimo'); ?></option>
<option value="0"><?php _e('is false.', 'wp-ultimo'); ?></option>
</select>
<select class="form-control wu-w-full" v-if="get_filter_type(filter.field) == 'text'" v-bind:value="get_filter_rule(filter.field)">
<option value="is"><?php _e('is', 'wp-ultimo'); ?></option>
<option value="is_not"><?php _e('is not', 'wp-ultimo'); ?></option>
<option value="contains"><?php _e('contains', 'wp-ultimo'); ?></option>
<option value="does_not_contain"><?php _e('does not contain', 'wp-ultimo'); ?></option>
<option value="starts_with"><?php _e('starts with', 'wp-ultimo'); ?></option>
<option value="ends_with"><?php _e('ends with', 'wp-ultimo'); ?></option>
<option value="is_empty"><?php _e('is empty.', 'wp-ultimo'); ?></option>
<option value="is_not_empty"><?php _e('is not empty.', 'wp-ultimo'); ?></option>
</select>
<select class="form-control wu-w-full" v-if="get_filter_type(filter.field) == 'date'" v-bind:value="get_filter_rule(filter.field)">
<option value="before"><?php _e('is before', 'wp-ultimo'); ?></option>
<option value="after"><?php _e('is after', 'wp-ultimo'); ?></option>
</select>
</div>
<div class="wu-w-2/12">
<input
type="text"
class="form-control wu-w-full"
placeholder="<?php esc_attr_e('Value', 'wp-ultimo'); ?>"
v-if="_.contains(['text', 'date'], get_filter_type(filter.field)) && !_.contains(['is_empty', 'is_not_empty'], filter.rule)"
v-model="filter.value"
/>
</div>
<div class="wu-w-2/12 wu-self-center wu-mx-3">
<a
href="#"
v-on:click.prevent="remove_filter(index)"
class="button"
v-show="index > 0"
>
<?php _e('Remove Filter', 'wp-ultimo'); ?>
</a>
</div>
<div class="wu-w-3/12 wu-self-center">
<a
href="#"
v-on:click.prevent="add_new_filter"
class="button button-primary wu-float-right"
v-show="index === filters.length - 1"
>
<?php _e('Add new Filter', 'wp-ultimo'); ?>
</a>
</div>
</div>
</div>
</div>
</div>

17
views/base/grid.php Normal file
View File

@ -0,0 +1,17 @@
<?php
/**
* Grid view.
*
* @since 2.0.0
*/
?>
<?php $table->display_tablenav('top'); ?>
<div class="wu-mt-4 <?php echo implode( ' ', $table->get_table_classes() ); ?>">
<div id="the-list" class="wu-grid-content wu-grid wu-gap-4 wu-grid-cols-1 md:wu-grid-cols-2 lg:wu-grid-cols-3 xl:wu-grid-cols-4">
<?php $table->display_rows_or_placeholder(); ?>
</div>
</div>

117
views/base/list.php Normal file
View File

@ -0,0 +1,117 @@
<?php
/**
* List view.
*
* @since 2.0.0
*/
?>
<div id="wp-ultimo-wrap" class="<?php wu_wrap_use_container() ?> wrap wu-wrap <?php echo esc_attr($classes); ?>">
<h1 class="wp-heading-inline">
<?php echo $page->get_title(); ?>
<?php
/**
* You can filter the get_title_link using wu_page_list_get_title_link, see class-wu-page-list.php
*
* @since 1.8.2
*/
foreach ($page->get_title_links() as $action_link) :
$action_classes = isset($action_link['classes']) ? $action_link['classes'] : '';
?>
<a title="<?php echo esc_attr($action_link['label']); ?>" href="<?php echo esc_url($action_link['url']); ?>" class="page-title-action <?php echo esc_attr($action_classes); ?>">
<?php if ($action_link['icon']) : ?>
<span class="dashicons dashicons-<?php echo esc_attr($action_link['icon']); ?> wu-text-sm wu-align-middle wu-h-4 wu-w-4">
&nbsp;
</span>
<?php endif; ?>
<?php echo $action_link['label']; ?>
</a>
<?php endforeach; ?>
<?php
/**
* Allow plugin developers to add additional buttons to list pages
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_list_after_title', $page);
?>
</h1>
<?php if (isset($_GET['deleted'])) : ?>
<div id="message" class="updated notice wu-admin-notice notice-success is-dismissible below-h2">
<p><?php echo $page->get_labels()['deleted_message']; ?></p>
</div>
<?php endif; ?>
<?php
/**
* Allow plugin developers to add additional handlers to URL query redirects
*
* @since 2.0.0
*
* @param WP_Ultimo\Admin_Pages\Base_Admin_Page $page The page object.
*/
do_action('wu_page_list_redirect_handlers', $page);
?>
<hr class="wp-header-end">
<div id="poststuff">
<div id="post-body" class="">
<div id="post-body-content">
<div class="">
<?php $table->prepare_items(); ?>
<?php $table->filters(); ?>
<form id="posts-filter" method="post">
<input type="hidden" name="page" value="<?php echo $page->get_id(); ?>">
<?php $table->display(); ?>
</form>
</div>
<!-- /ui-sortable -->
</div>
<!-- /post-body-content -->
</div>
<!-- /post-body -->
<br class="clear">
</div>
<!-- /poststuff -->
<?php
/**
* Allow plugin developers to add scripts to the bottom of the page
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_list_footer', $page);
?>
</div>

View File

@ -0,0 +1,73 @@
<?php
/**
* Grid item view.
*
* @since 2.0.0
*/
?>
<div class="wu-border-transparent wu-flex wu-flex-col wu-justify-end" tabindex="0">
<div class="wu-border wu-border-solid wu-border-gray-300 wu-pb-8 wu-bg-white wu-flex wu-flex-col wu-h-full" >
<div class="wu-relative wu-flex-grow">
<?php
$featured_image = $item->get_featured_image('wu-thumb-medium');
if ($featured_image) {
?>
<img
style="opacity: 0.6; height: 16rem;"
class="wu-w-full"
src="<?php echo $featured_image; ?>"
/>
<div class="wu-my-4 wu-mx-3 wu-inline-block wu-absolute wu-bottom-0 wu-right-0 wu-rounded wu-px-2 wu-py-1 wu-uppercase wu-text-xs wu-font-bold <?php echo esc_attr($item->get_type_class()); ?>">
<?php echo $item->get_type_label(); ?>
</div>
<?php
} else {
?>
<div class="wu-w-full wu-bg-gray-200 wu-rounded wu-text-gray-600 wu-flex wu-items-center wu-justify-center wu-mr-3" style="height: 16rem;">
<span class="dashicons-wu-image wu-text-6xl"></span>
</div>
<div class="wu-my-4 wu-mx-3 wu-inline-block wu-absolute wu-bottom-0 wu-right-0 wu-rounded wu-px-2 wu-py-1 wu-uppercase wu-text-xs wu-font-bold <?php echo esc_attr($item->get_type_class()); ?>">
<?php echo $item->get_type_label(); ?>
</div>
<?php
}
?>
</div>
<div class="wu-text-base wu-mt-1 wu-px-3 wu-mt-3">
<div>
<span class="wu-font-semibold"><?php echo $item->get_name(); ?></span>
<!-- <small><?php echo $item->get_price_description(); ?></small> -->
</div>
<div class="wu-text-xs wu-my-1">
<?php echo $item->get_price_description(); ?>
</div>
</div>
<div class="site-secondary-info wu-mt-3"></div>
<div class="wu-flex wu-justify-between wu-items-center wu--mb-8 wu-p-4 wu-bg-gray-100 wu-border wu-border-solid wu-border-gray-300 wu-border-l-0 wu-border-r-0 wu-border-b-0">
<!-- <label>
<input class="wu-rounded-none" type="checkbox" name="bulk-delete[]" value="<?php echo $item->get_id(); ?>" />
<?php _e( 'Select Site', 'wp-ultimo' ); ?>
</label> -->
<a href="<?php echo wu_network_admin_url('wp-ultimo-edit-product', array('id' => $item->get_id())); ?>" class="button button-primary">
<?php _e('Read More', 'wp-ultimo'); ?>
</a>
</div>
</div>
</div>

View File

@ -0,0 +1,128 @@
<?php
/**
* Empty List Table View
*
* @since 2.0.0
*/
?>
<div class="wu-block">
<div class="wu-p-2 wu-flex">
<?php if ($args['image']) : ?>
<div class="wu-flex-shrink wu-mr-4 wu-items-center wu-justify-between wu-flex">
<?php echo $args['image']; ?>
</div>
<?php endif; ?>
<div class="wu-flex-grow">
<div class="wu-flex wu-items-center wu-justify-between">
<span class="wu-font-semibold wu-truncate wu-text-gray-700">
<?php echo $args['title']; ?>
<?php if ($args['id']) : ?>
<span class="wu-font-normal wu-text-xs">(#<?php echo $args['id']; ?>)</span>
<?php endif; ?>
</span>
<div class="wu-ml-2 wu-flex-shrink-0 wu-flex">
<?php echo $args['status']; ?>
</div>
</div>
<div class="sm:wu-flex sm:wu-justify-between wu-mt-1">
<div class="sm:wu-flex">
<?php $first = true; foreach ($first_row as $slug => $item) : $w_classes = wu_get_isset($item, 'wrapper_classes', ''); ?>
<?php if (wu_get_isset($item, 'url')) : ?>
<a title="<?php echo wu_get_isset($item, 'value', ''); ?>" href="<?php echo esc_attr($item['url']); ?>" class="wu-no-underline wu-flex wu-items-center wu-text-xs wp-ui-text-highlight <?php echo !$first ? 'sm:wu-mt-0 sm:wu-ml-6' : ''; ?> <?php echo $w_classes; ?>" <?php echo wu_tooltip_text($item['label']); ?>>
<span class="<?php echo esc_attr($item['icon']); ?>"></span>
<?php echo $item['value']; ?>
</a>
<?php else : ?>
<span class="wu-flex wu-items-center wu-text-xs wu-text-gray-600 <?php echo !$first ? 'sm:wu-mt-0 sm:wu-ml-6' : ''; ?> <?php echo $w_classes; ?>" <?php echo wu_get_isset($item, 'label') ? wu_tooltip_text($item['label']) : ''; ?>>
<span class="<?php echo esc_attr($item['icon']); ?>"></span>
<?php echo $item['value']; ?>
</span>
<?php endif; ?>
<?php $first = false; endforeach; ?>
</div>
<div class="sm:wu-flex wu-items-center wu-text-xs wu-text-gray-600 sm:wu-mt-0">
<?php $first = true; foreach ($second_row as $slug => $item) : $w_classes = wu_get_isset($item, 'wrapper_classes', ''); ?>
<?php if (wu_get_isset($item, 'url')) : ?>
<a title="<?php echo wu_get_isset($item, 'value', ''); ?>" href="<?php echo esc_attr($item['url']); ?>" class="wu-no-underline wu-flex wu-items-center wu-text-xs wp-ui-text-highlight <?php echo !$first ? 'sm:wu-mt-0 sm:wu-ml-6' : ''; ?> <?php echo $w_classes; ?>" <?php echo wu_tooltip_text($item['label']); ?>>
<span class="<?php echo esc_attr($item['icon']); ?>"></span>
<?php echo $item['value']; ?>
</a>
<?php else : ?>
<span class="wu-flex wu-items-center wu-text-xs wu-text-gray-600 <?php echo !$first ? 'sm:wu-mt-0 sm:wu-ml-6' : ''; ?> <?php echo $w_classes; ?> " <?php echo wu_get_isset($item, 'label') ? wu_tooltip_text($item['label']) : ''; ?>>
<span class="<?php echo esc_attr($item['icon']); ?>"></span>
<?php echo $item['value']; ?>
</span>
<?php endif; ?>
<?php $first = false; endforeach; ?>
</div>
</div>
</div>
<?php if ($args['url']) : ?>
<div class="wu-flex wu-ml-5 wu-flex-shrink-0 wu-items-center wu-justify-between">
<a href="<?php echo esc_attr($args['url']); ?>" title="<?php esc_attr_e('View', 'wp-ultimo'); ?>">
<svg class="wu-h-5 wu-w-5 wu-text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</a>
</div>
<?php endif; ?>
</div>
</div>

330
views/base/settings.php Normal file
View File

@ -0,0 +1,330 @@
<?php
/**
* Settings view.
*
* @since 2.0.0
*/
?>
<div id="wp-ultimo-wrap" class="<?php wu_wrap_use_container() ?> wrap wu-wrap <?php echo esc_attr($classes); ?>">
<h1 class="wp-heading-inline">
<?php echo $page->get_title(); ?>
<?php
/**
* You can filter the get_title_link using wu_page_list_get_title_link, see class-wu-page-list.php
*
* @since 1.8.2
*/
foreach ($page->get_title_links() as $action_link) :
$action_classes = isset($action_link['classes']) ? $action_link['classes'] : '';
?>
<a title="<?php echo esc_attr($action_link['label']); ?>" href="<?php echo esc_url($action_link['url']); ?>" class="page-title-action <?php echo esc_attr($action_classes); ?>">
<?php if ($action_link['icon']) : ?>
<span class="dashicons dashicons-<?php echo esc_attr($action_link['icon']); ?> wu-text-sm wu-align-middle wu-h-4 wu-w-4">
&nbsp;
</span>
<?php endif; ?>
<?php echo $action_link['label']; ?>
</a>
<?php endforeach; ?>
<?php
/**
* Allow plugin developers to add additional buttons to list pages
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_wizard_after_title', $page);
?>
</h1>
<?php if (wu_request('updated')) : ?>
<div id="message" class="updated notice wu-admin-notice notice-success is-dismissible below-h2">
<p><?php _e('Settings successfully saved.', 'wp-ultimo') ?></p>
</div>
<?php endif; ?>
<hr class="wp-header-end">
<form method="post">
<div id="poststuff" class="sm:wu-grid sm:wu-grid-cols-12 wu-gap-4">
<div class="sm:wu-col-span-4 lg:wu-col-span-2">
<div class="wu-py-4 wu-relative">
<input
data-model='setting'
data-value-field="setting_id"
data-label-field="title"
data-search-field="setting_id"
data-max-items="1"
selected type="text"
placeholder="Search Setting"
class="wu-w-full"
>
</div>
<div data-wu-app="settings_menu" data-state="{}">
<!-- Navigator -->
<ul>
<li class="md:wu-hidden wu-p-4 wu-font-bold wu-uppercase wu-text-xs wu-text-gray-700">
<?php _e('Menu', 'wp-ultimo'); ?>
</li>
<?php
/**
* We need to set a couple of flags in here to control clickable navigation elements.
* This flag makes sure only steps the user already went through are clickable.
*/
$is_pre_current_section = true;
/**
* Holds add-on menus
*/
$addons = array();
?>
<?php foreach ($sections as $section_name => $section) : ?>
<?php
if (wu_get_isset($section, 'invisible')) {
continue; // skip add-ons for now.
} // end if;
if (wu_get_isset($section, 'addon')) {
$addons[$section_name] = $section;
continue; // skip add-ons for now.
} // end if;
/**
* Updates the flag after the current section is looped.
*/
if ($current_section === $section_name) {
$is_pre_current_section = false;
} // end if;
?>
<!-- Menu Item -->
<li id="tab-selector-<?php echo esc_attr($section_name); ?>" class="wu-sticky">
<!-- Menu Link -->
<a
id="tab-selector-<?php echo esc_attr($section_name); ?>-link"
href="<?php echo esc_url($page->get_section_link($section_name)); ?>"
class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-sm wu-rounded <?php echo !$clickable_navigation && !$is_pre_current_section ? 'wu-pointer-events-none' : ''; ?> <?php echo $current_section === $section_name ? 'wu-bg-gray-300 wu-text-gray-800' : 'wu-text-gray-600 hover:wu-text-gray-700'; ?>"
>
<span class="<?php echo esc_attr($section['icon']); ?> wu-align-text-bottom wu-mr-1"></span>
<?php echo $section['title']; ?>
</a>
<!-- End Menu Link -->
<?php if (!empty($section['sub-sections'])) : ?>
<!-- Sub-menu -->
<ul class="classes" v-show="false" v-cloak>
<?php foreach ($section['sub-sections'] as $sub_section_name => $sub_section) : ?>
<li class="classes">
<a href="<?php echo esc_url($page->get_section_link($section_name)."#".$sub_section_name); ?>" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-gray-500 hover:wu-text-gray-600 wu-text-sm">
&rarr; <?php echo $sub_section['title']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<!-- End Sub-menu -->
<?php endif; ?>
</li>
<!-- End Menu Item -->
<?php endforeach; ?>
</ul>
<!-- End Navigator -->
<?php if (!empty($addons)) : ?>
<!-- Addon Navigator -->
<ul class="wu-pt-4">
<li class="wu-px-4 wu-font-bold wu-uppercase wu-text-xs wu-text-gray-700">
<?php _e('Add-ons', 'wp-ultimo'); ?>
</li>
<?php foreach ($addons as $section_name => $section) : ?>
<?php
/**
* Updates the flag after the current section is looped.
*/
if ($current_section === $section_name) {
$is_pre_current_section = false;
} // end if;
?>
<!-- Menu Item -->
<li class="wu-sticky">
<!-- Menu Link -->
<a href="<?php echo esc_url($page->get_section_link($section_name)); ?>" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-sm wu-rounded <?php echo !$clickable_navigation && !$is_pre_current_section ? 'wu-pointer-events-none' : ''; ?> <?php echo $current_section === $section_name ? 'wu-bg-gray-300 wu-text-gray-800' : 'wu-text-gray-600 hover:wu-text-gray-700'; ?>">
<span class="<?php echo esc_attr($section['icon']); ?> wu-align-text-bottom wu-mr-1"></span>
<?php echo $section['title']; ?>
</a>
<!-- End Menu Link -->
<?php if (!empty($section['sub-sections'])) : ?>
<!-- Sub-menu -->
<ul class="classes" v-show="false" v-cloak>
<?php foreach ($section['sub-sections'] as $sub_section_name => $sub_section) : ?>
<li class="classes">
<a href="<?php echo esc_url($page->get_section_link($section_name)."#".$sub_section_name); ?>" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-gray-500 hover:wu-text-gray-600 wu-text-sm">
&rarr; <?php echo $sub_section['title']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<!-- End Sub-menu -->
<?php endif; ?>
</li>
<!-- End Menu Item -->
<?php endforeach; ?>
</ul>
<!-- End Addon Navigator -->
<?php endif; ?>
</div>
</div>
<div class="sm:wu-col-span-8 lg:wu-col-span-6 metabox-holder">
<div class="wu-relative">
<?php
/**
* Print Side Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'normal', false);
?>
</div>
</div>
<div class="sm:wu-col-span-8 sm:wu-col-start-5 lg:wu-col-span-3 lg:wu-col-start-10 metabox-holder">
<?php
/**
* Print Normal Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes('wu_settings_admin_page', 'side', false);
?>
</div>
</div>
<?php
/**
* Allow plugin developers to add scripts to the bottom of the page
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_wizard_footer', $page);
?>
<?php wp_nonce_field(sprintf('saving_%s', $current_section), sprintf('saving_%s', $current_section), false); ?>
<?php wp_nonce_field(sprintf('saving_%s', $current_section), '_wpultimo_nonce'); ?>
</form>
</div>
<script type="text/javascript">
/** Not a huge fan of having this here, but it's better than having
a file for this alone. */
settings_loader = wu_block_ui('#wp-ultimo-wizard-body');
/**
* Remove the block ui after the settings loaded.
*
* @since 2.0.0
* @return void
*/
function remove_block_ui() {
settings_loader.unblock();
} // end remove_block_ui;
</script>

View File

@ -0,0 +1,84 @@
<?php
/**
* grid item view.
*
* @since 2.0.0
*/
?>
<div class="wu-border-transparent" tabindex="0">
<div class="wu-grid-item wu-border wu-border-solid wu-border-gray-300 wu-pb-8 wu-bg-white">
<div class="wu-relative wu-bg-gray-100" style="max-height: 220px; overflow: hidden;">
<img
style="opacity: 0.6;"
class="wu-w-full wu-h-auto wu-image-preview"
data-image="<?php echo $item->get_featured_image('large'); ?>"
src="<?php echo $item->get_featured_image('wu-thumb-medium'); ?>"
/>
<?php if (current_user_can('wu_read_sites')) : ?>
<div class="wu-my-4 wu-mx-3 wu-inline-block wu-absolute wu-bottom-0 wu-right-0 wu-rounded wu-px-2 wu-py-1 wu-uppercase wu-text-xs wu-font-bold <?php echo esc_attr($item->get_type_class()); ?>">
<?php echo $item->get_type_label(); ?>
</div>
<?php endif; ?>
</div>
<div class="wu-text-base wu-px-3 wu-my-3">
<div>
<span class="wu-font-semibold"><?php echo $item->get_title(); ?></span>
<small><?php echo $item->get_id() ? '#'.$item->get_id() : ''; ?></small>
</div>
<div class="wu-text-xs wu-my-1">
<a class="wu-no-underline" href="<?php echo $item->get_active_site_url(); ?>"><?php echo $item->get_active_site_url(); ?></a>
</div>
</div>
<div class="wu-flex wu-justify-between wu-items-center wu--mb-8 wu-p-4 wu-bg-gray-100 wu-border wu-border-solid wu-border-gray-300 wu-border-l-0 wu-border-r-0 wu-border-b-0">
<?php if ($item->get_type() !== 'main') : ?>
<?php if ($item->get_type() === 'pending') : ?>
<label>
<input class="wu-rounded-none" type="checkbox" name="bulk-delete[]" value="<?php echo $item->get_membership_id(); ?>" />
<?php _e( 'Select Site', 'wp-ultimo' ); ?>
</label>
<a title="<?php echo esc_attr(__('Publish pending site', 'wp-ultimo')); ?>" href="<?php echo wu_get_form_url('publish_pending_site', array('membership_id' => $item->get_membership_id())); ?>" class="wubox button button-primary">
<?php _e('Publish Site', 'wp-ultimo'); ?>
</a>
<?php else : ?>
<label>
<input class="wu-rounded-none" type="checkbox" name="bulk-delete[]" value="<?php echo $item->get_id(); ?>" />
<?php _e( 'Select Site', 'wp-ultimo' ); ?>
</label>
<a href="<?php echo wu_network_admin_url('wp-ultimo-edit-site', array('id' => $item->get_id())); ?>" class="button button-primary">
<?php _e('Manage', 'wp-ultimo'); ?>
</a>
<?php endif; ?>
<?php else : ?>
<span>&nbsp;</span>
<a href="<?php echo wu_network_admin_url('wp-ultimo-edit-site', array('id' => $item->get_id())); ?>" class="button button-primary">
<?php _e('See Main Site', 'wp-ultimo'); ?>
</a>
<?php endif; ?>
</div>
</div>
</div>

View File

170
views/base/wizard.php Normal file
View File

@ -0,0 +1,170 @@
<?php
/**
* Wizard view.
*
* @since 2.0.0
*/
?>
<div id="wp-ultimo-wrap" class="wrap wu-wrap <?php echo esc_attr($classes); ?>">
<h1 class="wp-heading-inline">
<!-- This is here for admin notices placement only -->
</h1>
<?php if ($logo) : ?>
<div class="wu-text-center">
<img style="width: 200px;" src="<?php echo esc_attr($logo); ?>" alt="">
</div>
<?php endif; ?>
<?php if (isset($_GET['deleted'])) : ?>
<div id="message" class="updated notice wu-admin-notice notice-success is-dismissible below-h2">
<p><?php echo $page->labels['deleted_message']; ?></p>
</div>
<?php endif; ?>
<hr class="wp-header-end">
<div id="poststuff" class="md:wu-flex wu-mr-4 md:wu-mr-0">
<div class="md:wu-w-2/12 wu-pt-10">
<span class="wu-uppercase wu-block wu-px-4 wu-text-gray-700 wu-font-bold">
<?php echo $page->get_title(); ?>
</span>
<?php
/**
* Allow plugin developers to add additional buttons to list pages
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_wizard_after_title', $page);
?>
<!-- Navigator -->
<ul class="">
<?php
/**
* We need to set a couple of flags in here to control clickable navigation elements.
* This flag makes sure only steps the user already went through are clickable.
*/
$is_pre_current_section = true;
?>
<?php foreach ($sections as $section_name => $section) : ?>
<?php
/**
* Updates the flag after the current section is looped.
*/
if ($current_section === $section_name) {
$is_pre_current_section = false;
} // end if;
?>
<?php if (wu_get_isset($section, 'separator')) : ?>
<!-- Separator Item -->
<li class="wu-sticky wu-py-2 wu-px-4">&nbsp;</li>
<?php else : ?>
<!-- Menu Item -->
<li class="wu-sticky">
<!-- Menu Link -->
<a href="<?php echo esc_url($page->get_section_link($section_name)); ?>" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-sm wu-rounded <?php echo !$clickable_navigation && !$is_pre_current_section ? 'wu-pointer-events-none' : ''; ?> <?php echo $current_section === $section_name ? 'wu-bg-gray-300 wu-text-gray-800' : 'wu-text-gray-600 hover:wu-text-gray-700'; ?>">
<?php echo $section['title']; ?>
</a>
<!-- End Menu Link -->
<?php if (!empty($section['sub-sections'])) : ?>
<!-- Sub-menu -->
<ul class="classes">
<?php foreach ($section['sub-sections'] as $sub_section_name => $sub_section) : ?>
<li class="classes">
<a href="#" class="wu-block wu-py-2 wu-px-4 wu-no-underline wu-text-gray-500 hover:wu-text-gray-600 wu-text-sm">
&rarr; <?php echo $sub_section['title']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<!-- End Sub-menu -->
<?php endif; ?>
</li>
<!-- End Menu Item -->
<?php endif; ?>
<?php endforeach; ?>
</ul>
<!-- End Navigator -->
</div>
<div class="md:wu-w-8/12 wu-px-4 metabox-holder">
<form method="post" id="<?php echo esc_attr($form_id); ?>">
<?php
/**
* Print Side Metaboxes
*
* Allow plugin developers to add new metaboxes
*
* @since 1.8.2
* @param object Object being edited right now
*/
do_meta_boxes($screen->id, 'normal', false);
?>
<?php wp_nonce_field(sprintf('saving_%s', $current_section), sprintf('saving_%s', $current_section), false); ?>
<?php wp_nonce_field(sprintf('saving_%s', $current_section), '_wpultimo_nonce'); ?>
</form>
</div>
</div>
<?php
/**
* Allow plugin developers to add scripts to the bottom of the page
*
* @since 1.8.2
* @param WU_Page WP Ultimo Page instance
*/
do_action('wu_page_wizard_footer', $page);
?>
</div>

View File

@ -0,0 +1,24 @@
<?php
/**
* Submit box view.
*
* @since 2.0.0
*/
?>
<!-- Submit Box -->
<div class="wu-flex wu-justify-between wu-bg-gray-100 wu--m-in wu-mt-4 wu-p-4 wu-overflow-hidden wu-border-t wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300">
<a href="<?php echo esc_url($page->get_prev_section_link()); ?>" class="wu-self-center button button-large wu-float-left">
<?php _e('&larr; Go Back', 'wp-ultimo'); ?>
</a>
<span class="wu-self-center wu-content-center wu-flex">
<button name="submit" value="1" class="button button-primary button-large">
<?php _e('Continue', 'wp-ultimo'); ?>
</button>
</span>
</div>
<!-- End Submit Box -->

View File

@ -0,0 +1,119 @@
<?php
/**
* HTML email template
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/emails/base.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
} // end if;
?>
<?php if (!$is_editor) : ?>
<!DOCTYPE html>
<html style="">
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php echo $subject; ?></title>
</head>
<?php endif; ?>
<body style="line-height: 1.6em; -webkit-font-smoothing: antialiased; height: 100%; -webkit-text-size-adjust: none; width: 100% !important; margin: 0; padding: 0; background-color:#f6f6f6">
<table style="line-height: 1.6em; width: 100%; margin: 0; padding: 20px;">
<tr style="">
<td style=""></td>
<td style="line-height: 1.6em; clear: both !important; display: block !important; max-width: 600px !important; margin: 0 auto; padding: 20px; border: 1px solid #f0f0f0;background-color:#FFFFFF">
<div style="line-height: 1.6em; display: block; max-width: 600px; margin: 0 auto; padding: 0;">
<table style="line-height: 1.6em; width: 100%; margin: 0; padding: 0;">
<tr>
<td style="background: <?php echo $template_settings['background_color']; ?>; text-align: center; padding: 20px 40px; /* margin: -20px; */">
<a style="" href="<?php echo $site_url; ?>">
<?php if ($template_settings['use_custom_logo'] && $template_settings['custom_logo']) : ?>
<img style="max-width: 280px; width: auto; max-height: 70px;" src="<?php echo wp_get_attachment_url($template_settings['custom_logo']); ?>" alt="<?php echo esc_attr($site_name); ?>">
<?php else : ?>
<img style="max-width: 280px; width: auto; max-height: 70px;" src="<?php echo esc_attr($logo_url); ?>" alt="<?php echo esc_attr($site_name); ?>">
<?php endif; ?>
</a>
</td>
</tr>
<tr style="">
<td style="">
<span style="font-family: <?php echo $template_settings['content_font']; ?>; font-size: 14px; line-height: 1.6em; color: <?php echo $template_settings['content_color']; ?>; font-weight: normal; margin: 0 0 10px; padding: 0; text-align: <?php echo $template_settings['content_align']; ?>;"><?php echo $content; ?></span>
<br>
</td>
</tr>
</table>
</div>
</td>
<td style=""></td>
</tr>
</table>
<table style="line-height: 1.6em; clear: both !important; width: 100%; margin: 0; padding: 0;">
<tr style="">
<td style=""></td>
<td style="line-height: 1.6em; clear: both !important; display: block !important; max-width: 600px !important; margin: 0 auto; padding: 0;">
<div style="line-height: 1.6em; display: block; max-width: 600px; margin: 0 auto; padding: 0;">
<table style="line-height: 1.6em; width: 100%; margin: 0; padding: 0;">
<?php if ($template_settings['footer_text']) : ?>
<tr style="">
<td style=" text-align: center;">
<p style="font-family: <?php echo $template_settings['footer_font']; ?>; font-size: 12px; line-height: 1.6m; color: <?php echo $template_settings['footer_color']; ?>; font-weight: normal; margin: 0 0 10px; padding: 0; text-align: <?php echo $template_settings['footer_align']; ?>">
<?php echo $template_settings['footer_text']; ?>
</p>
</td>
</tr>
<?php endif; ?>
<?php if ($template_settings['display_company_address']) : ?>
<tr style="">
<td style=" text-align: center;">
<p style="font-family: <?php echo $template_settings['footer_font']; ?>; font-size: 12px; line-height: 1.6m; color: <?php echo $template_settings['footer_color']; ?>; font-weight: normal; margin: 0 0 10px; padding: 0; text-align: <?php echo $template_settings['footer_align']; ?>">
<strong><?php echo wu_get_setting('company_name'); ?></strong><br>
<?php echo nl2br(wu_get_setting('company_address', array())); ?>
</p>
</td>
</tr>
<?php endif; ?>
<tr style="">
<td style=" text-align: center;">
<p style="font-family: <?php echo $template_settings['footer_font']; ?>; font-size: 12px; line-height: 1.6m; color: <?php echo $template_settings['footer_color']; ?>; font-weight: normal; margin: 0 0 10px; padding: 0; text-align: <?php echo $template_settings['footer_align']; ?>">
<a href="<?php echo $site_url; ?>" style="line-height: 1.6em; color: #999999; margin: 0; padding: 0;">
<?php echo esc_attr($site_name); ?>
</a>
</p>
</td>
</tr>
</table>
</div>
</td>
<td style=""></td>
</tr>
</table>
</body>
<?php if (!$is_editor) : ?>
</html>
<?php endif; ?>

View File

@ -0,0 +1,29 @@
<?php
/**
* HTML plain template
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/emails/plain.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
?>
{{subject}}
{{content}}
--
{{site_name}} - {{site_url}}

View File

@ -0,0 +1,70 @@
<?php
/**
* Targets
*
* @since 2.0.0
*/
?>
<div class="<?php echo esc_attr($wrapper_class); ?>">
<?php if ($targets) : ?>
<ul class="wu-widget-list">
<?php foreach ($targets as $target_key => $target) : ?>
<li class="wu-p-2 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-200 wu-border-solid">
<a title="<?php echo $target['display_name']; ?>" href='<?php echo $target['link'] ?>' class='<?php echo $modal_class; ?> wu-table-card wu-text-gray-700 wu-p-2 wu-flex wu-flex-grow wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-no-underline'>
<div class="wu-flex wu-relative wu-h-6 wu-w-6 wu-rounded-full wu-ring-2 wu-mx-4 wu-my-2 wu-box-border wu-ring-white wu-bg-gray-300 wu-items-center wu-justify-center">
<?php echo $target['avatar']; ?>
</div>
<div class='wu-pl-2'>
<strong class='wu-block'><?php echo $target['display_name']; ?><small class='wu-font-normal'> (#<?php echo $target['id']; ?>)</small></strong>
<small><?php echo $target['description']; ?></small>
</div>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php else : ?>
<ul class="wu-widget-list">
<li class="wu-p-2 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-400 wu-border-solid">
<div class="wu-p-2 wu-mr-1 wu-flex wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-bg-white wu-relative wu-overflow-hidden">
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'>&nbsp;</span>
<div class=''>
<span class='wu-block wu-py-3 wu-text-gray-600 wu-text-2xs wu-font-bold wu-uppercase'>
<?php echo esc_html(__('No Targets', 'wp-ultimo')); ?>
</span>
</div>
</div>
</li>
</ul>
<?php endif; ?>
</div>

View File

@ -0,0 +1,62 @@
<?php
/**
* Confirmation view.
*
* @since 2.0.0
*/
?>
<div class="wu-styling">
<p>Thank you for your membership to wphunt.org. Your Teste 2 membership is now active.</p>
<p>Below are details about your membership account and a receipt for your initial membership invoice. A welcome email with a copy of your initial membership invoice has been sent to arindo@wpultimo.com.</p>
<p>Extra message</p>
<h3>
Invoice #DF232BD72B on May 2, 2020
</h3>
<a class="pmpro_a-print" href="javascript:window.print()">Print</a>
<ul>
<li><strong>Account:</strong> aanduque (arindo@wpultimo.com)</li>
<li><strong>Membership Level:</strong> Teste 2</li>
</ul>
<hr>
<div class="pmpro_invoice_details">
<div class="pmpro_invoice-billing-address">
<strong>Billing Address</strong>
<p>Quynn Mullins<br>
869 North New Court Est voluptas repudia<br>
Voluptatem aut omni, Cupidatat quaerat ea 60807 MG<br>
+1 (759) 534-9321 </p>
</div> <!-- end pmpro_invoice-billing-address -->
<div class="pmpro_invoice-payment-method">
<strong>Payment Method</strong>
<p>Unknown Card Type ending in XXX0</p>
<p>Expiration: 12/2026</p>
</div> <!-- end pmpro_invoice-payment-method -->
<div class="pmpro_invoice-total">
<strong>Total Billed</strong>
<p> $190.00
</p>
</div> <!-- end pmpro_invoice-total -->
</div>
<hr>
<nav id="nav-below" class="navigation" role="navigation">
<div class="nav-next alignright">
<a href="https://wphunt.org/?page_id=28">View Your Membership Account →</a>
</div>
</nav>
</div>

View File

@ -0,0 +1,46 @@
<?php
/**
* Checkbox multi field view.
*
* @since 2.0.0
*/
?>
<div 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('checkout/fields/partials/field-title', array(
'field' => $field,
));
?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>[]" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<?php echo $option_name; ?>
</label>
<?php endforeach; ?>
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
</div>

View File

@ -0,0 +1,34 @@
<?php
/**
* Checkbox field view.
*
* @since 2.0.0
*/
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<?php echo $field->title; ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo $field->desc; ?>
</label>
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
</div>

View File

@ -0,0 +1,8 @@
<?php
/**
* Clear field view.
*
* @since 2.0.0
*/
?>
<span class="wu-clear-both wu-block"></span>

View File

@ -0,0 +1,65 @@
<?php
/**
* Group field view.
*
* @since 2.0.0
*/
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<span 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('checkout/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' => 'checkout/fields',
'classes' => 'wu-flex wu-my-1',
'field_wrapper_classes' => 'wu-bg-transparent',
'wrap_tag' => 'span',
'step' => (object) array(
'classes' => '',
),
));
$form->render();
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
<?php if ($field->desc) : ?>
<span 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; ?>
</span>
<?php endif; ?>
</span>
</div>

View File

@ -0,0 +1,33 @@
<?php
/**
* Hidden field view.
*
* @since 2.0.0
*/
?>
<?php if (is_array($field->value)) : ?>
<?php foreach ($field->value as $index => $value) : ?>
<input id="field-<?php echo esc_attr($field->id).'-'.esc_attr($index); ?>" 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($value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php endforeach; ?>
<?php else : ?>
<input id="field-<?php echo esc_attr($field->id); ?>" 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 error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>

View File

@ -0,0 +1,53 @@
<?php
/**
* HTML field view.
*
* @since 2.0.0
*/
?>
<div 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('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial description template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-description', array(
'field' => $field,
));
?>
<div class="wu-block wu-w-full wu-mt-4">
<?php echo $field->content; ?>
</div>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
</div>
</div>

View File

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

View File

@ -0,0 +1,55 @@
<?php
/**
* Password field view.
*
* @since 2.0.0
*/
?>
<div 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('checkout/fields/partials/field-title', array(
'field' => $field,
));
?>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" 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 if ($field->meter) : ?>
<span class="wu-block">
<span id="pass-strength-result" class="wu-py-2 wu-px-4 wu-bg-gray-100 wu-block wu-text-sm">
<?php _e('Strength Meter', 'wp-ultimo'); ?>
</span>
</span>
<?php endif; ?>
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
<!--
<div class="wu-border-red-300"></div>
<div class="wu-border-yellow-300"></div>
-->
</div>

View File

@ -0,0 +1,79 @@
<?php
/**
* Payment methods field view.
*
* @since 2.0.0
*/
$active_gateways = wu_get_active_gateway_as_options();
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" v-cloak v-show="order && order.should_collect_payment" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
?>
<?php foreach ($active_gateways as $option_value => $option_name) : ?>
<?php if (count($active_gateways) === 1) : ?>
<input
id="field-gateway"
type="hidden"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
<?php echo $field->get_html_attributes(); ?>
>
<?php else : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<input
id="field-gateway-<?php echo esc_attr($option_value); ?>"
type="radio"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
class="<?php echo trim($field->classes); ?>"
<?php echo $field->get_html_attributes(); ?>
<?php checked($field->value == $option_value); ?>
>
<?php echo $option_name; ?>
</label>
<?php endif; ?>
<?php endforeach; ?>
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Load Gateway fields
* @since 2.0.0
*/
do_action('wu_checkout_gateway_fields');
?>
</div>

View File

@ -0,0 +1,46 @@
<?php
/**
* Products field view.
*
* @since 2.0.0
*/
?>
<div 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('checkout/fields/partials/field-title', array(
'field' => $field,
));
?>
<?php foreach (wu_get_plans() as $option) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option->get_id()); ?>">
<input id="field-products-<?php echo esc_attr($option->get_id()); ?>" type="checkbox" name="products[]" value="<?php echo esc_attr($option->get_id()); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option->get_id()); ?> v-model="products">
<?php echo $option->get_name(); ?>
</label>
<?php endforeach; ?>
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
</div>

View File

@ -0,0 +1,46 @@
<?php
/**
* Radio field view.
*
* @since 2.0.0
*/
?>
<div 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('checkout/fields/partials/field-title', array(
'field' => $field,
));
?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="radio" name="<?php echo esc_attr($field->id); ?>" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<?php echo $option_name; ?>
</label>
<?php endforeach; ?>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
</div>

View File

@ -0,0 +1,67 @@
<?php
/**
* Select field view.
*
* @since 2.0.0
*/
?>
<div 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('checkout/fields/partials/field-title', array(
'field' => $field,
));
?>
<select
class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>"
id="field-<?php echo esc_attr($field->id); ?>"
name="<?php echo esc_attr($field->id); ?>"
value="<?php echo esc_attr($field->value); ?>"
<?php echo $field->get_html_attributes(); ?>
>
<?php if ($field->placeholder) : ?>
<option <?php checked(!$field->value); ?> class="wu-opacity-75"><?php echo $field->placeholder; ?></option>
<?php endif; ?>
<?php foreach ($field->options as $key => $label) : ?>
<option
value="<?php echo esc_attr($key); ?>"
<?php checked($key, $field->value); ?>
>
<?php echo $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('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
</div>

View File

@ -0,0 +1,16 @@
<?php
/**
* Submit field view.
*
* @since 2.0.0
*/
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<button id="<?php echo esc_attr($field->id); ?>-btn" type="submit" name="<?php echo esc_attr($field->id); ?>-btn" <?php echo $field->get_html_attributes(); ?> class="button <?php echo esc_attr(trim($field->classes)); ?>">
<?php echo $field->title; ?>
</button>
</div>

View File

@ -0,0 +1,60 @@
<?php
/**
* Text field view.
*
* @since 2.0.0
*/
?>
<div 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('checkout/fields/partials/field-title', array(
'field' => $field,
));
?>
<?php if ($field->prefix) : ?>
<div class="sm:wu-flex wu-items-stretch wu-content-center">
<div <?php echo wu_array_to_html_attrs($field->prefix_html_attr ?? array()); ?>>
<?php echo $field->prefix; ?>
</div>
<?php endif; ?>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" 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 if ($field->suffix) : ?>
<div <?php echo wu_array_to_html_attrs($field->suffix_html_attr ?? array()); ?>>
<?php echo $field->suffix; ?>
</div>
<?php endif; ?>
<?php if ($field->prefix || $field->suffix) : ?>
</div>
<?php endif; ?>
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
</div>

View File

@ -0,0 +1,34 @@
<?php
/**
* Checkbox field view.
*
* @since 2.0.0
*/
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<?php echo $field->title; ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo $field->desc; ?>
</label>
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
?>
</div>

View File

@ -0,0 +1,34 @@
<?php
/**
* Form fields view.
*
* @since 2.0.0
*/
?>
<?php if ($form->wrap_in_form_tag) : ?>
<form id="<?php echo esc_attr($form_slug); ?>" method="<?php echo esc_attr($form->method); ?>" <?php echo $form->get_html_attributes(); ?>>
<?php else : ?>
<<?php echo $form->wrap_tag; ?> class="<?php echo esc_attr(trim($form->classes ? $form->classes.' '.$step->classes.' wu-mt-2' : $step->classes.' wu-mt-2')); ?>" <?php echo $form->get_html_attributes(); ?>>
<?php endif; ?>
<?php if ($form->title) : ?>
<h3 class="wu-checkout-section-title"><?php echo $form->title; ?></h3>
<?php endif; ?>
<?php echo $rendered_fields; ?>
<?php if ($form->wrap_in_form_tag) : ?>
</form>
<?php else : ?>
</<?php echo $form->wrap_tag; ?>>
<?php endif; ?>

View File

@ -0,0 +1,13 @@
<?php
/**
* Title field partial view.
*
* @since 2.0.0
*/
?>
<?php if ($field->desc) : ?>
<?php echo $field->desc; ?>
<?php endif; ?>

View File

@ -0,0 +1,14 @@
<?php
/**
* Errors field partial view.
*
* @since 2.0.0
*/
?>
<span
v-cloak
class="wu-block wu-bg-red-100 wu-p-2 wu-mb-4"
v-if="get_error('<?php echo esc_attr($field->id); ?>')"
v-html="get_error('<?php echo esc_attr($field->id); ?>').message"
></span>

View File

@ -0,0 +1,25 @@
<?php
/**
* Title field partial view.
*
* @since 2.0.0
*/
?>
<?php if ($field->title) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>">
<?php echo $field->title; ?>
<?php if ($field->required) : ?>
<span class="wu-checkout-required-field wu-text-red-500">*</span>
<?php endif; ?>
<?php echo wu_tooltip($field->tooltip); ?>
</label>
<?php endif; ?>

78
views/checkout/form.php Normal file
View File

@ -0,0 +1,78 @@
<?php
/**
* Form view.
*
* @since 2.0.0
*/
?>
<div class="wu-styling">
<form
id="wu_form"
method="post"
class="wu_checkout_form_<?php echo esc_attr($checkout_form_name); ?> wu-relative"
<?php echo isset($checkout_form_action) ? 'action="'.esc_attr($checkout_form_action).'"' : ''; ?>
>
<?php
/**
* Display possible errors with the checkout.
*/
do_action('wu_checkout_errors', $checkout_form_name);
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$form = new \WP_Ultimo\UI\Form("checkout-{$step_name}", $final_fields, array(
'title' => $display_title ? $step['name'] : '',
'views' => 'checkout/fields',
'classes' => wu_get_isset($step, 'classes', '').' wu-grid wu-grid-cols-2 wu-gap-4',
'field_wrapper_classes' => 'wu-col-span-2',
'html_attr' => array(
'id' => wu_get_isset($step, 'element_id') ? wu_get_isset($step, 'element_id') : "wu-step-{$step_name}",
),
'variables' => array(
'step' => (object) $step,
),
));
/**
* Render form fields.
*
* @see /view/checkout/fields/ for the template files for each field type.
* @since 2.0.0
*/
$form->render();
/**
* Add a security nonce field.
*/
wp_nonce_field('wu_checkout');
?>
<input type="hidden" name="checkout_action" value="wu_checkout">
<input type="hidden" name="checkout_step" value="<?php echo esc_attr($step_name); ?>">
<input type="hidden" name="checkout_form" value="<?php echo esc_attr($checkout_form_name); ?>">
</form>
<?php
/**
* Renders additional things after the form ios over.
*/
do_action("wu_checkout_{$checkout_form_name}_after_form");
/**
* Allow to add after our checkout form.
*/
do_action('wu_checkout_after_form');
?>
</div>

View File

@ -0,0 +1,68 @@
<?php
/**
* Template File: Basic Pricing Table.
*
* To see what methods are available on the product variable, @see inc/models/class-producs.php.
*
* This template can also be overrid using template overrides.
* See more here: https://help.wpultimo.com/article/335-template-overrides.
*
* @since 2.0.0
* @param array $products List of product objects.
* @param string $name ID of the field.
* @param string $label The field label.
*/
?>
<?php if (empty($products)) : ?>
<div class="wu-text-center wu-bg-gray-100 wu-rounded wu-uppercase wu-font-semibold wu-text-xs wu-text-gray-700 wu-p-4">
<?php _e('No Products Found.', 'wp-ultimo'); ?>
</div>
<?php endif; ?>
<div class="wu-flex wu-mb-4 wu--mx-2">
<?php foreach ($products as $product) : ?>
<div
class="<?php echo "wu-product-{$product->get_id()}"; ?> wu-bg-gray-100 wu-m-2 wu-px-4 wu-py-4 wu-border wu-border-solid wu-rounded wu-border-gray-400 wu-box-border wu-flex-1 wu-flex wu-flex-col wu-justify-end"
>
<div class="wu-self-start">
<span class="wu-font-bold wu-block wu-text-xl"><?php echo $product->get_name(); ?></span>
<span class="wu-block wu-font-semibold"><?php echo $product->get_price_description(false); ?></span>
</div>
<div class="wu-my-4">
<ul class="wu-m-0 wu-list-none">
<?php foreach ($product->get_pricing_table_lines() as $key => $line) : ?>
<li class="<?php echo str_replace('_', '-', $key); ?>"><?php echo $line; ?></li>
<?php endforeach; ?>
</ul>
</div>
<div class="wu-relative">
<a href="#wu-checkout-add-<?php echo $product->get_slug(); ?>" class="button btn wu-w-full wu-text-center wu-inline-block">
<?php _e('Select', 'wp-ultimo'); ?>
</a>
</div>
<input type="checkbox" style="display: none;" name="products[]" value="<?php echo $product->get_slug(); ?>" v-model="products">
</div>
<?php endforeach; ?>
</div>

View File

@ -0,0 +1,184 @@
<?php
/**
* Confirm paypal view.
*
* @since 2.0.0
*/
$is_trial_setup = $membership->is_trialing() && empty($payment->get_total());
$notes = array();
if ($is_trial_setup) {
$desc = $membership->get_recurring_description();
$date = wp_date(get_option('date_format'), strtotime( $membership->get_date_trial_end(), wu_get_current_time('timestamp', true)));
$notes[] = sprintf(__('Your trial period will end on %1$s.', 'wp-ultimo'), $date);
} // end if;
$original_cart = $payment->get_meta('wu_original_cart');
$should_auto_renew = !empty($original_cart) ? $original_cart->should_auto_renew() : false;
$recurring_total = $membership->get_amount();
if ($membership->is_recurring() && $should_auto_renew) {
$payment_total = $payment->get_total() ? $payment->get_total() : $membership->get_initial_amount();
$desc = $membership->get_recurring_description();
if ($recurring_total !== $payment_total) {
$recurring_total_format = wu_format_currency($recurring_total, $payment->get_currency());
if ($original_cart->get_cart_type() === 'downgrade') {
$subtotal = wu_format_currency($payment->get_subtotal(), $payment->get_currency());
if ($is_trial_setup) {
$notes[] = sprintf(__('Your updated membership will start on $1$s, from that date you will be billed %2$s %3$s.', 'wp-ultimo'), $date, $subtotal, $desc);
} else {
$date_renew = wp_date(get_option('date_format'), strtotime( $membership->get_date_expiration(), wu_get_current_time('timestamp', true)));
$notes[] = sprintf(__('Your updated membership will start on %1$s, from that date you will be billed %2$s %3$s.', 'wp-ultimo'), $date_renew, $subtotal, $desc);
} // end if;
} elseif ($is_trial_setup) {
$initial_amount_format = wu_format_currency($membership->get_initial_amount(), $payment->get_currency());
$notes[] = sprintf(__('After the first payment of %1$s you will be billed %2$s %3$s.', 'wp-ultimo'), $initial_amount_format, $recurring_total_format, $desc);
} else {
$notes[] = sprintf(__('After this payment you will be billed %1$s %2$s.', 'wp-ultimo'), $recurring_total_format, $desc);
} // end if;
} else {
$recurring_total_format = wu_format_currency($recurring_total, $payment->get_currency());
if ($is_trial_setup) {
$notes[] = sprintf(__('From that date, you will be billed %1$s %2$s.', 'wp-ultimo'), $recurring_total_format, $desc);
} else {
$notes[] = sprintf(__('After this payment you will be billed %1$s.', 'wp-ultimo'), $desc);
} // end if;
} // end if;
} // end if;
$note = implode(' ', $notes);
$subtotal = 0;
?>
<form id="wu-paypal-express-confirm-form" class="wu-styling" action="<?php echo esc_url(add_query_arg('wu-confirm', 'paypal')); ?>" method="post">
<div class="wu-confirm-details" id="billing_info">
<h2><?php _e('Please confirm your payment', 'wp-ultimo'); ?></h2>
<div class="wu-text-sm wu-mb-4 wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4">
<span class="wu-font-semibold wu-block wu-text-gray-900">
<?php echo sprintf('%s %s', wu_get_isset($checkout_details, 'FIRSTNAME', ''), wu_get_isset($checkout_details, 'LASTNAME', '')); ?>
</span>
<div class="wu-text-gray-600">
<p>
<?php _e('PayPal Status:', 'wp-ultimo'); ?> <?php echo ucfirst(wu_get_isset($checkout_details, 'PAYERSTATUS', 'none')); ?>
<br><?php _e('Email:', 'wp-ultimo'); ?> <?php echo wu_get_isset($checkout_details, 'EMAIL', '--'); ?>
</p>
</div>
</div>
</div>
<table class="wu-w-full wu-mb-4">
<thead class="wu-bg-gray-100">
<tr>
<th class="wu-text-left wu-py-2 wu-px-4"><?php _e('Product', 'wp-ultimo'); ?></th>
<th class="wu-text-left wu-py-2 wu-px-4"><?php _e('Total', 'wp-ultimo'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($payment->get_line_items() as $line_item) :
$subtotal += $line_item->get_subtotal();
?>
<tr>
<td class="wu-py-2 wu-px-4">
<?php echo $line_item->get_title(); ?>
<code class="wu-ml-1">x<?php echo $line_item->get_quantity(); ?></code>
</td>
<td class="wu-py-2 wu-px-4">
<?php echo wu_format_currency($line_item->get_subtotal(), $payment->get_currency()); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot class="wu-bg-gray-100">
<tr>
<th class="wu-text-left wu-py-2 wu-px-4"><?php _e('Subtotal', 'wp-ultimo'); ?></th>
<th class="wu-text-left wu-py-2 wu-px-4"><?php echo wu_format_currency($subtotal, $payment->get_currency()); ?></th>
</tr>
<?php foreach ($payment->get_tax_breakthrough() as $rate => $total) : ?>
<tr>
<th class="wu-text-left wu-py-2 wu-px-4"><?php printf(__('Tax (%s%%)', 'wp-ultimo'), $rate); ?></th>
<th class="wu-text-left wu-py-2 wu-px-4"><?php echo wu_format_currency($total, $payment->get_currency()); ?></th>
</tr>
<?php endforeach; ?>
<tr>
<th class="wu-text-left wu-py-2 wu-px-4"><?php _e("Today's Grand Total", 'wp-ultimo'); ?></th>
<th class="wu-text-left wu-py-2 wu-px-4"><?php echo wu_format_currency($payment->get_total(), $payment->get_currency()); ?></th>
</tr>
</tfoot>
</table>
<?php if (!empty($note)) : ?>
<div class="wu-col-span-2 wu-mb-4">
<div class="wu-p-4 wu-bg-yellow-200">
<?php
echo $note;
?>
</div>
</div>
<?php endif; ?>
<input type="hidden" name="confirmation" value="yes" />
<input type="hidden" name="token" value="<?php echo esc_attr($_GET['token']); ?>" />
<?php if (isset($_GET['PayerID'])) : ?>
<input type="hidden" name="payer_id" value="<?php echo esc_attr($_GET['PayerID']); ?>" />
<?php endif; ?>
<input type="hidden" name="wu_ppe_confirm_nonce" value="<?php echo wp_create_nonce('wu-ppe-confirm-nonce'); ?>"/>
<div class="wu_submit_button">
<button type="submit" class="button button button-primary btn-primary">
<?php esc_attr_e('Confirm', 'wp-ultimo'); ?>
</button>
</div>
</form>

View File

@ -0,0 +1,45 @@
<form id="wu_form" method="post" class="wu-styling wu-relative">
<?php
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$order_form = new \WP_Ultimo\UI\Form('product-fields', $product_fields, array(
'title' => __('Products', 'wp-ultimo'),
'views' => 'checkout/fields',
));
/**
* Render form fields.
*
* @see /view/checkout/fields/ for the template files for each field type.
* @since 2.0.0
*/
$order_form->render();
/**
* Instantiate the form for the submit button and such.
*
* @since 2.0.0
*/
$submit = new \WP_Ultimo\UI\Form('submit-fields', $submit_fields, array('views' => 'checkout/fields'));
/**
* Render form fields.
*
* @see /view/checkout/fields/ for the template files for each field type.
* @since 2.0.0
*/
$submit->render();
/**
* Add a security nonce field.
*/
wp_nonce_field('wu_checkout');
?>
</form>

View File

@ -0,0 +1,70 @@
<?php
/**
* Order bump view.
*
* @since 2.0.0
*/
$duration = $duration ?: 1;
$duration_unit = $duration_unit ?: 'month';
$product = wu_get_product($product['id']);
$product_variation = $product->get_as_variation($duration, $duration_unit);
if ($product_variation !== false) {
$product = $product_variation;
} // end if;
?>
<div class="wu-relative wu-flex wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4 wu-items-center wu-justify-between">
<div class="wu-flex wu-items-center">
<?php if ($display_product_image) : $image = $product->get_featured_image('thumbnail'); ?>
<?php if ($image) : ?>
<div class="wu-w-thumb wu-h-thumb wu-rounded wu-overflow-hidden wu-text-center wu-inline-block wu-mr-4">
<img src="<?php echo esc_attr($image); ?>" class="wu-h-full">
</div>
<?php endif; ?>
<?php endif; ?>
<div class="wu-text-sm">
<span class="wu-font-semibold wu-block wu-text-gray-900"><?php echo empty($name) ? $product->get_name() : $name; ?></span>
<?php if ($display_product_description && $product->get_description()) : ?>
<div class="wu-text-gray-600">
<p class="sm:wu-inline-block wu-my-1">
<?php echo $product->get_description(); ?>
</p>
</div>
<?php endif; ?>
<div class="wu-text-gray-600">
<p class="sm:wu-inline">
<?php echo $product->get_price_description(); ?>
</p>
</div>
</div>
</div>
<div v-if="!($parent.has_product('<?php echo $product->get_id(); ?>') || $parent.has_product('<?php echo $product->get_slug(); ?>'))" class="wu-ml-2">
<a href="#" @click.prevent="$parent.add_product('<?php echo $product->get_id(); ?>')" class="button btn"><?php _e('Add to Cart', 'wp-ultimo'); ?></a>
</div>
<div v-else class="wu-ml-2">
<a href="#" @click.prevent="$parent.remove_product('<?php echo $product->get_id(); ?>', '<?php echo $product->get_slug(); ?>')" class="button btn"><?php _e('Remove', 'wp-ultimo'); ?></a>
<input type="hidden" name="products[]" value="<?php echo $product->get_id(); ?>">
</div>
<div
class="wu-absolute wu--inset-px wu-rounded-lg wu-border-solid wu-border-2 wu-pointer-events-none wu-top-0 wu-bottom-0 wu-right-0 wu-left-0"
:class="($parent.has_product('<?php echo $product->get_id(); ?>') || $parent.has_product('<?php echo $product->get_slug(); ?>'))? 'wu-border-blue-500' : 'wu-border-transparent'"
aria-hidden="true"
>
</div>
</div>

View File

@ -0,0 +1,270 @@
<?php
/**
* Order summary view.
*
* @since 2.0.0
*/
?>
<div id="wu-order-summary-content" class="wu-relative">
<div v-show="!order" class="wu-bg-gray-100 wu-p-4 wu-text-center wu-border wu-border-solid wu-border-gray-300">
<?php _e('Generating Order Summary...', 'wp-ultimo'); ?>
</div>
<div v-if="order" v-cloak>
<table id="wu-order-summary-table" class="wu-w-full wu-mb-0">
<thead>
<tr class="">
<th class="col-description">
<?php _e('Description', 'wp-ultimo'); ?>
</th>
<?php if ($table_columns === 'simple') : ?>
<th class="col-total-gross">
<?php _e('Subtotal', 'wp-ultimo'); ?>
</th>
<?php else : ?>
<th class="col-total-net">
<?php _e('Net Total', 'wp-ultimo'); ?>
</th>
<th class="col-total-vat-percentage">
<?php _e('Discounts', 'wp-ultimo'); ?>
</th>
<th class="col-total-tax">
<?php _e('Tax', 'wp-ultimo'); ?>
</th>
<th class="col-total-gross">
<?php _e('Gross Total', 'wp-ultimo'); ?>
</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<tr v-if="order.line_items.length === 0">
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 2 : 5; ?>" class="col-description">
<?php _e('No products in shopping cart.', 'wp-ultimo'); ?>
</td>
</tr>
<tr v-for="line_item in order.line_items">
<td class="wu-py-2 col-description" v-show="line_item.recurring">
<?php printf(__('Subscription - %s', 'wp-ultimo'), '{{ line_item.title }}'); ?>
<small v-if="line_item.type == 'product'" class="wu-ml-3 wu-text-xs">
<a href="#" class="wu-no-underline" v-on:click.prevent="remove_product(line_item.product_id, line_item.product_slug)">
<?php _e('Remove', 'wp-ultimo'); ?>
</a>
</small>
</td>
<td class="wu-py-2 col-description" v-show="!line_item.recurring">
{{ line_item.title }}
<small v-if="line_item.type == 'product'" class="">
<a href="#" class="wu-no-underline" v-on:click.prevent="remove_product(line_item.product_id, line_item.product_slug)">
<?php _e('Remove', 'wp-ultimo'); ?>
</a>
</small>
</td>
<?php if ($table_columns === 'simple') : ?>
<td v-show="line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }} / {{ line_item.recurring_description }}
</td>
<td v-show="!line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }}
</td>
<?php else : ?>
<td v-show="line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }} / {{ line_item.recurring_description }}
</td>
<td v-show="!line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }}
</td>
<td class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.discount_total) }}
</td>
<td class="wu-py-2 col-total-tax">
{{ wu_format_money(line_item.tax_total) }}
<small v-if="line_item.tax_rate" class="wu-block">
{{ line_item.tax_label }} {{ line_item.tax_rate }}%
</small>
</td>
<td class="wu-py-2 col-total-gross">
{{ wu_format_money(line_item.total) }}
</td>
<?php endif; ?>
</tr>
</tbody>
<tfoot class="">
<?php if ($table_columns === 'simple') : ?>
<tr>
<td>
<?php _e("Discounts", 'wp-ultimo'); ?>
</td>
<td>
{{ wu_format_money(order.totals.total_discounts) }}
</td>
</tr>
<tr>
<td>
<?php _e("Taxes", 'wp-ultimo'); ?>
</td>
<td>
{{ wu_format_money(order.totals.total_taxes) }}
</td>
</tr>
<?php endif; ?>
<tr>
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 1 : 4; ?>">
<strong><?php _e("Today's Grand Total", 'wp-ultimo'); ?></strong>
</td>
<td class="" v-show="order.has_trial">
{{ wu_format_money(0) }}
</td>
<td class="" v-show="!order.has_trial">
{{ wu_format_money(order.totals.total) }}
</td>
</tr>
<tr v-if="order.has_trial">
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 1 : 4; ?>">
<small>
<?php printf(__('Total in %1$s - end of trial period.', 'wp-ultimo'), '{{ $moment.unix(order.dates.date_trial_end).format(`LL`) }}'); ?>
</small>
</td>
<td class="">
{{ wu_format_money(order.totals.total) }}
</td>
</tr>
</tfoot>
</table>
<ul class="wu-p-0 wu-m-0 wu-mt-2 wu-list-none wu-order-summary-additional-info wu-text-sm">
<li v-if="!order.has_trial && order.has_recurring">
<?php printf(__('Next fee of %1$s will be billed in %2$s.', 'wp-ultimo'), '{{ wu_format_money(order.totals.recurring.total) }}', "{{ \$moment.unix(order.dates.date_next_charge).format(`LL`) }}"); ?>
</li>
<li class="order-description" v-if="order.totals.total_discounts < 0">
<?php
// translators: 1 is the discount name (e.g. Launch Promo). 2 is the coupon code (e.g PROMO10), 3 is the coupon amount and 4 is the discount total.
printf(__('Discount applied: %1$s - %2$s (%3$s) %4$s', 'wp-ultimo'), '{{ order.discount_code.name }}', '{{ order.discount_code.code }}', '{{ order.discount_code.discount_description }}', '{{ wu_format_money(-order.totals.total_discounts) }}'); ?>
<a class="wu-no-underline wu-ml-2" href="#" v-on:click.prevent="discount_code = ''">
<?php _e('Remove', 'wp-ultimo'); ?>
</a>
</li>
</ul>
</div>
</div>

View File

@ -0,0 +1,38 @@
<?php
/**
* Displays the frequency selector for the pricing tables
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/pricing-table/frequency-selector.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 2.0.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
?>
<ul class="wu-border-solid wu-border wu-border-gray-300 wu-shadow-sm wu-p-4 wu-flex wu-rounded wu-relative wu-m-0 wu-mb-4 wu-list-none wu-justify-center">
<?php foreach ($period_options as $index => $period_option) : ?>
<li class="wu-mx-2">
<a
:class="(duration == <?php echo $period_option['duration']; ?> && duration_unit == '<?php echo $period_option['duration_unit']; ?>') || (<?php echo json_encode($index === 0); ?> && duration === '') ? 'wu-font-semibold active' : ''"
v-on:click.prevent="duration = <?php echo $period_option['duration']; ?>; duration_unit = '<?php echo $period_option['duration_unit']; ?>'"
href="#"
>
<?php echo $period_option['label']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>

View File

@ -0,0 +1,39 @@
<?php
/**
* Displays the frequency selector for the pricing tables
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/pricing-table/frequency-selector.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.0.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
?>
<div class="wu-mx-auto wu-text-center wu-mb-4">
<ul class="wu-plans-frequency-selector">
<?php foreach ($period_options as $index => $period_option) : ?>
<li>
<a class="wu-text-center" :class="(duration == <?php echo $period_option['duration']; ?> && duration_unit == '<?php echo $period_option['duration_unit']; ?>') || (<?php echo json_encode($index === 0); ?> && duration === '') ? 'active' : ''" v-on:click.prevent="duration = <?php echo $period_option['duration']; ?>; duration_unit = '<?php echo $period_option['duration_unit']; ?>'" href="#">
<?php echo $period_option['label']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>

View File

@ -0,0 +1,373 @@
<?php
/**
* Template File: Basic Pricing Table.
*
* To see what methods are available on the product variable, @see inc/models/class-products.php.
*
* This template can also be override using template overrides.
* See more here: https://help.wpultimo.com/article/335-template-overrides.
*
* @since 2.0.0
* @param array $products List of product objects.
* @param string $name ID of the field.
* @param string $label The field label.
*/
$products_to_reduce = array_merge(array(false), $products);
$first_recurring_product = array_reduce($products_to_reduce, function($chosen_product, $product) {
if ($product && $product->is_recurring() && $chosen_product == false) {
$chosen_product = $product;
} // end if;
return $chosen_product;
});
$legacy_mode = array_reduce($products_to_reduce, function($all_have_same_duration, $product) use ($first_recurring_product) {
if ($product && $product->is_recurring()) {
$all_have_same_duration = $first_recurring_product->get_recurring_description() == $product->get_recurring_description();
} // end if;
return $all_have_same_duration;
});
wp_add_inline_script('wu-checkout', sprintf('
/**
* Force different durations.
*/
window.wu_force_different_durations = %s;
window.wu_legacy_mode = %s;
', json_encode($force_different_durations), json_encode($legacy_mode)), 'after');
if ($first_recurring_product !== null) {
wp_add_inline_script('wu-checkout', sprintf("
/**
* Add durations if necessary.
*/
wp.hooks.addFilter('wu_before_form_init', 'next-press/wp-ultimo', function(data) {
data.wu_force_different_durations = wu_force_different_durations;
data.wu_legacy_mode = wu_legacy_mode;
if (!data.duration && !wu_force_different_durations) {
data.duration = %s;
} // end if;
if (!data.duration_unit && !wu_force_different_durations) {
data.duration_unit = %s;
} // end if;
return data;
});
", json_encode($first_recurring_product->get_duration()), json_encode($first_recurring_product->get_duration_unit())), 'after');
}
?>
<?php if (empty($products)) : ?>
<div class="wu-text-center wu-bg-gray-100 wu-rounded wu-uppercase wu-font-semibold wu-text-xs wu-text-gray-700 wu-p-4">
<?php _e('No Products Found.', 'wp-ultimo'); ?>
</div>
<?php else : ?>
<div class="wu-content-plan">
<div class="layer plans wu-overflow-hidden wu-flex">
<?php foreach ($products as $product) : ?>
<div
id="plan-<?php echo esc_attr($product->get_id()); ?>"
class="<?php echo "wu-product-{$product->get_id()}"; ?> lift wu-plan plan-tier wu-flex-1 <?php echo esc_attr($product->is_featured_plan() ? 'callout' : ''); ?> wu-flex wu-flex-col wu-justify-between"
v-show="wu_force_different_durations || (duration && wu_legacy_mode) || (( (!duration) || duration == <?php echo $product->get_duration(); ?> && duration_unit == '<?php echo $product->get_duration_unit(); ?>' ) || <?php echo json_encode($product->get_pricing_type() !== 'paid'); ?>)"
>
<div class="wu-relative">
<?php if ($product->is_featured_plan()) : ?>
<h6>
<?php
/**
* Featured tag.
*/
echo apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-ultimo'), $product);
?>
</h6>
<?php endif; ?>
<h4 class="wp-ui-primary">
<?php echo $product->get_name(); ?>
</h4>
<?php
/**
* Case Free
*/
if ($product->get_pricing_type() === 'free') :
?>
<!-- Price -->
<h5>
<span class="plan-price">
<?php _e('Free!', 'wp-ultimo'); ?>
</span>
</h5>
<?php
/**
* Case Free
*/
elseif ($product->get_pricing_type() === 'contact_us') :
?>
<!-- Price -->
<h5>
<span class="plan-price">
<?php echo apply_filters('wu_plan_contact_us_price_line', __('--', 'wp-ultimo')); ?>
</span>
</h5>
<?php else : ?>
<!-- Price -->
<h5>
<?php
/**
* Price display.
*/
$symbol_left = in_array(wu_get_setting('currency_position', '%s%v'), array('%s%v', '%s %v'));
?>
<?php if ($symbol_left) : ?>
<sup class="superscript">
<?php echo wu_get_currency_symbol($product->get_currency()); ?>
</sup>
<?php endif; ?>
<span class="plan-price" v-if="wu_force_different_durations || (duration == <?php echo $product->get_duration(); ?> && duration_unit == '<?php echo $product->get_duration_unit(); ?>')">
<?php
$n = $product->get_amount();
echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n));
?>
</span>
<?php foreach (array(3, 12) as $freq) :
$price_variation = $product->get_price_variation($freq, 'month');
if (!$price_variation) {
continue;
} // end if;
?>
<span class="plan-price" v-cloak v-if="duration == <?php echo $price_variation['duration']; ?> && duration_unit == '<?php echo $price_variation['duration_unit']; ?>'">
<?php
$n = $price_variation ? $price_variation['monthly_amount'] : false;
if ($n) {
echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n));
} else {
echo '--';
} // end if;
?>
</span>
<?php endforeach;?>
<sub v-if="1 == <?php echo $product->get_duration(); ?> && 'month' == '<?php echo $product->get_duration_unit(); ?>'">
<?php
/**
* Period Unit.
*/
$symbol = $product->is_recurring() ? __('/mo', 'wp-ultimo') : '';
echo (!$symbol_left ? wu_get_currency_symbol() : '').' '.$symbol;
?>
</sub>
<sub v-else>
<?php
/**
* Period Unit.
*/
$symbol = $product->is_recurring() ? $product->get_recurring_description() : '';
echo (!$symbol_left ? wu_get_currency_symbol() : '').' '.$symbol;
?>
</sub>
</h5>
<!-- end Price -->
<?php endif; ?>
<p class="early-adopter-price">
<?php echo $product->get_description(); ?>
</p>
</div>
<br>
<!-- Feature List Begins -->
<ul>
<?php
/**
*
* Display quarterly and Annually plans, to be hidden.
*/
$prices_total = array(
3 => __('every 3 months', 'wp-ultimo'),
12 => __('yearly', 'wp-ultimo'),
);
foreach ($prices_total as $freq => $string) {
$price_variation = $product->get_price_variation($freq, 'month');
if (!$price_variation || $product->get_pricing_type() == 'free' || $product->get_pricing_type() == 'contact_us') {
echo "<li v-cloak v-show='duration == ".$freq."' class='total-price total-price-$freq'>-</li>";
} else {
$text = sprintf(__('%1$s, billed %2$s', 'wp-ultimo'), wu_format_currency($price_variation['amount']), $string);
$extra_check_for_annual = '';
if ($freq === 12) {
$extra_check_for_annual = ' || (duration == "1" && duration_unit == "year")';
} // end if;
echo "<li v-cloak v-show='duration == ".$freq.$extra_check_for_annual."' class='total-price total-price-$freq'>$text</li>";
} // end if;
} // end foreach;
?>
<?php foreach ($product->get_pricing_table_lines() as $key => $line) : ?>
<li class="<?php echo str_replace('_', '-', $key); ?>"><?php echo $line; ?></li>
<?php endforeach; ?>
<li class="wu-cta">
<button
v-if="<?php echo json_encode($product->get_pricing_type() !== 'contact_us'); ?>"
v-on:click="add_plan(<?php echo $product->get_id(); ?>)"
type="button"
name="products[]"
value="<?php echo $product->get_id(); ?>"
class="button button-primary button-next"
>
<?php _e('Select Plan', 'wp-ultimo'); ?>
</button>
<button
v-else
v-on:click="open_url('<?php echo esc_url($product->get_contact_us_link()); ?>', '_blank');" type="button"
name="products[]"
value="<?php echo $product->get_id(); ?>"
class="button button-primary button-next"
>
<?php _e('Select Plan', 'wp-ultimo'); ?>
</button>
</li>
</ul>
<!-- Feature List Ends -->
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>

View File

@ -0,0 +1,71 @@
<?php
/**
* List Template field view.
*
* @since 2.0.0
*/
/**
* Deal with different pricing options
*/
foreach ($products as $index => &$_product) {
$_product = wu_get_product($_product['id']);
$product_variation = $_product->get_as_variation($duration, $duration_unit);
if ($product_variation === false && !$force_different_durations) {
unset($products[$index]);
$_product = $product_variation;
} // end if;
} // end foreach;
?>
<div class="">
<div class="wu-grid wu-grid-flow-row wu-gap-4 <?php echo $classes; ?>">
<?php foreach ($products as $product) : ?>
<label
id="wu-product-<?php echo $product->get_id(); ?>"
class="wu-relative wu-block wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4 wu-cursor-pointer hover:wu-border-gray-400 sm:wu-flex sm:wu-justify-between focus-within:wu-ring-1 focus-within:wu-ring-offset-2 focus-within:wu-ring-indigo-500">
<input v-if="<?php echo json_encode($product->get_pricing_type() !== 'contact_us'); ?>" v-on:click="$parent.add_plan(<?php echo $product->get_id(); ?>)" type="checkbox" name="products[]" value="<?php echo $product->get_id(); ?>" class="screen-reader-text wu-hidden">
<input v-else v-on:click="$parent.open_url('<?php echo esc_url($product->get_contact_us_link()); ?>', '_blank');" type="checkbox" name="products[]" value="<?php echo $product->get_id(); ?>" class="screen-reader-text wu-hidden">
<div class="wu-flex wu-items-center">
<div class="wu-text-sm">
<span id="server-size-0-label" class="wu-font-semibold wu-block wu-text-gray-900">
<?php echo $product->get_name(); ?>
</span>
<div id="server-size-0-description-0" class="wu-text-gray-600">
<p class="sm:wu-inline">
<?php echo $product->get_description(); ?>
</p>
</div>
</div>
</div>
<div id="server-size-0-description-1" class="wu-mt-2 wu-flex wu-text-md sm:wu-mt-0 sm:wu-block sm:wu-ml-4 sm:wu-text-right">
<div class="wu-font-semibold wu-text-gray-900"><?php echo $product->get_formatted_amount(); ?></div>
<div class="wu-ml-1 wu-text-sm wu-text-gray-500 sm:wu-ml-0"><?php echo $product->get_recurring_description(); ?></div>
</div>
<div
class="wu-absolute wu--inset-px wu-rounded-lg wu-border-solid wu-border-2 wu-pointer-events-none wu-top-0 wu-bottom-0 wu-right-0 wu-left-0"
:class="$parent.has_product(<?php echo $product->get_id(); ?>) || $parent.has_product('<?php echo $product->get_slug(); ?>') ? 'wu-border-blue-500' : 'wu-border-transparent'"
aria-hidden="true"
>
</div>
</label>
<?php endforeach; ?>
</div>
</div>

View File

@ -0,0 +1,62 @@
<?php
/**
* Displays the navigation part on the bottom of the page
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/signup-steps-navigation.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
?>
<!-- This example requires Tailwind CSS v2.0+ -->
<nav aria-label="<?php esc_attr_e('Progress', 'wp-ultimo'); ?>">
<ul class="wu-clean-steps wu-list-none md:wu-flex wu-p-0 wu--mx-2 wu-my-4">
<?php foreach ($steps as $index => $step) :
$step_key = $step['id'];
/**
* Class element of the Step Status Bar
* @var string
*/
$container_class = '';
$color = 'gray';
if ($step_key === $current_step) {
$color = 'blue';
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
$container_class = 'wu-opacity-50';
$color = 'blue';
} // end if;
?>
<li class="wu-py-0 md:wu-flex-1 wu-px-2 <?php echo esc_attr($container_class); ?>">
<span class="wu-h-2 wu-block wu-mb-2 wu-bg-<?php echo esc_attr($color); ?>-500">&nbsp;</span>
<span class="wu-block wu-text-2xs wu-font-medium wu-tracking-wide wu-uppercase wu-text-<?php echo esc_attr($color); ?>-500"><?php printf(__('Step %d', 'wp-ultimo'), $index + 1); ?></span>
<span class="wu-block wu-text-sm wu-font-medium wu-text-<?php echo esc_attr($color); ?>-600"><?php echo $step['name']; ?></span>
</li>
<?php endforeach; ?>
</ul>
</nav>

View File

@ -0,0 +1,56 @@
<?php
/**
* Displays the navigation part on the bottom of the page
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/signup-steps-navigation.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
?>
<ol class="wu-setup-steps wu-flex">
<?php foreach ($steps as $index => $step) :
$step_key = $step['id'];
/**
* Class element of the Step Status Bar
* @var string
*/
$class = '';
if ($step_key === $current_step) {
$class = 'active';
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
$class = 'done';
} // end if;
?>
<li class="<?php echo $class; ?> wu-flex-1">
<?php echo esc_html($step['name']); ?>
</li>
<?php endforeach; ?>
</ol>

View File

@ -0,0 +1,60 @@
<?php
/**
* Displays the navigation part on the bottom of the page
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/signup-steps-navigation.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
?>
<!-- This example requires Tailwind CSS v2.0+ -->
<nav aria-label="<?php esc_attr_e('Progress', 'wp-ultimo'); ?>">
<ul class="wu-minimal-steps">
<?php foreach ($steps as $index => $step) :
$step_key = $step['id'];
/**
* Class element of the Step Status Bar
* @var string
*/
$class = '';
if ($step_key === $current_step) {
$class = 'step-current';
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
$class = 'step-done';
} // end if;
?>
<li class="<?php echo esc_attr($class); ?>">
<span class="wu-minimal-steps-bar">&nbsp;</span>
<span class="wu-minimal-steps-step-count"><?php printf(__('Step %d', 'wp-ultimo'), $index + 1); ?></span>
<span class="wu-minimal-steps-step-label"><?php echo $step['name']; ?></span>
</li>
<?php endforeach; ?>
</ul>
</nav>

View File

@ -0,0 +1,147 @@
<?php
/**
* Template File: Basic Pricing Table.
*
* To see what methods are available on the product variable, @see inc/models/class-products.php.
*
* This template can also be overridden using template overrides.
* See more here: https://help.wpultimo.com/article/335-template-overrides.
*
* @since 2.0.0
* @param array $products List of product objects.
* @param string $name ID of the field.
* @param string $label The field label.
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
if (isset($should_display) && !$should_display) {
?>
<div id="wu-site-template-container"></div>
<?php
return;
} // end if;
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
$categories = isset($categories) ? $categories : array();
$customer_sites_category = __('Your Sites', 'wp_ultimo');
$customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites) : array();
?>
<div id="wu-site-template-container">
<ul id="wu-site-template-filter" class="wu-bg-white wu-border-solid wu-border wu-border-gray-300 wu-shadow-sm wu-p-4 wu-flex wu-rounded wu-relative wu-m-0 wu-mb-4 wu-list-none">
<li class="wu-site-template-filter-all wu-mx-2 wu-my-0">
<a
href="#"
data-category=""
:class="$parent.template_category === '' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = ''"
>
<?php _e('All', 'wp-ultimo'); ?>
</a>
</li>
<?php if (!empty($customer_sites)) : ?>
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($customer_sites_category)); ?> wu-mx-2 wu-my-0">
<a
href="#"
data-category="<?php echo esc_attr($customer_sites_category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
><?php echo $customer_sites_category; ?></a>
</li>
<?php endif; ?>
<?php if (isset($categories) && $categories) : ?>
<?php foreach ($categories as $category) : ?>
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($category)); ?> wu-mx-2 wu-my-0">
<a
href="#"
data-category="<?php echo esc_attr($category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
><?php echo $category; ?></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<div id="wu-site-template-container-grid" class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo isset($cols) ? $cols : '3'; ?> wu-gap-4">
<?php foreach ($sites as $site_template) : ?>
<?php if ($site_template->get_type() !== 'site_template' && !in_array($site_template->get_id(), $customer_sites, true)) { continue; } ?>
<?php $is_template = $site_template->get_type() === 'site_template'; ?>
<?php $categories = array_merge($site_template->get_categories(), !$is_template ? array($customer_sites_category) : array()); ?>
<div
id="wu-site-template-<?php echo esc_attr($site_template->get_id()); ?>"
class="wu-bg-white wu-border-solid wu-border wu-border-gray-300 wu-shadow-sm wu-p-4 wu-rounded wu-relative"
v-show="!$parent.template_category || <?php echo esc_attr(json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
v-cloak
>
<div class="wu-site-template-image-container wu-relative">
<a
title="<?php esc_attr_e('View Template Preview', 'wp-ultimo'); ?>"
class="wu-site-template-selector wu-cursor-pointer wu-no-underline"
<?php echo $is_template ? $site_template->get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site_template->get_active_site_url()); ?>
>
<img class="wu-site-template-image wu-w-full wu-border-solid wu-border wu-border-gray-300 wu-mb-4 wu-bg-white" src="<?php echo esc_attr($site_template->get_featured_image()); ?>" alt="<?php echo $site_template->get_title(); ?>">
</a>
</div>
<h3 class="wu-site-template-title wu-text-lg wu-font-semibold">
<?php echo $site_template->get_title(); ?>
</h3>
<p class="wu-site-template-description wu-text-sm">
<?php echo $site_template->get_description(); ?>
</p>
<div class="wu-mt-4">
<button v-on:click.prevent="$parent.template_id = <?php echo esc_attr($site_template->get_id()); ?>" type="button" class="wu-site-template-selector button btn button-primary btn-primary wu-w-full wu-text-center wu-cursor-pointer">
<span v-if="$parent.template_id == <?php echo esc_attr($site_template->get_id()); ?>"><?php _e('Selected', 'wp-ultimo'); ?></span>
<span v-else><?php _e('Select', 'wp-ultimo'); ?></span>
</button>
</div>
</div>
<?php endforeach; ?>
</div>
</div>

View File

@ -0,0 +1,265 @@
<?php
/**
* Template File: Basic Pricing Table.
*
* To see what methods are available on the product variable, @see inc/models/class-products.php.
*
* This template can also be overridden using template overrides.
* See more here: https://help.wpultimo.com/article/335-template-overrides.
*
* @since 2.0.0
* @param array $products List of product objects.
* @param string $name ID of the field.
* @param string $label The field label.
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
if (!$should_display) {
echo "<div></div>";
return;
} // end if;
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
$categories = isset($categories) ? $categories : array();
$customer_sites_category = __('Your Sites', 'wp_ultimo');
$customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites) : array();
?>
<?php if (empty($sites)) : ?>
<div
class="wu-text-center wu-bg-gray-100 wu-rounded wu-uppercase wu-font-semibold wu-text-xs wu-text-gray-700 wu-p-4"
>
<?php _e('No Site Templates Found.', 'wp-ultimo'); ?>
</div>
<?php else : ?>
<div class="themes-php wu-styling">
<div class="wrap wu-template-selection">
<?php
/**
* Allow developers to hide the title.
*/
if (apply_filters('wu_step_template_display_header', true)) :
?>
<h2>
<?php _e('Pick your Template', 'wp-ultimo'); ?>
<span class="title-count theme-count">
<?php echo count($sites); ?>
</span>
</h2>
<?php endif; ?>
<div class="wp-filter">
<div class="wp-filter-responsive">
<h4><?php _e('Template Categories', 'wp-ultimo'); ?></h4>
<select class="">
<option value="">
<?php _e('All Templates', 'wp-ultimo'); ?>
</option>
<?php if (!empty($customer_sites)) : ?>
<option value="<?php echo esc_attr($customer_sites_category); ?>">
<?php echo $customer_sites_category; ?>
</option>
<?php endif; ?>
<?php foreach ($categories as $category) : ?>
<option value="<?php echo esc_attr($category); ?>">
<?php echo $category; ?>
</option>
<?php endforeach; ?>
</select>
</div>
<ul class="filter-links wp-filter-template">
<li class="selector-inactive">
<a
href="#"
data-category=""
:class="$parent.template_category === '' ? 'current' : ''"
v-on:click.prevent="$parent.template_category = ''"
>
<?php _e('All Templates', 'wp-ultimo'); ?>
</a>
</li>
<?php if (!empty($customer_sites)) : ?>
<li class="selector-inactive">
<a
href="#"
data-category="<?php echo esc_attr($customer_sites_category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
>
<?php echo $customer_sites_category; ?>
</a>
</li>
<?php endif; ?>
<?php foreach ($categories as $category) : ?>
<li class="selector-inactive">
<a
href="#"
data-category="<?php echo esc_attr($category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
>
<?php echo $category; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<div class="theme-browser rendered">
<div class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo $cols; ?> wu-gap-4 wp-clearfix">
<?php $i = 0; foreach ($sites as $site) : ?>
<?php if ($site->get_type() !== 'site_template' && !in_array($site->get_id(), $customer_sites, true)) { continue; } ?>
<?php $is_template = $site->get_type() === 'site_template'; ?>
<?php $categories = array_merge($site->get_categories(), !$is_template ? array($customer_sites_category) : array()) ?>
<div
class="theme"
tabindex="<?php echo $i; ?>"
aria-describedby="<?php echo $site->get_id(); ?>-action <?php echo $site->get_id(); ?>-name"
data-slug="<?php echo $site->get_id(); ?>"
v-show="!$parent.template_category || <?php echo esc_attr(json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
v-cloak
>
<div class="theme-screenshot">
<img
src="<?php echo $site->get_featured_image(); ?>"
alt="<?php echo $site->get_title(); ?>"
>
</div>
<a
<?php echo $is_template ? $site->get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site->get_active_site_url()); ?>
class="more-details"
id="<?php echo $site->get_id(); ?>-action"
>
<?php $is_template ? _e('View Template', 'wp-ultimo') : _e('View Site', 'wp-ultimo'); ?>
</a>
<div class="wu-flex theme-name-header wu-items-center wu-relative">
<h2 class="theme-name wu-flex-grow wu-h-full" id="<?php echo $site->get_id(); ?>-name">
<?php echo $site->get_title(); ?>
</h2>
<div class="theme-actions wu-flex">
<button
class="button button-primary"
type="button"
v-on:click.prevent="$parent.template_id = <?php echo esc_attr($site->get_id()); ?>"
>
<span v-if="$parent.template_id == <?php echo esc_attr($site->get_id()); ?>"><?php _e('Selected', 'wp-ultimo'); ?></span>
<span v-else><?php _e('Select', 'wp-ultimo'); ?></span>
</button>
</div>
</div>
</div>
<?php
$i++;
endforeach;
?>
</div>
</div>
<div class="theme-overlay"></div>
<p class="no-themes">
<?php _e('No Templates Found', 'wp-ultimo'); ?>
</p>
</div>
</div>
<?php endif; ?>

View File

@ -0,0 +1,141 @@
<?php
/**
* Displays the frequency selector for the pricing tables
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/pricing-table/frequency-selector.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.0.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
if (!$should_display) {
return;
} // end if;
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
$categories = isset($categories) ? $categories : array();
$customer_sites_category = __('Your Sites', 'wp_ultimo');
$customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites) : array();
?>
<div id="wu-site-template-container">
<ul id="wu-site-template-filter">
<li class="wu-site-template-filter-all">
<a
href="#"
data-category=""
:class="$parent.template_category === '' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = ''"
>
<?php _e('All', 'wp-ultimo'); ?>
</a>
</li>
<?php if (!empty($customer_sites)) : ?>
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($customer_sites_category)); ?>">
<a
href="#"
data-category="<?php echo esc_attr($customer_sites_category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
><?php echo $customer_sites_category; ?></a>
</li>
<?php endif; ?>
<?php if (isset($categories) && $categories) : ?>
<?php foreach ($categories as $category) : ?>
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($category)); ?>">
<a
href="#"
data-category="<?php echo esc_attr($category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
><?php echo $category; ?></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<div id="wu-site-template-container-grid">
<?php foreach ($sites as $site_template) : ?>
<?php if ($site_template->get_type() !== 'site_template' && !in_array($site_template->get_id(), $customer_sites, true)) { continue; } ?>
<?php $is_template = $site_template->get_type() === 'site_template'; ?>
<?php $categories = array_merge($site_template->get_categories(), !$is_template ? array($customer_sites_category) : array()); ?>
<div
id="wu-site-template-<?php echo esc_attr($site_template->get_id()); ?>"
v-show="!$parent.template_category || <?php echo esc_attr(json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
v-cloak
>
<img class="wu-site-template-image" src="<?php echo esc_attr($site_template->get_featured_image()); ?>" alt="<?php echo $site_template->get_title(); ?>">
<h3 class="wu-site-template-title">
<?php echo $site_template->get_title(); ?>
</h3>
<p class="wu-site-template-description">
<?php echo $site_template->get_description(); ?>
</p>
<div class="wu-site-template-preview-block">
<a class="wu-site-template-selector" <?php echo $site_template->get_preview_url_attrs(); ?>>
<?php _e('View Template Preview', 'wp-ultimo'); ?>
</a>
</div>
<label for="wu-site-template-id-<?php echo esc_attr($site_template->get_id()); ?>">
<input id="wu-site-template-id-<?php echo esc_attr($site_template->get_id()); ?>" type="radio" name="template_id" v-model="$parent.template_id" value="<?php echo esc_attr($site_template->get_id()); ?>" />
<a class="wu-site-template-selector" @click.prevent="" href="#">
<?php _e('Select this Template', 'wp-ultimo'); ?>
</a>
</label>
</div>
<?php endforeach; ?>
</div>
</div>

1
views/classes.php Normal file
View File

@ -0,0 +1 @@
<div class="wu-max-w-sm"></div>

View File

@ -0,0 +1,77 @@
<?php
/**
* Avatar widget view.
*
* @since 2.0.0
*/
?>
<div class="wu-striped wu-m-0 wu--mt-2 wu-mb-2 wu--mx-3">
<div class="wu-w-full wu-box-border wu-p-4 wu-m-0 wu-border-t-0 wu-border-l-0 wu-border-r-0 wu-border-b wu-border-gray-400 wu-border-solid wu-text-center">
<div class="customer-actions wu--mt-widget-inset wu--mx-4 wu-p-6 wu-bg-gray-100 wu-border wu-border-solid wu-border-gray-300 wu-border-l-0 wu-border-r-0 wu-border-t-0" style="background-image: url('<?php echo get_avatar_url($user->ID, array(
'force_display' => true,
'size' => 300,
'default' => 'identicon',
)); ?>');">
&nbsp;
</div>
<div class="wu-mb-2 wu--mt-8">
<?php echo get_avatar($user->ID, 86, 'identicon', '', array(
'force_display' => true,
'class' => 'wu-rounded-full wu-border wu-border-solid wu-border-gray-300 wu-relative',
)); ?>
</div>
<div class="">
<div class="wu-block wu-my-1 wu-text-base wu-font-semibold">
<?php echo $user->display_name; ?>
</div>
<div class="wu-block wu-my-2">
<a href="mailto:<?php echo esc_attr($user->user_email); ?>" class="wu-no-underline" <?php echo wu_tooltip_text(__('Send an email to this customer.', 'wp-ultimo')); ?>>
<?php echo $user->user_email; ?>
</a>
</div>
<div class="wu-block wu-pt-2">
<?php if ($user->ID !== get_current_user_id()) : ?>
<a
href="<?php echo \WP_Ultimo\User_Switching::get_instance()->render($user->ID); ?>"
class="button wu-w-full <?php echo \WP_Ultimo\User_Switching::get_instance()->check_user_switching_is_activated() ? '' : 'wubox' ?> wu-block wu-text-center"
title="<?php echo \WP_Ultimo\User_Switching::get_instance()->check_user_switching_is_activated() ? '' : __('Install User Switching', 'wp-ultimo'); ?>"
>
<?php _e('Switch To &rarr;', 'wp-ultimo'); ?>
</a>
<?php else : ?>
<button class="button wu-w-full" disabled="disabled">
<span <?php echo wu_tooltip_text(__('Switching to your own account is not possible.', 'wp-ultimo')); ?>>
<?php _e('Switch To &rarr;', 'wp-ultimo'); ?>
</span>
</button>
<?php endif; ?>
<a href="<?php echo get_edit_user_link($user->ID); ?>" target="_blank" class="wu-w-full wu-block wu-text-center wu-no-underline wu-mt-4">
<?php _e('Visit Profile &rarr;', 'wp-ultimo'); ?>
</a>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,64 @@
<?php
/**
* Filter view.
*
* @since 2.0.0
*/
?>
<div id="dashboard-filters" class="wp-filter wu-filter">
<ul class="filter-links">
<?php foreach ($views as $tab => $view) : ?>
<li class="<?php echo $tab === $active_tab ? 'current' : ''; ?>">
<a href="<?php echo esc_attr($view['url']); ?>"
class="<?php echo $tab === $active_tab ? 'current wu-font-medium' : ''; ?> wu-loader">
<?php echo $view['label']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<ul class="filter-links sm:wu-float-right sm:wu-w-1/2 lg:wu-w-1/4 wu--mx-2 wu-block sm:wu-inline-block">
<li class="wu-w-full wu-relative">
<span class="dashicons-wu-calendar wu-absolute wu-text-base wu-text-gray-600" style="top: 18px; left: 12px;"></span>
<input
id="wu-date-range"
style="min-height: 28px;"
class="wu-border-0 wu-border-l wu-border-gray-300 wu-bg-gray-100 wu-w-full wu-text-right wu-py-3 wu-outline-none wu-rounded-none"
placeholder="Loading..."
>
</li>
</ul>
<ul class="wu-hidden md:wu-inline-block filter-links sm:wu-float-right md:wu-mr-6">
<?php foreach ($preset_options as $slug => $preset) : ?>
<?php
$link = add_query_arg(array(
'start_date' => $preset['start_date'],
'end_date' => $preset['end_date'],
'preset' => $slug,
));
$request_slug = wu_request('preset', 'none');
?>
<li class="<?php echo $slug === $request_slug ? 'current' : ''; ?>">
<a href="<?php echo esc_attr($link); ?>"
class="<?php echo $slug === $request_slug ? 'current wu-font-medium' : ''; ?> wu-loader">
<?php echo $preset['label']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>

View File

@ -0,0 +1,117 @@
<?php
/**
* Graph countries view.
*
* @since 2.0.0
*/
?>
<div class="wu-styling">
<div class="wu-widget-inset">
<?php
$data = array();
$slug = 'signup_countries';
$headers = array(
__('Country', 'wp-ultimo'),
__('Customer Count', 'wp-ultimo'),
);
foreach ($countries as $country_code => $count) {
$line = array(
wu_get_country_name($country_code),
$count,
);
$data[] = $line;
} // end foreach;
$page->render_csv_button(array(
'headers' => $headers,
'data' => $data,
'slug' => $slug,
));
?>
</div>
</div>
<?php if (!empty($countries)) : ?>
<div class="wu-advanced-filters wu--mx-3 wu--mb-3 wu-mt-3">
<table class="wp-list-table widefat fixed striped wu-border-t-0 wu-border-l-0 wu-border-r-0">
<thead>
<tr>
<th><?php _e('Country', 'wp-ultimo'); ?></th>
<th class="wu-text-right"><?php _e('Customer Count', 'wp-ultimo'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($countries as $country_code => $count) : ?>
<tr>
<td>
<?php
printf('<span class="wu-flag-icon wu-flag-icon-%s wu-w-5 wu-mr-1" %s></span>',
strtolower($country_code),
wu_tooltip_text(wu_get_country_name($country_code))
);
?>
<?php echo wu_get_country_name($country_code); ?>
</td>
<td class="wu-text-right"><?php echo $count; ?></td>
</tr>
<?php
$state_list = wu_get_states_of_customers($country_code);
$_state_count = 0;
?>
<?php foreach ($state_list as $state => $state_count) : $_state_count = $_state_count + $state_count; ?>
<tr>
<td class="wu-text-xs">|&longrightarrow; <?php echo $state; ?></td>
<td class="wu-text-right"><?php echo $state_count; ?></td>
</tr>
<?php endforeach; ?>
<?php if ($state_list && $count - $_state_count >= 0) : ?>
<tr>
<td class="wu-text-xs">|&longrightarrow; <?php _e('Other', 'wp-ultimo') ?></td>
<td class="wu-text-right"><?php echo $count - $_state_count; ?></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php else : ?>
<div class="wu-bg-gray-100 wu-p-4 wu-rounded wu-mt-6">
<?php _e('No countries registered yet.', 'wp-ultimo'); ?>
</div>
<?php endif; ?>

View File

@ -0,0 +1,88 @@
<?php
/**
* Graph countries view.
*
* @since 2.0.0
*/
?>
<div class="wu-styling">
<div class="wu-widget-inset">
<?php
$data = array();
$slug = 'signup_forms';
$headers = array(
__('Checkout Form', 'wp-ultimo'),
__('Signups', 'wp-ultimo'),
);
foreach ($forms as $form) {
$line = array(
$form->signup_form,
$form->count,
);
$data[] = $line;
} // end foreach;
$page->render_csv_button(array(
'headers' => $headers,
'data' => $data,
'slug' => $slug,
));
?>
</div>
</div>
<?php if (!empty($forms)) : ?>
<div class="wu-advanced-filters wu--mx-3 wu--mb-3 wu-mt-3">
<table class="wp-list-table widefat fixed striped wu-border-t-0 wu-border-l-0 wu-border-r-0">
<thead>
<tr>
<th><?php _e('Checkout Form', 'wp-ultimo'); ?></th>
<th class="wu-text-right"><?php _e('Signups', 'wp-ultimo'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($forms as $form) : ?>
<tr>
<td>
<?php echo $form->signup_form; ?>
<?php if ($form->signup_form === 'by-admin') : ?>
<?php echo wu_tooltip(__('Customers created via the admin panel, by super admins.', 'wp-ultimo')); ?>
<?php endif;?>
</td>
<td class="wu-text-right"><?php echo $form->count; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php else : ?>
<div class="wu-bg-gray-100 wu-p-4 wu-rounded wu-mt-6">
<?php _e('No data yet.', 'wp-ultimo'); ?>
</div>
<?php endif; ?>

View File

@ -0,0 +1,109 @@
<?php
/**
* Graph countries view.
*
* @since 2.0.0
*/
?>
<div class="wu-styling">
<div class="wu-widget-inset">
<?php
$data = array();
$slug = 'most_visited_sites';
$headers = array(
__('Site', 'wp-ultimo'),
__('Visits', 'wp-ultimo'),
);
foreach ($sites as $site_visits) {
$site_line = $site_visits->site->get_title().' '.get_admin_url($site_visits->site->get_id());
$line = array(
$site_line,
$site_visits->count,
);
$data[] = $line;
} // end foreach;
$page->render_csv_button(array(
'headers' => $headers,
'data' => $data,
'slug' => $slug,
));
?>
</div>
</div>
<?php if (!empty($sites)) : ?>
<div class="wu-advanced-filters wu--mx-3 wu--mb-3 wu-mt-3">
<table class="wp-list-table widefat fixed striped wu-border-t-0 wu-border-l-0 wu-border-r-0">
<thead>
<tr>
<th class="wu-w-8/12"><?php _e('Site', 'wp-ultimo'); ?></th>
<th class="wu-text-right"><?php _e('Visits', 'wp-ultimo'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($sites as $site_visits) : ?>
<tr>
<td class="wu-align-middle">
<span class="wu-uppercase wu-text-xs wu-text-gray-700 wu-font-bold">
<?php echo $site_visits->site->get_title(); ?>
</span>
<div class="sm:wu-flex">
<a title="<?php _e('Homepage', 'wp-ultimo'); ?>" href="<?php echo esc_attr(get_home_url($site_visits->site->get_id())); ?>" class="wu-no-underline wu-flex wu-items-center wu-text-xs wp-ui-text-highlight">
<span class="dashicons-wu-link1 wu-align-middle wu-mr-1"></span>
<?php _e('Homepage', 'wp-ultimo'); ?>
</a>
<a title="<?php _e('Dashboard', 'wp-ultimo'); ?>" href="<?php echo esc_attr(get_admin_url($site_visits->site->get_id())); ?>" class="wu-no-underline wu-flex wu-items-center wu-text-xs wp-ui-text-highlight sm:wu-mt-0 sm:wu-ml-6">
<span class="dashicons-wu-browser wu-align-middle wu-mr-1"></span>
<?php _e('Dashboard', 'wp-ultimo'); ?>
</a>
</div>
</td>
<td class="wu-align-middle wu-text-right">
<?php echo sprintf(_n('%d visit', '%d visits', $site_visits->count, 'wp-ultimo'), $site_visits->count); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php else : ?>
<div class="wu-bg-gray-100 wu-p-4 wu-rounded wu-mt-6">
<?php _e('No visits registered in this period.', 'wp-ultimo'); ?>
</div>
<?php endif; ?>

View File

@ -0,0 +1,32 @@
<?php
/**
* Graph base view.
*
* @since 2.0.0
*/
?>
<div class="wu-mt-6 wu-mb-0">
<div v-show="false" class="wu-text-center wu-rounded wu-flex wu-items-center wu-justify-center wu-uppercase wu-font-semibold wu-text-xs wu-h-full wu-text-gray-700" style="height: 300px;">
<span class="wu-blinking-animation">
<?php _e('Loading...', 'wp-ultimo'); ?>
</span>
</div>
<div id="chart_mrr_growth">
<apexchart
v-cloak
height="300"
:type="chart_options.mrr_growth.chartOptions.chart.type"
:options="chart_options.mrr_growth.chartOptions"
:series="chart_options.mrr_growth.series"
>
</apexchart>
</div>
</div>

View File

@ -0,0 +1,75 @@
<?php
/**
* Total widget view.
*
* @since 2.0.0
*/
?>
<div class="wu-styling">
<ul class="md:wu-flex wu-my-0 wu-mx-0">
<li class="wu-p-2 wu-w-full md:wu-w-full wu-relative">
<div>
<strong class="wu-text-gray-800 wu-text-2xl md:wu-text-xl">
<?php echo $new_accounts; ?>
</strong>
</div>
<div class="wu-text-sm wu-text-gray-600">
<span class="wu-block"><?php _e('New Memberships', 'wp-ultimo'); ?></span>
</div>
</li>
</ul>
<div class="wu--mx-3 wu--mb-3 wu-mt-2">
<table class="wp-list-table widefat fixed striped wu-border-t-1 wu-border-l-0 wu-border-r-0">
<thead>
<tr>
<th><?php _e('Product Name', 'wp-ultimo'); ?></th>
<th class="wu-text-right"><?php _e('New Memberships', 'wp-ultimo'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($products) : ?>
<?php foreach ($products as $product) : ?>
<tr>
<td>
<?php echo $product->name; ?>
</td>
<td class="wu-text-right">
<?php echo $product->count; ?>
</td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
<td colspan="2">
<?php _e('No Products found.', 'wp-ultimo'); ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More