Initial Commit
This commit is contained in:
104
views/limitations/plugin-selector.php
Normal file
104
views/limitations/plugin-selector.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/** global $plugins */
|
||||
?>
|
||||
|
||||
<ul data-columns="1" class='items wu--mx-1 wu-overflow-hidden wu-multiselect-content wu-static wu-my-2'>
|
||||
|
||||
<?php foreach ($plugins as $plugin_path => $plugin_data) : ?>
|
||||
|
||||
<li class="item wu-box-border wu-m-0">
|
||||
|
||||
<div class="wu-m-2 wu-bg-gray-100 wu-p-4 wu-border-gray-300 wu-border-solid wu-border wu-rounded">
|
||||
|
||||
<div class="wu-items-center wu-justify-between">
|
||||
|
||||
<div class="wu-block sm:wu-flex wu-items-center">
|
||||
|
||||
<div class="wu-flex-1 wu-flex wu-flex-col wu-justify-between">
|
||||
|
||||
<div>
|
||||
|
||||
<span class="wu-font-bold wu-block wu-text-xs wu-uppercase wu-text-gray-700">
|
||||
|
||||
<?php echo $plugin_data['Name']; ?>
|
||||
|
||||
<?php if (is_plugin_active_for_network($plugin_path)) : ?>
|
||||
|
||||
<span class="wu-text-xs wu-normal-case wu-font-normal wu-ml-2 wu-text-green-600">
|
||||
<?php _e('Network Active', 'wp-ultimo'); ?>
|
||||
</span>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</span>
|
||||
|
||||
<span class="wu-my-2 wu-block">
|
||||
|
||||
<?php echo strip_tags($plugin_data['Description']); ?>
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wu-block wu-mt-4">
|
||||
|
||||
<span class="wu-text-xs wu-text-gray-700 wu-my-1 wu-mr-4 wu-block">
|
||||
<?php printf(__('Version %s', 'wp-ultimo'), $plugin_data['Version']); ?>
|
||||
</span>
|
||||
|
||||
<span class="wu-text-xs wu-text-gray-700 wu-my-1 wu-mr-4 wu-block">
|
||||
<?php printf(__('by %s', 'wp-ultimo'), wp_strip_all_tags($plugin_data['Author'])); ?>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sm:wu-ml-4 sm:wu-w-1/3 wu-mt-4 sm:wu-mt-0">
|
||||
|
||||
<h3 class="wu-mb-1 wu-text-2xs wu-uppercase wu-text-gray-600">
|
||||
|
||||
<?php _e('Visibility', 'wp-ultimo'); ?>
|
||||
|
||||
</h3>
|
||||
|
||||
<select name="modules[plugins][limit][<?php echo esc_attr($plugin_path); ?>][visibility]" class="wu-w-full">
|
||||
<option <?php selected($object->get_limitations()->plugins->{$plugin_path}->visibility === 'visible'); ?> value="visible"><?php _e('Visible', 'wp-ultimo'); ?></option>
|
||||
<option <?php selected($object->get_limitations()->plugins->{$plugin_path}->visibility === 'hidden'); ?> value="hidden"><?php _e('Hidden', 'wp-ultimo'); ?></option>
|
||||
</select>
|
||||
|
||||
<h3 class="wu-my-1 wu-mt-4 wu-text-2xs wu-uppercase wu-text-gray-600">
|
||||
|
||||
<?php _e('Behavior', 'wp-ultimo'); ?>
|
||||
|
||||
</h3>
|
||||
|
||||
<select name="modules[plugins][limit][<?php echo esc_attr($plugin_path); ?>][behavior]" class="wu-w-full">
|
||||
<option <?php selected($object->get_limitations()->plugins->{$plugin_path}->behavior === 'default'); ?> value="default"><?php _e('Default', 'wp-ultimo'); ?></option>
|
||||
<option <?php disabled(is_plugin_active_for_network($plugin_path)) ?> <?php selected($object->get_limitations()->plugins->{$plugin_path}->behavior === 'force_active'); ?> value="force_active"><?php _e('Force Activate', 'wp-ultimo'); ?></option>
|
||||
<option <?php disabled(is_plugin_active_for_network($plugin_path)) ?> <?php selected($object->get_limitations()->plugins->{$plugin_path}->behavior === 'force_inactive'); ?> value="force_inactive"><?php _e('Force Inactivate', 'wp-ultimo'); ?></option>
|
||||
<option <?php selected($object->get_limitations()->plugins->{$plugin_path}->behavior === 'force_active_locked'); ?> value="force_active_locked"><?php _e('Force Activate & Lock', 'wp-ultimo'); ?></option>
|
||||
<option <?php selected($object->get_limitations()->plugins->{$plugin_path}->behavior === 'force_inactive_locked'); ?> value="force_inactive_locked"><?php _e('Force Inactivate & Lock', 'wp-ultimo'); ?></option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ($object->model !== 'product' && $object->get_limitations(false)->plugins->exists($plugin_path)) : ?>
|
||||
|
||||
<p class="wu-m-0 wu-mt-4 wu-p-2 wu-bg-blue-100 wu-text-blue-600 wu-rounded">
|
||||
<?php _e('This value is being applied only to this entity. Changes made to the membership or product permissions will not affect this particular value.', 'wp-ultimo'); ?>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ul>
|
99
views/limitations/site-template-selector.php
Normal file
99
views/limitations/site-template-selector.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/** global $themes */
|
||||
?>
|
||||
|
||||
<ul data-columns="1" class='items wu--mx-1 wu-overflow-hidden wu-multiselect-content wu-static wu-my-2'>
|
||||
|
||||
<?php foreach ($templates as $site_template) : ?>
|
||||
|
||||
<?php
|
||||
|
||||
$key_name = "site_".$site_template->get_id();
|
||||
|
||||
$template_settings = $product->get_limitations()->site_templates->{$key_name};
|
||||
|
||||
?>
|
||||
|
||||
<li class="item wu-box-border wu-m-0">
|
||||
|
||||
<div class="wu-m-2 wu-bg-gray-100 wu-p-4 wu-border-gray-300 wu-border-solid wu-border wu-rounded">
|
||||
|
||||
<div class="wu-flex wu-justify-between wu-items-center">
|
||||
|
||||
<div class="wu-w-1/6 wu-mr-4">
|
||||
|
||||
<img class="wu-rounded wu-w-full wu-image-preview" src="<?php echo esc_url($site_template->get_featured_image('thumb')); ?>" data-image="<?php echo esc_url($site_template->get_featured_image()); ?>">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wu-flex-1">
|
||||
|
||||
<span class="wu-font-bold wu-block wu-text-xs wu-uppercase wu-text-gray-700">
|
||||
|
||||
<?php echo $site_template->get_title(); ?>
|
||||
|
||||
</span>
|
||||
|
||||
<span class="wu-mt-2 wu-block">
|
||||
|
||||
<?php echo wp_trim_words(strip_tags($site_template->get_description()), 40); ?>
|
||||
|
||||
</span>
|
||||
|
||||
<span class="wu-mt-2 wu-block wu-text-xs">
|
||||
|
||||
<?php echo !$site_template->get_categories() ? __('No categories', 'wp-ultimo') : implode(', ', $site_template->get_categories()); ?>
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sm:wu-ml-4 sm:wu-w-1/3 wu-mt-4 sm:wu--mt-1" v-if="site_template_selection_mode === 'choose_available_templates'">
|
||||
|
||||
<h3 class="wu-my-1 wu-text-2xs wu-uppercase wu-text-gray-600">
|
||||
|
||||
<?php _e('Behavior', 'wp-ultimo'); ?>
|
||||
|
||||
</h3>
|
||||
|
||||
<select
|
||||
v-on:change="pre_selected_template = ($event.target.value === 'pre_selected' ? '<?php echo esc_attr($site_template->get_id()); ?>' : '')"
|
||||
name="modules[site_templates][limit][<?php echo esc_attr($site_template->get_id()); ?>][behavior]"
|
||||
class="wu-w-full"
|
||||
>
|
||||
<option <?php selected($template_settings->behavior === 'available'); ?> value="available"><?php _e('Available', 'wp-ultimo'); ?></option>
|
||||
<option <?php selected($template_settings->behavior === 'not_available'); ?> value="not_available"><?php _e('Not Available', 'wp-ultimo'); ?></option>
|
||||
<option :disabled="pre_selected_template !== '' && pre_selected_template !== false && pre_selected_template != '<?php echo esc_attr($site_template->get_id()); ?>'" <?php selected($template_settings->behavior === 'pre_selected'); ?> value="pre_selected"><?php _e('Pre-Selected', 'wp-ultimo'); ?></option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sm:wu-ml-4 wu-flex-shrink wu-mt-4 sm:wu-mt-0" v-if="site_template_selection_mode === 'assign_template'">
|
||||
|
||||
<div class="wu-toggle wu-mt-1">
|
||||
|
||||
<input
|
||||
<?php checked($site_template->get_id() == $product->get_limitations()->site_templates->get_pre_selected_site_template()); ?>
|
||||
class="wu-tgl wu-tgl-ios"
|
||||
value="pre_selected"
|
||||
id="wu-tg-<?php echo esc_attr($site_template->get_id()); ?>"
|
||||
type="checkbox"
|
||||
v-on:click="pre_selected_template = <?php echo esc_attr($site_template->get_id()); ?>"
|
||||
v-bind:checked="pre_selected_template == <?php echo esc_attr($site_template->get_id()); ?>"
|
||||
:name="pre_selected_template == <?php echo esc_attr($site_template->get_id()); ?> ? 'modules[site_templates][limit][<?php echo esc_attr($site_template->get_id()); ?>][behavior]' : ''" />
|
||||
|
||||
<label class="wu-tgl-btn wp-ui-highlight wu-bg-blue-500" for="wu-tg-<?php echo esc_attr($site_template->get_id()); ?>"></label>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ul>
|
104
views/limitations/theme-selector.php
Normal file
104
views/limitations/theme-selector.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/** global $themes */
|
||||
?>
|
||||
|
||||
<ul data-columns="1" class='items wu--mx-1 wu-overflow-hidden wu-multiselect-content wu-static wu-my-2'>
|
||||
|
||||
<?php foreach ($themes as $theme_path => $theme_data) : ?>
|
||||
|
||||
<?php
|
||||
|
||||
$theme_settings = $object->get_limitations()->themes->{$theme_path};
|
||||
|
||||
if ($theme_settings->behavior === 'force_active') {
|
||||
|
||||
$section['state']['force_active_theme'] = $theme_path;
|
||||
|
||||
} // end if;
|
||||
|
||||
?>
|
||||
|
||||
<li class="item wu-box-border wu-m-0">
|
||||
|
||||
<div class="wu-m-2 wu-bg-gray-100 wu-p-4 wu-border-gray-300 wu-border-solid wu-border wu-rounded">
|
||||
|
||||
<div class="wu-flex wu-justify-between">
|
||||
|
||||
<div class="wu-flex-1 wu-flex wu-flex-col wu-justify-between">
|
||||
|
||||
<div class="wu-block">
|
||||
|
||||
<span class="wu-font-bold wu-block wu-text-xs wu-uppercase wu-text-gray-700">
|
||||
|
||||
<?php echo $theme_data['Name']; ?>
|
||||
|
||||
</span>
|
||||
|
||||
<span class="wu-my-2 wu-block">
|
||||
|
||||
<?php echo wp_trim_words(strip_tags($theme_data['Description']), 40); ?>
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wu-block wu-mt-4">
|
||||
|
||||
<span class="wu-text-xs wu-text-gray-700 wu-my-1 wu-mr-4 wu-block">
|
||||
<?php printf(__('Version %s', 'wp-ultimo'), $theme_data['Version']); ?>
|
||||
</span>
|
||||
|
||||
<span class="wu-text-xs wu-text-gray-700 wu-my-1 wu-mr-4 wu-block">
|
||||
<?php printf(__('by %s', 'wp-ultimo'), $theme_data['Author']); ?>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sm:wu-ml-4 sm:wu-w-1/3 wu-mt-4 sm:wu-mt-0">
|
||||
|
||||
<img class="wu-rounded wu-w-full wu-image-preview" src="<?php echo esc_url($theme_data->get_screenshot()); ?>" data-image="<?php echo esc_url($theme_data->get_screenshot()); ?>">
|
||||
|
||||
<h3 class="wu-mb-1 wu-text-2xs wu-uppercase wu-text-gray-600">
|
||||
|
||||
<?php _e('Visibility', 'wp-ultimo'); ?>
|
||||
|
||||
</h3>
|
||||
|
||||
<select name="modules[themes][limit][<?php echo esc_attr($theme_path); ?>][visibility]" class="wu-w-full">
|
||||
<option <?php selected($theme_settings->visibility === 'visible'); ?> value="visible"><?php _e('Visible', 'wp-ultimo'); ?></option>
|
||||
<option <?php selected($theme_settings->visibility === 'hidden'); ?> value="hidden"><?php _e('Hidden', 'wp-ultimo'); ?></option>
|
||||
</select>
|
||||
|
||||
<h3 class="wu-my-1 wu-mt-4 wu-text-2xs wu-uppercase wu-text-gray-600">
|
||||
|
||||
<?php _e('Behavior', 'wp-ultimo'); ?>
|
||||
|
||||
</h3>
|
||||
|
||||
<select v-on:change="force_active_theme = ($event.target.value === 'force_active' ? '<?php echo esc_attr($theme_path); ?>' : '')" name="modules[themes][limit][<?php echo esc_attr($theme_path); ?>][behavior]" class="wu-w-full">
|
||||
<option <?php selected($theme_settings->behavior === 'available'); ?> value="available"><?php _e('Available', 'wp-ultimo'); ?></option>
|
||||
<option <?php selected($theme_settings->behavior === 'not_available'); ?> value="not_available"><?php _e('Not Available', 'wp-ultimo'); ?></option>
|
||||
<option :disabled="force_active_theme !== '' && force_active_theme != '<?php echo esc_attr($theme_path); ?>'" <?php selected($theme_settings->behavior === 'force_active'); ?> value="force_active"><?php _e('Force Activate', 'wp-ultimo'); ?></option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ($object->model !== 'product' && $object->get_limitations(false)->themes->exists($theme_path)) : ?>
|
||||
|
||||
<p class="wu-m-0 wu-mt-4 wu-p-2 wu-bg-blue-100 wu-text-blue-600 wu-rounded">
|
||||
<?php _e('This value is being applied only to this entity. Changes made to the membership or product permissions will not affect this particular value.', 'wp-ultimo'); ?>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ul>
|
Reference in New Issue
Block a user