v 4.0.5 released
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
/*
|
||||
* @Author engr.sumonazma@gmail.com
|
||||
* Copyright: mage-people.com
|
||||
*/
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
if (!class_exists('MPWEM_Admin')) {
|
||||
class MPWEM_Admin {
|
||||
public function __construct() {
|
||||
//if (is_admin()) {
|
||||
$this->load_file();
|
||||
add_action('init', [$this, 'add_dummy_data']);
|
||||
add_filter('use_block_editor_for_post_type', [$this, 'disable_gutenberg'], 10, 2);
|
||||
add_action('upgrader_process_complete', [$this, 'flush_rewrite'], 0);
|
||||
//}
|
||||
}
|
||||
public function flush_rewrite() {
|
||||
flush_rewrite_rules();
|
||||
}
|
||||
private function load_file(): void {
|
||||
if (!class_exists('EDD_SL_Plugin_Updater')) {
|
||||
require_once MPWEM_PLUGIN_DIR . '/lib/classes/EDD_SL_Plugin_Updater.php';
|
||||
}
|
||||
// require_once(dirname(__DIR__) . '/lib/classes/class-wc-product-data.php');
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-form-fields-generator.php');
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-meta-box.php');
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-taxonomy-edit.php');
|
||||
require_once(dirname(__DIR__) . "/support/elementor/elementor-support.php");
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-icon-library.php');
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-icon-popup.php');
|
||||
//****************Global settings************************//
|
||||
require_once MPWEM_PLUGIN_DIR . '/Admin/settings/global/MAGE_Setting_API.php';
|
||||
require_once MPWEM_PLUGIN_DIR . '/Admin/settings/global/admin_setting_panel.php';
|
||||
//************************************//
|
||||
require_once MPWEM_PLUGIN_DIR . '/Admin/mep_dummy_import.php';
|
||||
require_once MPWEM_PLUGIN_DIR . '/Admin/mep_cpt.php';
|
||||
require_once MPWEM_PLUGIN_DIR . '/Admin/status.php';
|
||||
require_once MPWEM_PLUGIN_DIR . '/Admin/MPWEM_Welcome.php';
|
||||
require_once MPWEM_PLUGIN_DIR . '/Admin/MPWEM_Quick_Setup.php';
|
||||
// //****************Taxi settings************************//
|
||||
// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Settings.php';
|
||||
// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_General_Settings.php';
|
||||
// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Price_Settings.php';
|
||||
// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Extra_Service.php';
|
||||
// require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Date_Settings.php';
|
||||
//require_once MPTBM_PLUGIN_DIR . '/Admin/settings/taxi/MPTBM_Gallery_Settings.php';
|
||||
}
|
||||
public function add_dummy_data() {
|
||||
//new MPTBM_Dummy_Import();
|
||||
}
|
||||
//************Disable Gutenberg************************//
|
||||
public function disable_gutenberg($current_status, $post_type) {
|
||||
$user_status = MP_Global_Function::get_settings('general_setting_sec', 'mep_disable_block_editor', 'yes');
|
||||
if ($post_type === 'mep_events' && $user_status == 'yes') {
|
||||
return false;
|
||||
}
|
||||
return $current_status;
|
||||
}
|
||||
}
|
||||
new MPWEM_Admin();
|
||||
}
|
|
@ -0,0 +1,296 @@
|
|||
<?php
|
||||
/*
|
||||
* @Author engr.sumonazma@gmail.com
|
||||
* Copyright: mage-people.com
|
||||
*/
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
if (!class_exists('MPWEM_Quick_Setup')) {
|
||||
class MPWEM_Quick_Setup {
|
||||
public function __construct() {
|
||||
if (!class_exists('MPTBM_Dependencies')) {
|
||||
add_action('admin_enqueue_scripts', array($this, 'add_admin_scripts'));
|
||||
}
|
||||
add_action('admin_menu', array($this, 'quick_setup_menu'));
|
||||
}
|
||||
public function add_admin_scripts() {
|
||||
wp_enqueue_style('mp_plugin_global', MPWEM_PLUGIN_URL . '/assets/helper/mp_style/mp_style.css', array(), time());
|
||||
wp_enqueue_script('mp_plugin_global', MPWEM_PLUGIN_URL . '/assets/helper/mp_style/mp_script.js', array('jquery'), time(), true);
|
||||
wp_enqueue_script('mp_admin_settings', MPWEM_PLUGIN_URL . '/assets/admin/mp_admin_settings.js', array('jquery'), time(), true);
|
||||
wp_enqueue_style('mp_admin_settings', MPWEM_PLUGIN_URL . '/assets/admin/mp_admin_settings.css', array(), time());
|
||||
wp_enqueue_style('mp_font_awesome', '//cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/all.min.css', array(), '5.15.4');
|
||||
}
|
||||
public function quick_setup_menu() {
|
||||
$status = MP_Global_Function::check_woocommerce();
|
||||
if ($status == 1) {
|
||||
add_submenu_page('edit.php?post_type=mep_events', __('Quick Setup', 'mage-eventpress'), '<span style="color:#10dd10">' . esc_html__('Quick Setup', 'mage-eventpress') . '</span>', 'manage_options', 'mpwem_quick_setup', array($this, 'quick_setup'));
|
||||
add_submenu_page('mep_events', esc_html__('Quick Setup', 'mage-eventpress'), '<span style="color:#10dd10">' . esc_html__('Quick Setup', 'mage-eventpress') . '</span>', 'manage_options', 'mpwem_quick_setup', array($this, 'quick_setup'));
|
||||
}
|
||||
else {
|
||||
add_menu_page(esc_html__('Events', 'mage-eventpress'), esc_html__('Events', 'mage-eventpress'), 'manage_options', 'mep_events', array($this, 'quick_setup'), 'dashicons-calendar-alt', 6);
|
||||
add_submenu_page('mep_events', esc_html__('Quick Setup', 'mage-eventpress'), '<span style="color:#10dd17">' . esc_html__('Quick Setup', 'mage-eventpress') . '</span>', 'manage_options', 'mpwem_quick_setup', array($this, 'quick_setup'));
|
||||
}
|
||||
}
|
||||
public function quick_setup() {
|
||||
$status = MP_Global_Function::check_woocommerce();
|
||||
if (isset($_POST['active_woo_btn'])) {
|
||||
?>
|
||||
<script>
|
||||
dLoaderBody();
|
||||
</script>
|
||||
<?php
|
||||
activate_plugin('woocommerce/woocommerce.php');
|
||||
//MPTBM_Plugin::on_activation_page_create();
|
||||
?>
|
||||
<script>
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
let mpwem_admin_location = window.location.href;
|
||||
mpwem_admin_location = mpwem_admin_location.replace('admin.php?post_type=mep_events&page=mpwem_quick_setup', 'edit.php?post_type=mep_events&page=mpwem_quick_setup');
|
||||
mpwem_admin_location = mpwem_admin_location.replace('admin.php?page=mep_events', 'edit.php?post_type=mep_events&page=mpwem_quick_setup');
|
||||
mpwem_admin_location = mpwem_admin_location.replace('admin.php?page=mpwem_quick_setup', 'edit.php?post_type=mep_events&page=mpwem_quick_setup');
|
||||
window.location.href = mpwem_admin_location;
|
||||
});
|
||||
}(jQuery));
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
if (isset($_POST['install_and_active_woo_btn'])) {
|
||||
echo '<div style="display:none">';
|
||||
include_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
|
||||
include_once(ABSPATH . 'wp-admin/includes/file.php');
|
||||
include_once(ABSPATH . 'wp-admin/includes/misc.php');
|
||||
include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php');
|
||||
$plugin = 'woocommerce';
|
||||
$api = plugins_api('plugin_information', array(
|
||||
'slug' => $plugin,
|
||||
'fields' => array(
|
||||
'short_description' => false,
|
||||
'sections' => false,
|
||||
'requires' => false,
|
||||
'rating' => false,
|
||||
'ratings' => false,
|
||||
'downloaded' => false,
|
||||
'last_updated' => false,
|
||||
'added' => false,
|
||||
'tags' => false,
|
||||
'compatibility' => false,
|
||||
'homepage' => false,
|
||||
'donate_link' => false,
|
||||
),
|
||||
));
|
||||
$title = 'title';
|
||||
$url = 'url';
|
||||
$nonce = 'nonce';
|
||||
$woocommerce_plugin = new Plugin_Upgrader(new Plugin_Installer_Skin(compact('title', 'url', 'nonce', 'plugin', 'api')));
|
||||
$woocommerce_plugin->install($api->download_link);
|
||||
activate_plugin('woocommerce/woocommerce.php');
|
||||
//MPTBM_Plugin::on_activation_page_create();
|
||||
echo '</div>';
|
||||
?>
|
||||
<script>
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
let mpwem_admin_location = window.location.href;
|
||||
mpwem_admin_location = mpwem_admin_location.replace('admin.php?post_type=mep_events&page=mpwem_quick_setup', 'edit.php?post_type=mep_events&page=mpwem_quick_setup');
|
||||
mpwem_admin_location = mpwem_admin_location.replace('admin.php?page=mep_events', 'edit.php?post_type=mep_events&page=mpwem_quick_setup');
|
||||
mpwem_admin_location = mpwem_admin_location.replace('admin.php?page=mpwem_quick_setup', 'edit.php?post_type=mep_events&page=mpwem_quick_setup');
|
||||
window.location.href = mpwem_admin_location;
|
||||
});
|
||||
}(jQuery));
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
if (isset($_POST['finish_quick_setup'])) {
|
||||
$label = isset($_POST['event_label']) ? sanitize_text_field($_POST['event_label']) : 'Events';
|
||||
$slug = isset($_POST['event_slug']) ? sanitize_text_field($_POST['event_slug']) : 'event';
|
||||
$event_expire_on = isset($_POST['event_expire_on']) ? sanitize_text_field($_POST['event_expire_on']) : 'event_expire_datetime';
|
||||
$email_from_name = isset($_POST['email_from_name']) ? sanitize_text_field($_POST['email_from_name']) : get_bloginfo('name');
|
||||
$email_from_addrss = isset($_POST['email_from_address']) ? sanitize_text_field($_POST['email_from_address']) : "no-reply@$url";
|
||||
$general_settings_data = get_option('general_setting_sec');
|
||||
$email_settings_data = get_option('email_setting_sec');
|
||||
$update_general_settings_arr = [
|
||||
'mep_event_label' => $label,
|
||||
'mep_event_slug' => $slug,
|
||||
'mep_event_expire_on_datetimes' => $event_expire_on
|
||||
];
|
||||
$update_email_settings_arr = [
|
||||
'mep_email_form_name' => $email_from_name,
|
||||
'mep_email_form_email' => $email_from_addrss
|
||||
];
|
||||
$new_general_settings_data = is_array($general_settings_data) ? array_replace($general_settings_data, $update_general_settings_arr) : $update_general_settings_arr;
|
||||
$new_email_settings_data = is_array($email_settings_data) ? array_replace($email_settings_data, $update_email_settings_arr) : $update_email_settings_arr;
|
||||
update_option('general_setting_sec', $new_general_settings_data);
|
||||
update_option('email_setting_sec', $new_email_settings_data);
|
||||
update_option('mep_quick_setup', 'done');
|
||||
wp_redirect(admin_url('edit.php?post_type=mep_events'));
|
||||
}
|
||||
?>
|
||||
<div class="mpStyle">
|
||||
<div class=_dShadow_6_adminLayout">
|
||||
<form method="post" action="">
|
||||
<div class="mpTabsNext">
|
||||
<div class="tabListsNext _max_700_mAuto">
|
||||
<div data-tabs-target-next="#mpwem_qs_welcome" class="tabItemNext" data-open-text="1" data-close-text=" " data-open-icon="" data-close-icon="fas fa-check" data-add-class="success">
|
||||
<h4 class="circleIcon" data-class>
|
||||
<span class="mp_zero" data-icon></span>
|
||||
<span class="mp_zero" data-text>1</span>
|
||||
</h4>
|
||||
<h6 class="circleTitle" data-class><?php esc_html_e('Welcome', 'mage-eventpress'); ?></h6>
|
||||
</div>
|
||||
<div data-tabs-target-next="#mpwem_qs_general" class="tabItemNext" data-open-text="2" data-close-text="" data-open-icon="" data-close-icon="fas fa-check" data-add-class="success">
|
||||
<h4 class="circleIcon" data-class>
|
||||
<span class="mp_zero" data-icon></span>
|
||||
<span class="mp_zero" data-text>2</span>
|
||||
</h4>
|
||||
<h6 class="circleTitle" data-class><?php esc_html_e('General', 'mage-eventpress'); ?></h6>
|
||||
</div>
|
||||
<div data-tabs-target-next="#mpwem_qs_done" class="tabItemNext" data-open-text="3" data-close-text="" data-open-icon="" data-close-icon="fas fa-check" data-add-class="success">
|
||||
<h4 class="circleIcon" data-class>
|
||||
<span class="mp_zero" data-icon></span>
|
||||
<span class="mp_zero" data-text>3</span>
|
||||
</h4>
|
||||
<h6 class="circleTitle" data-class><?php esc_html_e('Done', 'mage-eventpress'); ?></h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabsContentNext _infoLayout_mT">
|
||||
<?php
|
||||
$this->setup_welcome_content();
|
||||
$this->setup_general_content();
|
||||
$this->setup_content_done();
|
||||
?>
|
||||
</div>
|
||||
<?php if ($status == 1) { ?>
|
||||
<div class="justifyBetween">
|
||||
<button type="button" class="mpBtn nextTab_prev">
|
||||
<span>⟵<?php esc_html_e('Previous', 'mage-eventpress'); ?></span>
|
||||
</button>
|
||||
<div></div>
|
||||
<button type="button" class="themeButton nextTab_next">
|
||||
<span><?php esc_html_e('Next', 'mage-eventpress'); ?>⟶</span>
|
||||
</button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
public function setup_welcome_content() {
|
||||
$status = MP_Global_Function::check_woocommerce();
|
||||
?>
|
||||
<div data-tabs-next="#mpwem_qs_welcome">
|
||||
<h2><?php esc_html_e('Event Manager and Tickets Selling Plugin', 'mage-eventpress'); ?></h2>
|
||||
<p class="mTB_xs"><?php esc_html_e('Thanks for choosing Event Manager and Tickets Selling Plugin for WooCommerce for your site, Please go step by step and choose some options to get started.', 'mage-eventpress'); ?></p>
|
||||
<div class="_dLayout_mT_alignCenter justifyBetween">
|
||||
<h5>
|
||||
<?php if ($status == 1) {
|
||||
esc_html_e('Woocommerce already installed and activated', 'mage-eventpress');
|
||||
}
|
||||
elseif ($status == 0) {
|
||||
esc_html_e('Woocommerce need to install and active', 'mage-eventpress');
|
||||
}
|
||||
else {
|
||||
esc_html_e('Woocommerce already install , please activate it', 'mage-eventpress');
|
||||
} ?>
|
||||
</h5>
|
||||
<?php if ($status == 1) { ?>
|
||||
<h5>
|
||||
<span class="fas fa-check-circle textSuccess"></span>
|
||||
</h5>
|
||||
<?php } elseif ($status == 0) { ?>
|
||||
<button class="warningButton" type="submit" name="install_and_active_woo_btn"><?php esc_html_e('Install & Active Now', 'mage-eventpress'); ?></button>
|
||||
<?php } else { ?>
|
||||
<button class="themeButton" type="submit" name="active_woo_btn"><?php esc_html_e('Active Now', 'mage-eventpress'); ?></button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
public function setup_general_content() {
|
||||
$url = (isset($_SERVER['HTTPS']) ? "" : "") . "$_SERVER[HTTP_HOST]";
|
||||
$label = MP_Global_Function::get_settings('general_setting_sec', 'mep_event_label', 'Events');
|
||||
$slug = MP_Global_Function::get_settings('general_setting_sec', 'mep_event_slug', 'event');
|
||||
$expire = MP_Global_Function::get_settings('general_setting_sec', 'mep_event_expire_on_datetimes', 'event_expire_datetime');
|
||||
$from_email = MP_Global_Function::get_settings('email_setting_sec', 'mep_email_form_name', get_bloginfo('name'));
|
||||
$from_email_address = MP_Global_Function::get_settings('email_setting_sec', 'mep_email_form_email', "no-reply@$url");
|
||||
?>
|
||||
<div data-tabs-next="#mpwem_qs_general">
|
||||
<div class="section">
|
||||
<h2><?php esc_html_e('General settings', 'mage-eventpress'); ?></h2>
|
||||
<p class="mTB_xs"><?php esc_html_e('Choose some general option.', 'mage-eventpress'); ?></p>
|
||||
<div class="_dLayout_mT">
|
||||
<label class="_fullWidth">
|
||||
<span class="min_200"><?php esc_html_e('Events Label:', 'mage-eventpress'); ?></span>
|
||||
<input type="text" class="formControl" name="event_label" value='<?php echo esc_attr($label); ?>'/>
|
||||
</label>
|
||||
<i class="info_text">
|
||||
<span class="fas fa-info-circle"></span>
|
||||
<?php esc_html_e('It will change the Events post type label on the entire plugin.', 'mage-eventpress'); ?>
|
||||
</i>
|
||||
<div class="divider"></div>
|
||||
<label class="_fullWidth">
|
||||
<span class="min_200"><?php esc_html_e('Events Slug:', 'mage-eventpress'); ?></span>
|
||||
<input type="text" class="formControl" name="event_slug" value='<?php echo esc_attr($slug); ?>'/>
|
||||
</label>
|
||||
<i class="info_text">
|
||||
<span class="fas fa-info-circle"></span>
|
||||
<?php esc_html_e('It will change the Events slug on the entire plugin. Remember after changing this slug you need to flush permalinks. Just go to Settings->Permalinks hit the Save Settings button', 'mage-eventpress'); ?>
|
||||
</i>
|
||||
<div class="divider"></div>
|
||||
<label class="_fullWidth">
|
||||
<span class="min_200"><?php esc_html_e('When will the event expire', 'mage-eventpress'); ?></span>
|
||||
<select class="formControl" name="event_expire_on">
|
||||
<option value="event_start_datetime" <?php if ($expire == 'event_start_datetime') {
|
||||
echo 'Selected';
|
||||
} ?>><?php _e('Event Start Time', 'mage-eventpress'); ?></option>
|
||||
<option value="event_expire_datetime" <?php if ($expire == 'event_expire_datetime') {
|
||||
echo 'Selected';
|
||||
} ?>><?php _e('Event End Time', 'mage-eventpress'); ?></option>
|
||||
</select>
|
||||
</label>
|
||||
<i class="info_text">
|
||||
<span class="fas fa-info-circle"></span>
|
||||
<?php esc_html_e('Please select when the event will expire', 'mage-eventpress'); ?>
|
||||
</i>
|
||||
<div class="divider"></div>
|
||||
<label class="_fullWidth">
|
||||
<span class="min_200"><?php esc_html_e('Email From Name:', 'mage-eventpress'); ?></span>
|
||||
<input type="text" class="formControl" name="email_from_name" value='<?php echo esc_attr($from_email); ?>'/>
|
||||
</label>
|
||||
<i class="info_text">
|
||||
<span class="fas fa-info-circle"></span>
|
||||
<?php esc_html_e('Please enter the email from name', 'mage-eventpress'); ?>
|
||||
</i>
|
||||
<div class="divider"></div>
|
||||
<label class="_fullWidth">
|
||||
<span class="min_200"><?php esc_html_e('From Email Address:', 'mage-eventpress'); ?></span>
|
||||
<input type="text" class="formControl" name="email_from_address" value='<?php echo esc_attr($from_email_address); ?>'/>
|
||||
</label>
|
||||
<i class="info_text">
|
||||
<span class="fas fa-info-circle"></span>
|
||||
<?php esc_html_e('Please enter the email from name', 'mage-eventpress'); ?>
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
public function setup_content_done() {
|
||||
?>
|
||||
<div data-tabs-next="#mpwem_qs_done">
|
||||
<h2><?php esc_html_e('Finalize Setup', 'mage-eventpress'); ?></h2>
|
||||
<p class="mTB_xs"><?php esc_html_e('You are about to Finish & Save Events Booking Manager For Woocommerce Plugin setup process', 'mage-eventpress'); ?></p>
|
||||
<div class="mT allCenter">
|
||||
<button type="submit" name="finish_quick_setup" class="themeButton"><?php esc_html_e('Finish & Save', 'mage-eventpress'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
new MPWEM_Quick_Setup();
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<?php
|
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
/**
|
||||
* The Magical Event Post Type Going to registred here to make your WordPress and WooCommerce a Event Manager :)
|
||||
*/
|
||||
function mep_cpt() {
|
||||
$speaker_status = mep_get_option('mep_enable_speaker_list', 'single_event_setting_sec', 'no');
|
||||
$event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events');
|
||||
$event_slug = mep_get_option('mep_event_slug', 'general_setting_sec', 'events');
|
||||
$event_icon = mep_get_option('mep_event_icon', 'general_setting_sec', 'dashicons-calendar-alt');
|
||||
$labels = array(
|
||||
'name' => __($event_label, 'mage-eventpress'),
|
||||
'singular_name' => __($event_label, 'mage-eventpress'),
|
||||
'menu_name' => __($event_label, 'mage-eventpress'),
|
||||
'name_admin_bar' => __($event_label, 'mage-eventpress'),
|
||||
'archives' => __($event_label . ' List', 'mage-eventpress'),
|
||||
'attributes' => __($event_label . ' List', 'mage-eventpress'),
|
||||
'parent_item_colon' => __($event_label . ' Item:', 'mage-eventpress'),
|
||||
'all_items' => __('All ', 'mage-eventpress') . $event_label,
|
||||
'add_new_item' => __('Add New ', 'mage-eventpress') . $event_label,
|
||||
'add_new' => __('Add New ', 'mage-eventpress') . $event_label,
|
||||
'new_item' => __('New ', 'mage-eventpress') . $event_label,
|
||||
'edit_item' => __('Edit ', 'mage-eventpress') . $event_label,
|
||||
'update_item' => __('Update ', 'mage-eventpress') . $event_label,
|
||||
'view_item' => __('View ', 'mage-eventpress') . $event_label,
|
||||
'view_items' => __('View ', 'mage-eventpress') . $event_label,
|
||||
'search_items' => __('Search ', 'mage-eventpress') . $event_label,
|
||||
'not_found' => $event_label . __(' Not found', 'mage-eventpress'),
|
||||
'not_found_in_trash' => $event_label . __(' Not found in Trash', 'mage-eventpress'),
|
||||
'featured_image' => $event_label . __(' Feature Image', 'mage-eventpress'),
|
||||
'set_featured_image' => __('Set ', 'mage-eventpress') . $event_label . __(' featured image', 'mage-eventpress'),
|
||||
'remove_featured_image' => __('Remove ', 'mage-eventpress') . $event_label . __(' featured image', 'mage-eventpress'),
|
||||
'use_featured_image' => __('Use as ', 'mage-eventpress') . $event_label . __(' featured image', 'mage-eventpress'),
|
||||
'insert_into_item' => __('Insert into ', 'mage-eventpress') . $event_label,
|
||||
'uploaded_to_this_item' => __('Uploaded to this ', 'mage-eventpress') . $event_label,
|
||||
'items_list' => $event_label . __(' list', 'mage-eventpress'),
|
||||
'items_list_navigation' => $event_label . __(' list navigation', 'mage-eventpress'),
|
||||
'filter_items_list' => __('Filter ', 'mage-eventpress') . $event_label . __(' list', 'mage-eventpress'),
|
||||
);
|
||||
$rewrite = array(
|
||||
'slug' => $event_slug,
|
||||
'with_front' => true,
|
||||
'pages' => true,
|
||||
'feeds' => true,
|
||||
);
|
||||
$args = array(
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'labels' => $labels,
|
||||
'menu_icon' => $event_icon,
|
||||
'supports' => apply_filters('mep_events_post_type_support', array('title', 'editor', 'thumbnail', 'excerpt')),
|
||||
'rewrite' => $rewrite,
|
||||
'show_in_rest' => apply_filters('mep_events_post_type_show_in_rest', true)
|
||||
);
|
||||
register_post_type('mep_events', $args);
|
||||
$labels = array(
|
||||
'name' => __('Speakers', 'mage-eventpress'),
|
||||
'singular_name' => __('Speaker', 'mage-eventpress'),
|
||||
'menu_name' => __('Speakers', 'mage-eventpress'),
|
||||
'name_admin_bar' => __('Speakers', 'mage-eventpress'),
|
||||
'archives' => __('Speakers List', 'mage-eventpress'),
|
||||
'attributes' => __('Speakers List', 'mage-eventpress'),
|
||||
'parent_item_colon' => __('Speakers Item:', 'mage-eventpress'),
|
||||
'all_items' => __('Speakers', 'mage-eventpress'),
|
||||
'add_new_item' => __('Add New Speaker', 'mage-eventpress'),
|
||||
'add_new' => __('Add New Speaker', 'mage-eventpress'),
|
||||
'new_item' => __('New Speaker', 'mage-eventpress'),
|
||||
'edit_item' => __('Edit Speaker', 'mage-eventpress'),
|
||||
'update_item' => __('Update Speaker', 'mage-eventpress'),
|
||||
'view_item' => __('View Speaker', 'mage-eventpress'),
|
||||
'view_items' => __('View Speaker', 'mage-eventpress'),
|
||||
'search_items' => __('Search Speaker', 'mage-eventpress'),
|
||||
'not_found' => __('Speaker Not found', 'mage-eventpress'),
|
||||
'not_found_in_trash' => __('Speaker Not found in Trash', 'mage-eventpress'),
|
||||
'featured_image' => __('Speaker Image', 'mage-eventpress'),
|
||||
'set_featured_image' => __('Set Speaker image', 'mage-eventpress'),
|
||||
'remove_featured_image' => __('Remove Speaker image', 'mage-eventpress'),
|
||||
'use_featured_image' => __('Use as Speaker image', 'mage-eventpress'),
|
||||
'insert_into_item' => __('Insert into Speaker', 'mage-eventpress'),
|
||||
'uploaded_to_this_item' => __('Uploaded to this Speaker', 'mage-eventpress'),
|
||||
'items_list' => __('Speaker list', 'mage-eventpress'),
|
||||
'items_list_navigation' => __('Speaker list navigation', 'mage-eventpress'),
|
||||
'filter_items_list' => __('Filter Speaker list', 'mage-eventpress'),
|
||||
);
|
||||
$sprewrite = array(
|
||||
'slug' => 'event-speaker',
|
||||
'with_front' => true,
|
||||
'pages' => true,
|
||||
'feeds' => true,
|
||||
);
|
||||
$args = array(
|
||||
'public' => true,
|
||||
'labels' => $labels,
|
||||
'menu_icon' => 'dashicons-calendar-alt',
|
||||
'supports' => array('title', 'editor', 'thumbnail', 'excerpt'),
|
||||
'rewrite' => $sprewrite,
|
||||
'show_in_menu' => 'edit.php?post_type=mep_events',
|
||||
'show_in_rest' => apply_filters('mep_speaker_post_type_show_in_rest', true)
|
||||
);
|
||||
if ($speaker_status == 'yes') {
|
||||
register_post_type('mep_event_speaker', $args);
|
||||
}
|
||||
}
|
||||
add_action('init', 'mep_cpt');
|
|
@ -1256,21 +1256,18 @@ if (!class_exists('MAGE_Events_Setting_Controls')) :
|
|||
}
|
||||
|
||||
function plugin_page() {
|
||||
echo '<div class="wrap">';
|
||||
settings_errors();
|
||||
echo '</div>';
|
||||
echo '<div class="mep_settings_wrapper">';
|
||||
echo '<div class="mep_settings_inner_wrapper">';
|
||||
echo '<div class="mep_settings_panel_header">';
|
||||
echo mep_get_plugin_data('Name');
|
||||
echo '<small>'.mep_get_plugin_data('Version').'</small>';
|
||||
echo '</div>';
|
||||
echo '<div class="mage_settings_panel_wrap mep_settings_panel">';
|
||||
$this->settings_api->show_navigation();
|
||||
$this->settings_api->show_forms();
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
$label = mep_get_plugin_data('Name');
|
||||
?>
|
||||
<div class="mp_settings_panel_header">
|
||||
<h3>
|
||||
<?php echo esc_html($label . esc_html__(' Global Settings', 'mage-eventpress')); ?>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="mp_settings_panel">
|
||||
<?php $this->settings_api->show_navigation(); ?>
|
||||
<?php $this->settings_api->show_forms(); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1296,20 +1293,37 @@ $settings = new MAGE_Events_Setting_Controls();
|
|||
|
||||
|
||||
function mep_get_option($option, $section, $default = '') {
|
||||
|
||||
$options = get_option($section);
|
||||
|
||||
if (isset($options[$option])) {
|
||||
if(is_array($options[$option])){
|
||||
|
||||
if(!empty($options[$option])){
|
||||
return $options[$option];
|
||||
}else{
|
||||
return $default;
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
if(!empty($options[$option])){
|
||||
// return $options[$option];
|
||||
return wp_kses_post($options[$option]);
|
||||
}else{
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($default)){
|
||||
return $default;
|
||||
}else{
|
||||
return wp_kses_post($default);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1416,7 +1430,7 @@ function mep_settings_template_page($form) {
|
|||
let name = jQuery(this).data('name');
|
||||
jQuery.ajax({
|
||||
type: 'POST',
|
||||
url: ajaxurl,
|
||||
url: mp_ajax_url,
|
||||
data: {
|
||||
"action": "mep_import_ajax_template",
|
||||
"nonce": '<?php echo wp_create_nonce('mep-ajax-import-template-nonce'); ?>',
|
|
@ -0,0 +1 @@
|
|||
<?php
|
|
@ -0,0 +1 @@
|
|||
<?php
|
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
//Add admin page to the menu
|
||||
add_action('admin_menu', 'mep_event_status_admin_menu');
|
||||
function mep_event_status_admin_menu() {
|
||||
add_submenu_page('edit.php?post_type=mep_events', __('Status', 'mage-eventpress'), __('<span style="color:yellow">Status</span>', 'mage-eventpress'), 'manage_options', 'mep_event_status_page', 'mep_event_status_page');
|
||||
}
|
||||
function mep_event_status_page() {
|
||||
$wp_v = get_bloginfo('version');
|
||||
$wc_v = WC()->version;
|
||||
$wc_i = mep_woo_install_check();
|
||||
$from_name = mep_get_option('mep_email_form_name', 'email_setting_sec', '');
|
||||
$from_email = mep_get_option('mep_email_form_email', 'email_setting_sec', '');
|
||||
?>
|
||||
<!-- Create a header in the default WordPress 'wrap' container -->
|
||||
<div class="wrap"></div>
|
||||
<?php do_action('mep_event_status_notice_sec'); ?>
|
||||
<div class="wc_status_table_wrapper">
|
||||
<table class="wc_status_table widefat" cellspacing="0" id="status">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="WordPress Environment">
|
||||
<h2>Event Manager For Woocommerce Environment Status</h2>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-export-label="WC Version">WordPress Version:</td>
|
||||
<td class="help">
|
||||
<span class="woocommerce-help-tip"></span>
|
||||
</td>
|
||||
<td><?php if ($wp_v > 5.5) {
|
||||
echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>' . esc_html($wp_v) . '</span>';
|
||||
} else {
|
||||
echo '<span class="mep_warning"> <span class="dashicons dashicons-saved"></span>' . esc_html($wp_v) . '</span>';
|
||||
} ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WC Version">Woocommerce Installed:</td>
|
||||
<td class="help">
|
||||
<span class="woocommerce-help-tip"></span>
|
||||
</td>
|
||||
<td><?php if ($wc_i == 'Yes') {
|
||||
echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>' . esc_html($wc_i) . '</span>';
|
||||
} else {
|
||||
echo '<span class="mep_error"> <span class="dashicons dashicons-no-alt"></span>' . esc_html($wc_i) . '</span>';
|
||||
} ?></td>
|
||||
</tr>
|
||||
<?php if (mep_woo_install_check() == 'Yes') { ?>
|
||||
<tr>
|
||||
<td data-export-label="WC Version">Woocommerce Version:</td>
|
||||
<td class="help">
|
||||
<span class="woocommerce-help-tip"></span>
|
||||
</td>
|
||||
<td><?php if ($wc_v > 4.8) {
|
||||
echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>' . esc_html($wc_v) . '</span>';
|
||||
} else {
|
||||
echo '<span class="mep_warning"> <span class="dashicons dashicons-no-alt"></span>' . esc_html($wc_v) . '</span>';
|
||||
} ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WC Version">Email From Name:</td>
|
||||
<td class="help">
|
||||
<span class="woocommerce-help-tip"></span>
|
||||
</td>
|
||||
<td><?php if ($from_name) {
|
||||
echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>' . esc_html($from_name) . '</span>';
|
||||
} else {
|
||||
echo '<span class="mep_error"> <span class="dashicons dashicons-no-alt"></span></span>';
|
||||
} ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WC Version">From Email Address:</td>
|
||||
<td class="help">
|
||||
<span class="woocommerce-help-tip"></span>
|
||||
</td>
|
||||
<td><?php if ($from_email) {
|
||||
echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>' . esc_html($from_email) . '</span>';
|
||||
} else {
|
||||
echo '<span class="mep_error"> <span class="dashicons dashicons-no-alt"></span></span>';
|
||||
} ?></td>
|
||||
</tr>
|
||||
<?php }
|
||||
do_action('mep_event_status_table_item_sec'); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
(function ($) {
|
||||
"use strict";
|
||||
$(window).load(function () {
|
||||
$('.mp_tab_menu').each(function () {
|
||||
$(this).find('ul li:first-child').trigger('click');
|
||||
});
|
||||
if ($('[name="mep_org_address"]').val() > 0) {
|
||||
$('.mp_event_address').slideUp(250);
|
||||
}
|
||||
});
|
||||
$(document).on('click', '[data-target-tabs]', function () {
|
||||
if (!$(this).hasClass('active')) {
|
||||
let tabsTarget = $(this).attr('data-target-tabs');
|
||||
let targetParent = $(this).closest('.mp_event_tab_area').find('.mp_tab_details').first();
|
||||
targetParent.children('.mp_tab_item:visible').slideUp('fast');
|
||||
targetParent.children('.mp_tab_item[data-tab-item="' + tabsTarget + '"]').slideDown(250);
|
||||
$(this).siblings('li.active').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click', 'label.mp_event_virtual_type_des_switch input', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
$(this).parents('label.mp_event_virtual_type_des_switch').siblings('label.mp_event_virtual_type_des').slideDown(200);
|
||||
$(".mep_event_tab_location_content").hide(200);
|
||||
} else {
|
||||
$(this).parents('label.mp_event_virtual_type_des_switch').siblings('label.mp_event_virtual_type_des').val('').slideUp(200);
|
||||
$(".mep_event_tab_location_content").show(200);
|
||||
}
|
||||
});
|
||||
$(document).on('click', 'label.mp_event_ticket_type_des_switch input', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
// $(this).parents('label.mp_event_ticket_type_des_switch').siblings('label.mep_ticket_type_setting_sec').slideDown(200);
|
||||
$(".mep_ticket_type_setting_sec").slideDown(200);
|
||||
} else {
|
||||
// $(this).parents('label.mp_event_ticket_type_des_switch').siblings('label.mep_ticket_type_setting_sec').val('').slideUp(200);
|
||||
$(".mep_ticket_type_setting_sec").slideUp(200);
|
||||
}
|
||||
});
|
||||
$(document).on('click', 'label.mep_enable_custom_dt_format input', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
// $(this).parents('label.mp_event_ticket_type_des_switch').siblings('label.mep_ticket_type_setting_sec').slideDown(200);
|
||||
$(".mep_custom_timezone_setting").slideDown(200);
|
||||
} else {
|
||||
// $(this).parents('label.mp_event_ticket_type_des_switch').siblings('label.mep_ticket_type_setting_sec').val('').slideUp(200);
|
||||
$(".mep_custom_timezone_setting").slideUp(200);
|
||||
}
|
||||
});
|
||||
$(document).on('click', 'label.mp_event_ticket_type_advance_col_switch input', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
// $(this).parents('label.mp_event_ticket_type_des_switch').siblings('label.mep_ticket_type_setting_sec').slideDown(200);
|
||||
$(".mep_hide_on_load").slideDown(200);
|
||||
} else {
|
||||
// $(this).parents('label.mp_event_ticket_type_des_switch').siblings('label.mep_ticket_type_setting_sec').val('').slideUp(200);
|
||||
$(".mep_hide_on_load").slideUp(200);
|
||||
}
|
||||
});
|
||||
$(document).ready(function () {
|
||||
$('#add-row-t').on('click', function () {
|
||||
var row = $('.empty-row-t.screen-reader-text').clone(true);
|
||||
row.removeClass('empty-row-t screen-reader-text');
|
||||
row.insertBefore('#repeatable-fieldset-one-t tbody>tr:last');
|
||||
$('#mep_ticket_type_empty option[value=inputbox]').attr('selected', 'selected');
|
||||
$('.empty-row-t #mep_ticket_type_empty option[value=inputbox]').removeAttr('selected');
|
||||
//return false;
|
||||
});
|
||||
$('.remove-row-t').on('click', function () {
|
||||
if (confirm('Are You Sure , Remove this row ? \n\n 1. Ok : To Remove . \n 2. Cancel : To Cancel .')) {
|
||||
$(this).parents('tr').remove();
|
||||
$('#mep_ticket_type_empty option[value=inputbox]').removeAttr('selected');
|
||||
$('#mep_ticket_type_empty option[value=dropdown]').removeAttr('selected');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$(document).find('.mp_event_type_sortable').sortable({
|
||||
handle: $(this).find('.mp_event_type_sortable_button')
|
||||
});
|
||||
$('#add-row').on('click', function () {
|
||||
var row = $('.empty-row.screen-reader-text').clone(true);
|
||||
row.removeClass('empty-row screen-reader-text');
|
||||
row.insertBefore('#repeatable-fieldset-one tbody>tr:last');
|
||||
return false;
|
||||
});
|
||||
$('.remove-row').on('click', function () {
|
||||
if (confirm('Are You Sure , Remove this row ? \n\n 1. Ok : To Remove . \n 2. Cancel : To Cancel .')) {
|
||||
$(this).parents('tr').remove();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$('#add-new-date-row').on('click', function () {
|
||||
var row = $('.empty-row-d.screen-reader-text').clone(true);
|
||||
row.removeClass('empty-row-d screen-reader-text');
|
||||
row.insertBefore('#repeatable-fieldset-one-d tbody>tr:last');
|
||||
return false;
|
||||
});
|
||||
$('.remove-row-d').on('click', function () {
|
||||
if (confirm('Are You Sure , Remove this row ? \n\n 1. Ok : To Remove . \n 2. Cancel : To Cancel .')) {
|
||||
$(this).parents('tr').remove();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
$(document).on('keyup change', '.mp_ticket_type_table [name="option_name_t[]"],.mp_ticket_type_table [name="option_name[]"]', function () {
|
||||
let n = $(this).val();
|
||||
$(this).val(n.replace(/[@%'":;&_]/g, ''));
|
||||
});
|
||||
}(jQuery));
|
|
@ -0,0 +1,170 @@
|
|||
@charset "utf-8";
|
||||
/******************************************************************** Global settings ************************************************/
|
||||
@media only screen and (min-width: 10px) {
|
||||
div.mp_settings_panel {overflow: hidden;position: relative;display: -webkit-flex;display: flex; line-height: 1.4;}
|
||||
div.mp_settings_panel tr.seat_reserved_order_status fieldset,
|
||||
div.mp_settings_panel tr.mep_email_sending_order_status fieldset {display: -webkit-flex;display: flex; -webkit-flex-wrap: wrap;flex-wrap: wrap;}
|
||||
div.mp_settings_panel tr.seat_reserved_order_status fieldset label,
|
||||
div.mp_settings_panel tr.mep_email_sending_order_status fieldset label {min-width: 150px;margin: 0 var(--dMP_xs) var(--dMP_xs) 0;}
|
||||
/*******************/
|
||||
.mp_settings_panel_header { background: #161B37;padding: 30px 20px 30px 20px;color: #FFF;font-size: 20px;margin-top: 30px;}
|
||||
.mp_settings_panel_header h3 {color: #FFF;font-size: var(--fs_h3);margin: 0;}
|
||||
.mp_settings_panel_header small {margin-left: 10px;font-size: 13px;}
|
||||
.mp_settings_panel .nav-tab-wrapper {
|
||||
width: 300px;padding: 0;margin: 0;overflow: hidden;
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-flex-direction: column;flex-direction: column;
|
||||
background: #161B37;border: 5px solid #C6C6C6;
|
||||
}
|
||||
.mp_settings_panel .nav-tab {
|
||||
margin: 0;width: 100%; font-weight: 600;text-decoration: none;white-space: nowrap; line-height: 1.4;color: #FFF;
|
||||
background-color: transparent;border: none;border-bottom: 1px dotted #FFF;
|
||||
float: initial;padding: 10px 12px;font-size: 14px;transition: 0.2s;
|
||||
}
|
||||
.mp_settings_panel .nav-tab i,
|
||||
.mp_settings_panel .metabox-holder h2 i{margin: 0 var(--dMP_xs) 0 0;}
|
||||
.mp_settings_panel .nav-tab:hover {background: #49AC2F;transition: 0.2s;}
|
||||
.mp_settings_panel .nav-tab.nav-tab-active { background: #49AC2F;color: #FFF;}
|
||||
.mp_settings_panel .metabox-holder {background: #FFF;padding: 10px;margin: 0;width: calc(100% - 300px);border: 5px solid #C6C6C6;}
|
||||
.mp_settings_panel .metabox-holder h2 {border-bottom: 2px solid #0071A1;font-size: 20px; padding: 15px;margin: 0;background: #161B37; color: #FFF !important;}
|
||||
.mp_settings_panel select {min-width: 150px;}
|
||||
.mp_settings_panel table {width: 100%;overflow: hidden; border: 1px solid #DDD;}
|
||||
.mp_settings_panel table,
|
||||
.mp_settings_panel table td,
|
||||
.mp_settings_panel table th {border-collapse: collapse;}
|
||||
.mp_settings_panel table th {width: 300px;padding: 5px 10px;font-size: 14px;text-align: left;font-weight: 600;vertical-align: middle;color: #000;}
|
||||
.mp_settings_panel table td {padding: 5px 10px;font-size: 14px;}
|
||||
.mp_settings_panel table tr:nth-child(even) {background-color: #F2F2F2;}
|
||||
.mp_settings_panel p.submit {text-align: right; margin: 20px 0 0 0; padding: 0;}
|
||||
div.mpStyle .description,
|
||||
.mp_settings_panel .description {display: block;font-weight: normal;font-size: var(--fs_small) !important;color: #666;margin: var(--dMP_xs) 0 0 0;}
|
||||
div.mpStyle .description span,
|
||||
.mp_settings_panel .description span {margin: 0 var(--dMP_xs) 0 0;}
|
||||
.mp_settings_panel .description strong {color: #000;}
|
||||
.mp_settings_panel p.submit input {font-size: 16px;padding: 5px 30px;border-radius: 0;background: #49AC2F;border-color: #49AC2F;transition: 0.2s;}
|
||||
.mp_settings_panel p.submit input:hover {background: #239108;border-color: #239108;transition: 0.2s;}
|
||||
.mp_settings_panel #setting-error-tgmpa {order: 0;width: 100%}
|
||||
.mp_settings_panel .notice {display: none;}
|
||||
div.mp_settings_panel .formControl {max-width: 320px;}
|
||||
.mp_settings_panel table thead th {background-color: var(--color_light);}
|
||||
.mp_settings_panel .select2-container {max-width: 320px;}
|
||||
.mp_settings_panel .selection {width: 100%;}
|
||||
.mp_settings_panel .metabox-holder table { border-collapse: collapse;}
|
||||
.mp_settings_panel .metabox-holder table td,
|
||||
.mp_settings_panel .metabox-holder table th { padding: 12px;}
|
||||
.mp_settings_panel .metabox-holder table tr:nth-child(even) { background-color: #0CB32612;}
|
||||
.mp_settings_panel .metabox-holder table tr:nth-child(odd) { background-color: #FFF;}
|
||||
}
|
||||
/******************************************************************** Meta tab settings ************************************************/
|
||||
@media only screen and (min-width: 10px) {
|
||||
#mp_meta_box_panel .tabLists {border-right: 1px solid var(--color_border);}
|
||||
/************************************/
|
||||
#mp_meta_box_panel table {table-layout: fixed;border-collapse: collapse;border: 1px solid #F5F5F5;}
|
||||
#mp_meta_box_panel table tr:nth-child(even) {background-color: #0CB32612;}
|
||||
#mp_meta_box_panel table tr:nth-child(odd) {background-color: #FFF;}
|
||||
#mp_meta_box_panel table th,
|
||||
#mp_meta_box_panel table td {border: 0;vertical-align: top;padding: 5px;}
|
||||
#mp_meta_box_panel table th {text-align: center;font-size: var(--fs_h6);font-weight: 600;}
|
||||
#mp_meta_box_panel table tbody th {text-align: left;}
|
||||
#mp_meta_box_panel table tbody thead th {text-align: center;}
|
||||
/************************************/
|
||||
#mp_meta_box_panel .mpStyle .roundSwitch { min-width: 60px;}
|
||||
#mp_meta_box_panel {margin: 15px 0;}
|
||||
#mp_meta_box_panel .inside,
|
||||
#mp_meta_box_panel .form-section {margin: 0;padding: 0;}
|
||||
#mp_meta_box_panel .postbox-header { background-color: #1D2327;}
|
||||
#mp_meta_box_panel .postbox-header h2 {color: #FFF;font-size: 18px;-webkit-justify-content: flex-start;justify-content: flex-start;}
|
||||
#mp_meta_box_panel .postbox-header h2 span {margin: 0 7px 0 0;}
|
||||
#mp_meta_box_panel .wp-editor-wrap {width: 100%;}
|
||||
}
|
||||
/******************************************************************** Image upload ************************************************/
|
||||
@media only screen and (min-width: 10px) {
|
||||
div.mp_multi_image { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap;}
|
||||
div.mp_multi_image_item { position: relative; width: calc(25% - var(--dMP_xs)); min-width: 150px;margin: 0 var(--dMP_xs) var(--dMP_xs) 0;min-height: 50px;}
|
||||
span.mp_remove_single_image,
|
||||
div.mpStyle span.mp_remove_multi_image { cursor: pointer; position: absolute; top: 0; right: 0; background-color: var(--color_danger);margin: 0; opacity: 0;color: var(--color_white) }
|
||||
div.mp_single_image_item:hover span.mp_remove_single_image,
|
||||
div.mp_single_image_item:hover span.mp_remove_single_image:hover,
|
||||
div.mp_multi_image_item:hover span.mp_remove_multi_image {opacity: 0.9;}
|
||||
div.mp_add_single_image {max-width: 150px;width: 100%;}
|
||||
div.mp_single_image_item {position: relative; width: 100%;}
|
||||
}
|
||||
/******************************************************************** add Icon image ************************************************/
|
||||
@media only screen and (min-width: 10px) {
|
||||
div.mp_add_icon_image_area {border: 1px solid var(--color_theme);position: relative;max-width: 120px;}
|
||||
div.mp_add_icon_image_area img {max-height: 100px;}
|
||||
div.mpStyle div.mp_add_icon_image_area button {padding: 5px;font-size: 12px;}
|
||||
div.mp_add_icon_image_area button span {margin: 0 5px 0 0;}
|
||||
div.mpStyle div.mp_add_icon_image_area img {border-radius: 0;}
|
||||
div.mp_add_icon_image_area div.mp_icon_item {padding: var(--dMP_xs);background-color: var(--color_light);font-size: 40px;}
|
||||
div.mp_icon_item:hover .mp_remove_icon,
|
||||
div.mp_image_item:hover .mp_remove_icon {opacity: 1;}
|
||||
div.mp_add_icon_popup .popupHeader {
|
||||
color: #FFF;height: 60px;
|
||||
margin: 0 auto;width: 100%;background-color: #222;position: relative;
|
||||
border-bottom: 1px solid #FFF;
|
||||
}
|
||||
div.mp_add_icon_popup .popupHeader h2 {
|
||||
color: #FFF;text-align: center;
|
||||
font-size: 30px !important;
|
||||
font-weight: 500;
|
||||
}
|
||||
div.mp_add_icon_popup .popupBody {padding: 0;}
|
||||
div.mp_add_icon_popup ul.popupIconMenu {
|
||||
min-width: 270px;background-color: #222;margin: 0;
|
||||
max-height: calc(100vh - var(--dMP) - var(--dMP) - 60px);
|
||||
overflow: hidden auto;
|
||||
}
|
||||
div.mp_add_icon_popup .popupIconMenu li {
|
||||
padding: 7px 15px;margin: 0;
|
||||
border-bottom: 1px solid #DDD;
|
||||
color: #FFF;font-size: 16px;display: block;cursor: pointer;
|
||||
position: relative;
|
||||
font-weight: 500;
|
||||
}
|
||||
div.mp_add_icon_popup .popupIconMenu li strong {color: #9F6C8A;}
|
||||
div.mp_add_icon_popup .popupIconMenu li.active {background-color: #E3A939;}
|
||||
div.mp_add_icon_popup .popupIconMenu li:hover {color: #E3A939;}
|
||||
div.mp_add_icon_popup .popupIconMenu li.active:hover {color: #FFF;}
|
||||
div.mp_add_icon_popup .popup_all_icon {
|
||||
width: 100%;padding: 10px;background-color: #FFF;
|
||||
max-height: calc(100vh - var(--dMP) - var(--dMP) - 60px);
|
||||
overflow: hidden auto;
|
||||
}
|
||||
div.mp_add_icon_popup .popup_all_icon .popupTabItem {width: 100%;}
|
||||
div.mp_add_icon_popup .popup_all_icon .itemIconArea {
|
||||
width: 100%;
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-flex-wrap: wrap;flex-wrap: wrap;
|
||||
}
|
||||
div.mp_add_icon_popup .iconItem {
|
||||
width: 60px;height: 60px;font-size: 30px;margin: 7px;cursor: pointer;
|
||||
border: 2px solid #FFF;background-color: #F2F2F2;
|
||||
-webkit-box-shadow: 0 1px 4px 1px #DBDBDB;
|
||||
box-shadow: 0 1px 4px 1px #DBDBDB;
|
||||
}
|
||||
div.mp_add_icon_popup .iconItem.active,
|
||||
div.mp_add_icon_popup .iconItem:hover {border-color: var(--color_theme);color: var(--color_theme);border-radius: 5px;}
|
||||
/************* font***************/
|
||||
div.mp_add_icon_popup .iconItem,
|
||||
div.mp_add_icon_popup .popupIconMenu li {
|
||||
-webkit-transition: 350ms ease-in-out;
|
||||
-moz-transition: 350ms ease-in-out;
|
||||
-o-transition: 350ms ease-in-out;
|
||||
transition: 350ms ease-in-out;
|
||||
}
|
||||
}
|
||||
/********************************************************************Admin layout ************************************************/
|
||||
@media only screen and (min-width: 10px) {
|
||||
.mpStyle .adminLayout,
|
||||
.mpStyle [class*="_adminLayout"] {padding: 50px;max-width: 1000px;margin: 100px auto;background-color: #FFF;border: 1px solid var(--color_border);border-radius: var(--dBRL);}
|
||||
div.mpStyle .adminLayout th,
|
||||
div.mpStyle .adminLayout td,
|
||||
div.mpStyle [class*="_adminLayout"] th,
|
||||
div.mpStyle [class*="_adminLayout"] td {text-align: left;font-size: var(--fs_h5);}
|
||||
}
|
||||
/******************************************************************** ************************************************/
|
||||
@media only screen and (min-width: 10px) {
|
||||
div.mpStyle .info_text {display: block;font-weight: normal;font-size: var(--fs_small);color: #666;}
|
||||
div.mpStyle .info_text span {margin: 0 5px 0 0;}
|
||||
}
|
|
@ -0,0 +1,212 @@
|
|||
function load_sortable_datepicker(parent, item) {
|
||||
parent.find('.mp_item_insert').first().append(item).promise().done(function () {
|
||||
parent.find('.mp_sortable_area').sortable({
|
||||
handle: jQuery(this).find('.mp_sortable_button')
|
||||
});
|
||||
mp_load_date_picker(parent);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
//=========Short able==============//
|
||||
$(document).find('.mp_sortable_area').sortable({
|
||||
handle: $(this).find('.mp_sortable_button')
|
||||
});
|
||||
});
|
||||
//=========Remove Setting Item ==============//
|
||||
$(document).on('click', '.mp_item_remove', function () {
|
||||
if (confirm('Are You Sure , Remove this row ? \n\n 1. Ok : To Remove . \n 2. Cancel : To Cancel .')) {
|
||||
$(this).closest('.mp_remove_area').slideUp(250, function () {
|
||||
$(this).remove();
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
//=========Add Setting Item==============//
|
||||
$(document).on('click', '.mp_add_item', function () {
|
||||
let parent = $(this).closest('.mp_settings_area');
|
||||
let item = $(this).next($('.mp_hidden_content')).find(' .mp_hidden_item').html();
|
||||
if (!item || item === "undefined" || item === " ") {
|
||||
item = parent.find('.mp_hidden_content').first().find('.mp_hidden_item').html();
|
||||
}
|
||||
load_sortable_datepicker(parent, item);
|
||||
parent.find('.mp_item_insert').find('.add_mp_select2').select2({});
|
||||
return true;
|
||||
});
|
||||
}(jQuery));
|
||||
//=========upload image==============//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on('click', '.mp_add_single_image', function () {
|
||||
let parent = $(this);
|
||||
parent.find('.mp_single_image_item').remove();
|
||||
wp.media.editor.send.attachment = function (props, attachment) {
|
||||
let attachment_id = attachment.id;
|
||||
let attachment_url = attachment.url;
|
||||
let html = '<div class="mp_single_image_item" data-image-id="' + attachment_id + '"><span class="fas fa-times circleIcon_xs mp_remove_single_image"></span>';
|
||||
html += '<img src="' + attachment_url + '" alt="' + attachment_id + '"/>';
|
||||
html += '</div>';
|
||||
parent.append(html);
|
||||
parent.find('input').val(attachment_id);
|
||||
parent.find('button').slideUp('fast');
|
||||
}
|
||||
wp.media.editor.open($(this));
|
||||
return false;
|
||||
});
|
||||
$(document).on('click', '.mp_remove_single_image', function (e) {
|
||||
e.stopPropagation();
|
||||
let parent = $(this).closest('.mp_add_single_image');
|
||||
$(this).closest('.mp_single_image_item').remove();
|
||||
parent.find('input').val('');
|
||||
parent.find('button').slideDown('fast');
|
||||
});
|
||||
$(document).on('click', '.mp_remove_multi_image', function () {
|
||||
let parent = $(this).closest('.mp_multi_image_area');
|
||||
let current_parent = $(this).closest('.mp_multi_image_item');
|
||||
let img_id = current_parent.data('image-id');
|
||||
current_parent.remove();
|
||||
let all_img_ids = parent.find('.mp_multi_image_value').val();
|
||||
all_img_ids = all_img_ids.replace(',' + img_id, '')
|
||||
all_img_ids = all_img_ids.replace(img_id + ',', '')
|
||||
all_img_ids = all_img_ids.replace(img_id, '')
|
||||
parent.find('.mp_multi_image_value').val(all_img_ids);
|
||||
});
|
||||
$(document).on('click', '.add_multi_image', function () {
|
||||
let parent = $(this).closest('.mp_multi_image_area');
|
||||
wp.media.editor.send.attachment = function (props, attachment) {
|
||||
let attachment_id = attachment.id;
|
||||
let attachment_url = attachment.url;
|
||||
let html = '<div class="mp_multi_image_item" data-image-id="' + attachment_id + '"><span class="fas fa-times circleIcon_xs mp_remove_multi_image"></span>';
|
||||
html += '<img src="' + attachment_url + '" alt="' + attachment_id + '"/>';
|
||||
html += '</div>';
|
||||
parent.find('.mp_multi_image').append(html);
|
||||
let value = parent.find('.mp_multi_image_value').val();
|
||||
value = value ? value + ',' + attachment_id : attachment_id;
|
||||
parent.find('.mp_multi_image_value').val(value);
|
||||
}
|
||||
wp.media.editor.open($(this));
|
||||
return false;
|
||||
});
|
||||
}(jQuery));
|
||||
//=================select icon / image=========================//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on('click', 'button.mp_image_add', function () {
|
||||
let $this = $(this);
|
||||
let parent = $this.closest('.mp_add_icon_image_area');
|
||||
wp.media.editor.send.attachment = function (props, attachment) {
|
||||
let attachment_id = attachment.id;
|
||||
let attachment_url = attachment.url;
|
||||
parent.find('input[type="hidden"]').val(attachment_id);
|
||||
parent.find('.mp_icon_item').slideUp('fast');
|
||||
parent.find('img').attr('src', attachment_url);
|
||||
parent.find('.mp_image_item').slideDown('fast');
|
||||
parent.find('.mp_add_icon_image_button_area').slideUp('fast');
|
||||
}
|
||||
wp.media.editor.open($this);
|
||||
return false;
|
||||
});
|
||||
$(document).on('click', '.mp_add_icon_image_area .mp_image_remove', function () {
|
||||
let parent = $(this).closest('.mp_add_icon_image_area');
|
||||
parent.find('input[type="hidden"]').val('');
|
||||
parent.find('img').attr('src', '');
|
||||
parent.find('.mp_image_item').slideUp('fast');
|
||||
parent.find('.mp_add_icon_image_button_area').slideDown('fast');
|
||||
});
|
||||
$(document).on('click', '.mp_add_icon_image_area button.mp_icon_add', function () {
|
||||
let target_popup = $('.mp_add_icon_popup');
|
||||
target_popup.find('.iconItem').click(function () {
|
||||
let parent = $('[data-active-popup]').closest('.mp_add_icon_image_area');
|
||||
let icon_class = $(this).data('icon-class');
|
||||
if (icon_class) {
|
||||
parent.find('input[type="hidden"]').val(icon_class);
|
||||
parent.find('.mp_add_icon_image_button_area').slideUp('fast');
|
||||
parent.find('.mp_image_item').slideUp('fast');
|
||||
parent.find('.mp_icon_item').slideDown('fast');
|
||||
parent.find('[data-add-icon]').removeAttr('class').addClass(icon_class);
|
||||
target_popup.find('.iconItem').removeClass('active');
|
||||
target_popup.find('.popupClose').trigger('click');
|
||||
}
|
||||
});
|
||||
target_popup.find('[data-icon-menu]').click(function () {
|
||||
if (!$(this).hasClass('active')) {
|
||||
//target_popup.find('[name="mp_select_icon_name"]').val('');
|
||||
let target = $(this);
|
||||
let tabsTarget = target.data('icon-menu');
|
||||
target_popup.find('[data-icon-menu]').removeClass('active');
|
||||
target.addClass('active');
|
||||
target_popup.find('[data-icon-list]').each(function () {
|
||||
let targetItem = $(this).data('icon-list');
|
||||
if (tabsTarget === 'all_item' || targetItem === tabsTarget) {
|
||||
$(this).slideDown(250);
|
||||
$(this).find('.iconItem').each(function () {
|
||||
$(this).slideDown('fast');
|
||||
});
|
||||
} else {
|
||||
$(this).slideUp('fast');
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
target_popup.find('.popupClose').click(function () {
|
||||
target_popup.find('[data-icon-menu="all_item"]').trigger('click');
|
||||
target_popup.find('.iconItem').removeClass('active');
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.mp_add_icon_image_area .mp_icon_remove', function () {
|
||||
let parent = $(this).closest('.mp_add_icon_image_area');
|
||||
parent.find('input[type="hidden"]').val('');
|
||||
parent.find('[data-add-icon]').removeAttr('class');
|
||||
parent.find('.mp_icon_item').slideUp('fast');
|
||||
parent.find('.mp_add_icon_image_button_area').slideDown('fast');
|
||||
});
|
||||
$(document).on('keyup change', '.mp_add_icon_popup [name="mp_select_icon_name"]', function () {
|
||||
let parent = $(this).closest('.mp_add_icon_popup');
|
||||
let input = $(this).val().toString().toLowerCase();
|
||||
parent.find('[data-icon-menu="all_item"]').trigger('click');
|
||||
if (input) {
|
||||
parent.find('.popupTabItem').each(function () {
|
||||
let tabItem = $(this);
|
||||
let count = 0;
|
||||
let icon_type = $(this).data('icon-title').toString().toLowerCase();
|
||||
let active = (icon_type && icon_type.match(new RegExp(input, "i"))) ? 1 : 0;
|
||||
if (active > 0) {
|
||||
tabItem.slideDown(250);
|
||||
tabItem.find('.iconItem').each(function () {
|
||||
$(this).slideDown('fast');
|
||||
});
|
||||
} else {
|
||||
tabItem.find('.iconItem').each(function () {
|
||||
let icon_class = $(this).data('icon-class').toString().toLowerCase();
|
||||
let icon_name = $(this).data('icon-name').toString().toLowerCase();
|
||||
active = (icon_class && icon_class.match(new RegExp(input, "i"))) ? 1 : active;
|
||||
active = (icon_name && icon_name.match(new RegExp(input, "i"))) ? 1 : active;
|
||||
if (active > 0) {
|
||||
$(this).slideDown('fast');
|
||||
count++;
|
||||
} else {
|
||||
$(this).slideUp('fast');
|
||||
}
|
||||
}).promise().done(function () {
|
||||
if (count > 0) {
|
||||
tabItem.slideDown('fast');
|
||||
} else {
|
||||
tabItem.slideUp('fast');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
parent.find('.popupTabItem').each(function () {
|
||||
$(this).slideDown(250);
|
||||
$(this).find('.iconItem').each(function () {
|
||||
$(this).slideDown(250);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}(jQuery));
|
|
@ -0,0 +1,3 @@
|
|||
(function ($) {
|
||||
"use strict";
|
||||
}(jQuery));
|
|
@ -0,0 +1,177 @@
|
|||
div.list_with_filter_section {margin: 0 0 20px 0;}
|
||||
div.list_with_filter_section div.all_filter_item {display: none;}
|
||||
div.item_bg_image {
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
height: 100%;
|
||||
-webkit-transition: all 0.5s ease-in-out;
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
div.item_bg_image:hover {
|
||||
transform: scale(1.1);
|
||||
-webkit-transition: all 0.5s ease-in-out;
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
/****************************************/
|
||||
div.search_result_empty {
|
||||
display: none;font-weight: 500;
|
||||
font-size: 22px;
|
||||
color: #6B003E;
|
||||
}
|
||||
div.search_sort_code {position: relative; width: 100%;}
|
||||
div.search_sort_code .filter_input_area .formControl {border: none;border-radius: 0;height: 100%;}
|
||||
div.search_sort_code span.fa {margin: 0 7px 0 0;font-size: 12px;}
|
||||
div.filter_input_area {position: relative;width: 100%;height: 50%;margin: 0 auto;border: 4px solid #DDD;}
|
||||
div.filter_input_area:first-child {border-bottom-width: 2px;}
|
||||
div.filter_input_area:last-child {border-top-width: 2px;}
|
||||
div.filter_input_area > * {border-right: 4px solid #DDD;}
|
||||
div.filter_input_area > *:last-child {border-right: none;}
|
||||
/****************************************/
|
||||
div.spinner_loading {position: absolute;z-index: 1111;left: 0;right: 0;top: 0;bottom: 0;background-color: #FFFD;}
|
||||
div.spinner_loading > div {height: 100%;}
|
||||
div.icon_loader {
|
||||
display: flex !important;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-justify-content: center;
|
||||
justify-content: center;
|
||||
font-size: 40px;
|
||||
z-index: 11111;
|
||||
position: relative;
|
||||
}
|
||||
div.icon_loader_xs {
|
||||
display: flex !important;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-justify-content: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
z-index: 11111;
|
||||
position: relative
|
||||
}
|
||||
.pagination_area .ellipse_left,
|
||||
.pagination_area .ellipse_right {
|
||||
min-width: 50px;background-color: #FFF;
|
||||
}
|
||||
.pagination_area .ellipse_left > div,
|
||||
.pagination_area .ellipse_right > div {
|
||||
width: 100%;height: 100%;
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-justify-content: center;justify-content: center;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
}
|
||||
.pagination_area [class*="Button"] {
|
||||
padding: 0 15px;
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
min-width: 150px;
|
||||
height: auto;
|
||||
min-height: 40px;
|
||||
-webkit-appearance: button;
|
||||
overflow: visible;
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-justify-content: center;justify-content: center;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
border-radius: 5px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.pagination_area [class*="Button"]:hover {opacity: 0.8;}
|
||||
.pagination_area button.pagination_load_more {border: none;}
|
||||
.pagination_area button[class*="defaultButton_xs"] {
|
||||
min-width: 50px;
|
||||
padding: 0;
|
||||
}
|
||||
.pagination_area button[class*="defaultButton_xs"]:first-child {border: none;}
|
||||
.pagination_area button[class*="defaultButton_xs"]:last-child {border-radius: 0 5px 5px 0 !important;}
|
||||
.pagination_area button[class*="defaultButton_xs"].active_pagination {
|
||||
color: #000;
|
||||
background-color: #DDD;
|
||||
}
|
||||
.pagination_area .ellipse_left {display: none;}
|
||||
.pagination_area button[disabled] {cursor: not-allowed;opacity: 0.8;background-color: #DDD;}
|
||||
/****************************************/
|
||||
.list_with_filter_section div.buttonGroup [class*="Button"] {
|
||||
border: none;
|
||||
border-left: 2px solid #DDD;
|
||||
border-radius: 0;
|
||||
}
|
||||
.list_with_filter_section div.buttonGroup {
|
||||
position: relative;
|
||||
border: 0;
|
||||
border-radius: 5px;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
}
|
||||
div.buttonGroup [class*="Button"]:first-child {
|
||||
-webkit-border-radius: 5px 0 0 5px;
|
||||
border-radius: 5px 0 0 5px;
|
||||
border-left: none;
|
||||
}
|
||||
.list_with_filter_section .flexEqual {display: -webkit-flex;display: flex;}
|
||||
div.buttonGroup > *,
|
||||
.list_with_filter_section .flexEqual > * {
|
||||
-webkit-flex: 1;-ms-flex: 1;flex: 1;
|
||||
}
|
||||
.list_with_filter_section .circleIcon_xs {
|
||||
width: 25px;height: 25px;min-width: 25px;
|
||||
background-color: #FF5959;
|
||||
color: #FFF;
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-justify-content: center;justify-content: center;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
}
|
||||
.list_with_filter_section .sort_code_search_box {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
border: 1px solid #DDD;
|
||||
-webkit-flex-wrap: wrap;flex-wrap: wrap;
|
||||
padding: 5px;
|
||||
}
|
||||
.list_with_filter_section .sort_code_search_box label {display: block; margin: 0;}
|
||||
.list_with_filter_section [class*="defaultButton"] { color: #FFF;}
|
||||
.list_with_filter_section [class*="defaultButton_xs"] {min-width: auto;padding: 7px;font-size: 16px;}
|
||||
.list_with_filter_section .search_sort_code_area {margin: 15px 0;}
|
||||
.list_with_filter_section .formControl {
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
-webkit-flex-wrap: nowrap;flex-wrap: nowrap;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
min-width: auto;max-width: inherit;
|
||||
padding: 7px;
|
||||
margin: 0;
|
||||
color: #555;
|
||||
line-height: 1.25;
|
||||
background: rgba(255, 255, 255, .99);
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, .1) inset;
|
||||
border: 1px solid #CCC !important;
|
||||
height: 40px !important;
|
||||
}
|
||||
.list_with_filter_section .formControl:-webkit-autofill,
|
||||
.list_with_filter_section .formControl:-webkit-autofill:hover,
|
||||
.list_with_filter_section .formControl:-webkit-autofill:focus,
|
||||
.list_with_filter_section .formControl:-webkit-autofill:active {
|
||||
-webkit-transition: color 9999s ease-out, background-color 9999s ease-out;
|
||||
transition: color 9999s ease-out, background-color 9999s ease-out;
|
||||
-webkit-transition-delay: 9999s;
|
||||
transition-delay: 9999s;
|
||||
}
|
||||
.list_with_filter_section .alignCenter {
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
-webkit-flex-wrap: nowrap;flex-wrap: nowrap;
|
||||
}
|
||||
.list_with_filter_section .allCenter {
|
||||
display: -webkit-flex !important;
|
||||
display: flex !important;
|
||||
-webkit-justify-content: flex-start;
|
||||
justify-content: flex-start;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-flex-direction: column;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
}
|
||||
.list_with_filter_section label {position: relative;}
|
||||
.list_with_filter_section span.filter_date_icon {position: absolute;top: 0;right: 0; padding: 7px 5px; bottom: 0; margin: 5px; color: #DDD;cursor: pointer;}
|
|
@ -0,0 +1,304 @@
|
|||
function mpwem_add_loader(target) {
|
||||
target.css('position', 'relative');
|
||||
target.append('<div class="spinner_loading"><div class="icon_loader"><span class="fas fa-spinner fa-pulse"></span></div></div>');
|
||||
}
|
||||
function mpwem_add_loader_xs(target) {
|
||||
target.css('position', 'relative');
|
||||
target.append('<div class="spinner_loading"><div class="icon_loader_xs"><span class="fas fa-spinner fa-pulse"></span></div></div>');
|
||||
}
|
||||
function mpwem_remove_loader(target) {
|
||||
target.find('.spinner_loading').remove();
|
||||
}
|
||||
function mpwem_page_scroll_to(target) {
|
||||
jQuery('html, body').animate({
|
||||
scrollTop: target.offset().top -= 100
|
||||
}, 1000);
|
||||
}
|
||||
(function ($) {
|
||||
"use strict";
|
||||
let bg_image_load = false;
|
||||
load_pagination_initial_item();
|
||||
$(".filter_datepicker").datepicker({dateFormat: "mm/dd/yy"});
|
||||
$(document).ready(function () {
|
||||
$(window).on('load', function () {
|
||||
load_bg_img();
|
||||
bg_image_load = true;
|
||||
});
|
||||
if (!bg_image_load) {
|
||||
load_bg_img();
|
||||
$(document).scroll(function () {
|
||||
load_bg_img();
|
||||
bg_image_load = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
let filter_input_list = {
|
||||
title_filter: 'data-title',
|
||||
filter_with_city: 'data-city-name',
|
||||
filter_with_category: 'data-category',
|
||||
filter_with_organizer: 'data-organizer'
|
||||
};
|
||||
for (let name in filter_input_list) {
|
||||
$(document).on('change keyup', '[name="' + name + '"] ', function (e) {
|
||||
e.preventDefault();
|
||||
load_filter($(this));
|
||||
});
|
||||
}
|
||||
$(document).on('change', '.search_with_start_date , .search_with_end_date', function () {
|
||||
load_filter($(this));
|
||||
});
|
||||
function load_filter(target) {
|
||||
let parent = target.closest('.list_with_filter_section');
|
||||
let result = 0;
|
||||
if (check_search_value_exit(parent)) {
|
||||
let date_check = date_filter_check(parent);
|
||||
parent.find('.all_filter_item .filter_item').each(function () {
|
||||
let active = 1;
|
||||
for (let name in filter_input_list) {
|
||||
if (single_text_check(parent, name) && active > 0) {
|
||||
active = single_text_search(parent, $(this), name);
|
||||
}
|
||||
}
|
||||
if (date_check && active > 0) {
|
||||
active = date_search(parent, $(this));
|
||||
}
|
||||
if (active > 1) {
|
||||
result++;
|
||||
$(this).addClass('search_on').removeClass('search_of');
|
||||
} else {
|
||||
$(this).addClass('search_of').removeClass('search_on');
|
||||
}
|
||||
}).promise().done(function () {
|
||||
if (result > 0) {
|
||||
parent.find('.all_filter_item').slideDown('fast');
|
||||
parent.find('.search_result_empty').slideUp('fast');
|
||||
} else {
|
||||
parent.find('.all_filter_item').slideUp('fast');
|
||||
parent.find('.search_result_empty').slideDown('fast');
|
||||
}
|
||||
}).promise().done(function () {
|
||||
load_pagination(parent, 0);
|
||||
});
|
||||
} else {
|
||||
parent.find('.all_filter_item').slideDown('fast');
|
||||
parent.find('.all_filter_item .filter_item').each(function () {
|
||||
$(this).removeClass('search_of').removeClass('search_on');
|
||||
}).promise().done(function () {
|
||||
load_pagination(parent, 0);
|
||||
});
|
||||
parent.find('.search_result_empty').slideUp('fast');
|
||||
}
|
||||
}
|
||||
function date_convert_to_str(date) {
|
||||
date = new Date(date).getTime();
|
||||
if (date && date !== 'NaN') {
|
||||
return date;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
function single_text_check(parent, inputName) {
|
||||
let inputText = parent.find('[name="' + inputName + '"]').val();
|
||||
return (inputText && inputText.length > 0) ? 1 : false;
|
||||
}
|
||||
function single_text_search(parent, item, inputName) {
|
||||
let target = parent.find('[name="' + inputName + '"]');
|
||||
let inputText = target.val();
|
||||
let currentValue = item.attr(filter_input_list[inputName]);
|
||||
return (currentValue && currentValue.match(new RegExp(inputText, "i"))) ? 2 : 0;
|
||||
}
|
||||
function date_filter_check(parent) {
|
||||
let start_date = date_convert_to_str(parent.find('.search_with_start_date').val());
|
||||
let end_date = date_convert_to_str(parent.find('.search_with_end_date').val());
|
||||
return (start_date > 0 && end_date > 0) ? 1 : false;
|
||||
}
|
||||
function date_search(parent, target) {
|
||||
let start_date = date_convert_to_str(parent.find('.search_with_start_date').val());
|
||||
let end_date = date_convert_to_str(parent.find('.search_with_end_date').val());
|
||||
let date = date_convert_to_str(target.attr('data-date'));
|
||||
return (date >= start_date && end_date >= date) ? 2 : 0;
|
||||
}
|
||||
function check_search_value_exit(parent) {
|
||||
let date_result = date_filter_check(parent);
|
||||
let active = 0;
|
||||
for (let name in filter_input_list) {
|
||||
if (single_text_check(parent, name)) {
|
||||
active = 1;
|
||||
}
|
||||
}
|
||||
return (date_result || active > 0) ? 1 : false;
|
||||
}
|
||||
function load_bg_img() {
|
||||
$('.filter_item:visible').each(function () {
|
||||
let target = $(this);
|
||||
if (target.find('[data-bg-image]').css('background-image') === 'none') {
|
||||
target.find('[data-bg-image]').css('background-image', 'url("' + target.find('[data-bg-image]').data('bg-image') + '")').promise().done(function () {
|
||||
mpwem_remove_loader(target);
|
||||
});
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
//************Pagination*************//
|
||||
$(document).on('click', '.pagination_area [data-pagination]', function (e) {
|
||||
e.preventDefault();
|
||||
let pagination_page = $(this).data('pagination');
|
||||
let parent = $(this).closest('.list_with_filter_section');
|
||||
parent.find('[data-pagination]').removeClass('active_pagination');
|
||||
$(this).addClass('active_pagination').promise().done(function () {
|
||||
load_pagination(parent, pagination_page);
|
||||
}).promise().done(function () {
|
||||
mpwem_page_scroll_to(parent);
|
||||
load_bg_img();
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.pagination_area .page_prev', function (e) {
|
||||
e.preventDefault();
|
||||
let parent = $(this).closest('.pagination_area');
|
||||
let page_no = parseInt(parent.find('.active_pagination').data('pagination')) - 1;
|
||||
parent.find('[data-pagination="' + page_no + '"]').trigger('click');
|
||||
});
|
||||
$(document).on('click', '.pagination_area .page_next', function (e) {
|
||||
e.preventDefault();
|
||||
let parent = $(this).closest('.pagination_area');
|
||||
let page_no = parseInt(parent.find('.active_pagination').data('pagination')) + 1;
|
||||
parent.find('[data-pagination="' + page_no + '"]').trigger('click');
|
||||
});
|
||||
$(document).on('click', '.pagination_area .pagination_load_more', function () {
|
||||
let pagination_page = parseInt($(this).attr('data-load-more'));
|
||||
let parent = $(this).closest('.list_with_filter_section');
|
||||
let item_class = get_item_class(parent);
|
||||
if (parent.find(item_class + ':hidden').length > 0) {
|
||||
pagination_page = pagination_page + 1;
|
||||
} else {
|
||||
pagination_page = 0;
|
||||
}
|
||||
$(this).attr('data-load-more', pagination_page).promise().done(function () {
|
||||
load_pagination(parent, pagination_page);
|
||||
}).promise().done(function () {
|
||||
if (parent.find(item_class + ':hidden').length === 0) {
|
||||
$(this).attr('disabled', 'disabled');
|
||||
}
|
||||
}).promise().done(function () {
|
||||
load_bg_img();
|
||||
});
|
||||
});
|
||||
function load_more_scroll(parent, pagination_page) {
|
||||
let per_page_item = parseInt(parent.find('input[name="pagination_per_page"]').val());
|
||||
let start_item = pagination_page > 0 ? pagination_page * per_page_item : 0;
|
||||
let item_class = get_item_class(parent);
|
||||
let target = parent.find(item_class + ':nth-child(' + (start_item + 1) + ')');
|
||||
mpwem_page_scroll_to(target);
|
||||
}
|
||||
function load_pagination_initial_item() {
|
||||
$('.list_with_filter_section').each(function () {
|
||||
mpwem_add_loader($(this));
|
||||
$(this).find('[data-bg-image]').each(function () {
|
||||
mpwem_add_loader($(this));
|
||||
});
|
||||
load_pagination($(this), 0);
|
||||
}).promise().done(function () {
|
||||
$('.list_with_filter_section').each(function () {
|
||||
mpwem_remove_loader($(this));
|
||||
$(this).find('.all_filter_item').css({'height': 'auto', 'overflow': 'inherit'}).slideDown('slow');
|
||||
});
|
||||
});
|
||||
}
|
||||
function load_pagination(parent, pagination_page) {
|
||||
let all_item = parent.find('.all_filter_item');
|
||||
let per_page_item = parseInt(parent.find('input[name="pagination_per_page"]').val());
|
||||
let pagination_type = parent.find('input[name="pagination_style"]').val();
|
||||
let start_item = pagination_page > 0 ? pagination_page * per_page_item : 0;
|
||||
let end_item = pagination_page > 0 ? start_item + per_page_item : per_page_item;
|
||||
let item = 0;
|
||||
let items_class = get_item_class(parent);
|
||||
if (pagination_type === 'load_more') {
|
||||
start_item = 0;
|
||||
} else {
|
||||
let all_item_height = all_item.outerHeight();
|
||||
//all_item.css({"height": all_item_height, "overflow": "hidden"});
|
||||
mpwem_add_loader(all_item);
|
||||
}
|
||||
parent.find(items_class).each(function () {
|
||||
if (item >= start_item && item < end_item) {
|
||||
if ($(this).is(':hidden')) {
|
||||
$(this).slideDown(200);
|
||||
}
|
||||
} else {
|
||||
$(this).slideUp('fast');
|
||||
}
|
||||
item++;
|
||||
}).promise().done(function () {
|
||||
all_item.css({'height': 'auto', 'overflow': 'inherit'}).promise().done(function () {
|
||||
filter_qty_palace(parent, items_class);
|
||||
pagination_management(parent, pagination_page);
|
||||
mpwem_remove_loader(all_item);
|
||||
});
|
||||
});
|
||||
}
|
||||
function pagination_management(parent, pagination_page) {
|
||||
let pagination_type = parent.find('input[name="pagination_style"]').val();
|
||||
let per_page_item = parseInt(parent.find('input[name="pagination_per_page"]').val());
|
||||
let total_item = parent.find(get_item_class(parent)).length;
|
||||
if (total_item <= per_page_item) {
|
||||
parent.find('.pagination_area').slideUp(200);
|
||||
} else {
|
||||
parent.find('.pagination_area').slideDown(200);
|
||||
if (pagination_type === 'load_more') {
|
||||
parent.find('[data-load-more]').attr('data-load-more', pagination_page)
|
||||
} else {
|
||||
pagination_page_management(parent, pagination_page);
|
||||
}
|
||||
}
|
||||
}
|
||||
function pagination_page_management(parent, pagination_page) {
|
||||
let per_page_item = parseInt(parent.find('input[name="pagination_per_page"]').val());
|
||||
let total_item = parent.find(get_item_class(parent)).length;
|
||||
let total_active_page = (total_item / per_page_item) + ((total_item % per_page_item) > 0 ? 1 : 0);
|
||||
let page_limit_start = (pagination_page > 2) ? (pagination_page - 2) : 0;
|
||||
let page_limit_end = (pagination_page > 2) ? (pagination_page + 2) : 4;
|
||||
let limit_dif = total_active_page - pagination_page;
|
||||
if (total_active_page > 5 && limit_dif < 3) {
|
||||
page_limit_start = page_limit_start - ((limit_dif > 1) ? 1 : 2);
|
||||
}
|
||||
let total_page = parent.find('[data-pagination]').length;
|
||||
for (let i = 0; i < total_page; i++) {
|
||||
if (i < total_active_page && i >= page_limit_start && i <= page_limit_end) {
|
||||
parent.find('[data-pagination="' + i + '"]').slideDown(200);
|
||||
} else {
|
||||
parent.find('[data-pagination="' + i + '"]').slideUp(200);
|
||||
}
|
||||
}
|
||||
if (pagination_page > 0) {
|
||||
parent.find('.page_prev').removeAttr('disabled');
|
||||
} else {
|
||||
parent.find('.page_prev').prop('disabled', true);
|
||||
}
|
||||
if (pagination_page > 2 && total_active_page > 5) {
|
||||
parent.find('.ellipse_left').slideDown(200);
|
||||
} else {
|
||||
parent.find('.ellipse_left').slideUp(200);
|
||||
}
|
||||
if (pagination_page < total_active_page - 3 && total_active_page > 5) {
|
||||
parent.find('.ellipse_right').slideDown(200);
|
||||
} else {
|
||||
parent.find('.ellipse_right').slideUp(200);
|
||||
}
|
||||
if (pagination_page < total_active_page - 1) {
|
||||
parent.find('.page_next').removeAttr('disabled');
|
||||
} else {
|
||||
parent.find('.page_next').prop('disabled', true);
|
||||
}
|
||||
}
|
||||
function get_item_class(parent, items = '.filter_item') {
|
||||
if (parent.find('.filter_item.search_on').length > 0 || parent.find('.filter_item.search_of').length > 0) {
|
||||
items = '.filter_item.search_on';
|
||||
parent.find('.filter_item.search_of').slideUp('fast');
|
||||
}
|
||||
return items;
|
||||
}
|
||||
function filter_qty_palace(parent, item_class) {
|
||||
parent.find('.qty_count').html($(parent).find(item_class + ':visible').length);
|
||||
parent.find('.total_filter_qty').html($(parent).find(item_class).length);
|
||||
}
|
||||
}(jQuery));
|
|
@ -0,0 +1,9 @@
|
|||
/******************************************************************** ************************************************/
|
||||
@media only screen and (min-width: 10px) {
|
||||
}
|
||||
/******************************************************************** Responsive ************************************************/
|
||||
@media only screen and (max-width: 800px) {
|
||||
|
||||
}
|
||||
@media only screen and (max-width: 600px) {
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
(function ($) {
|
||||
"use strict";
|
||||
//*****************************Faq***********************************//
|
||||
$(document).on('click', '.mep-event-faq-set > a', function () {
|
||||
let current = $(this);
|
||||
if (current.hasClass("active")) {
|
||||
current.removeClass("active");
|
||||
current.siblings(".mep-event-faq-content").slideUp(200);
|
||||
$(".mep-event-faq-set > a i").removeClass("fa-minus").addClass("fa-plus");
|
||||
} else {
|
||||
$(".mep-event-faq-set > a i").removeClass("fa-minus").addClass("fa-plus");
|
||||
current.find("i").removeClass("fa-plus").addClass("fa-minus");
|
||||
$(".mep-event-faq-set > a").removeClass("active");
|
||||
current.addClass("active");
|
||||
$(".mep-event-faq-content").slideUp(200);
|
||||
current.siblings(".mep-event-faq-content").slideDown(200);
|
||||
}
|
||||
});
|
||||
//****************************************************************//
|
||||
//****************************************************************//
|
||||
//****************************************************************//
|
||||
//****************************************************************//
|
||||
}(jQuery));
|
||||
function mp_event_wo_commerce_price_format(price) {
|
||||
let currency_position = jQuery('input[name="currency_position"]').val();
|
||||
let currency_symbol = jQuery('input[name="currency_symbol"]').val();
|
||||
let currency_decimal = jQuery('input[name="currency_decimal"]').val();
|
||||
let currency_thousands_separator = jQuery('input[name="currency_thousands_separator"]').val();
|
||||
let currency_number_of_decimal = jQuery('input[name="currency_number_of_decimal"]').val();
|
||||
let price_text = '';
|
||||
|
||||
price = price.toFixed(currency_number_of_decimal);
|
||||
// console.log('price= '+ price);
|
||||
let total_part = price.toString().split(".");
|
||||
total_part[0] = total_part[0].replace(/\B(?=(\d{3})+(?!\d))/g, currency_thousands_separator);
|
||||
price = total_part.join(currency_decimal);
|
||||
|
||||
if (currency_position === 'right') {
|
||||
price_text = price + currency_symbol;
|
||||
} else if (currency_position === 'right_space') {
|
||||
price_text = price + ' ' + currency_symbol;
|
||||
} else if (currency_position === 'left') {
|
||||
price_text = currency_symbol + price;
|
||||
} else {
|
||||
price_text = currency_symbol + ' ' + price;
|
||||
}
|
||||
// console.log('price= '+ price_text);
|
||||
return price_text;
|
||||
}
|
||||
(function ($) {
|
||||
//added by sumon
|
||||
$(document).on('click', '.mep-event-list-loop .mp_event_visible_event_time', function (e) {
|
||||
e.preventDefault();
|
||||
let target = $(this);
|
||||
$('.mep-event-list-loop .mp_event_visible_event_time').each(function () {
|
||||
let current=$(this).siblings('ul.mp_event_more_date_list');
|
||||
if(current.is(':visible')){
|
||||
let active_text=$(this).data('active-text');
|
||||
$(this).html(active_text);
|
||||
current.slideUp(200);
|
||||
}
|
||||
|
||||
}).promise().done(function () {
|
||||
let current_list=target.siblings('ul.mp_event_more_date_list');
|
||||
if(current_list.length>0){
|
||||
if(current_list.is(':visible')){
|
||||
current_list.slideUp(200);
|
||||
target.html(target.data('active-text'));
|
||||
}else{
|
||||
current_list.slideDown(200);
|
||||
target.html(target.data('hide-text'));
|
||||
}
|
||||
}else{
|
||||
let event_id = target.data('event-id');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: mp_ajax_url,
|
||||
data: {"action": "mep_event_list_date_schedule", "event_id":event_id},
|
||||
beforeSend: function(){
|
||||
target.html('<span class="fas fa-spinner fa-pulse"></span>');
|
||||
},
|
||||
success: function(data){
|
||||
$(data).insertAfter(target);
|
||||
target.html(target.data('hide-text'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
$(document).on('click', 'button.mep_view_vr_btn', function () {
|
||||
$(this).closest('tr').next('tr.mep_virtual_event_info_sec').slideToggle('fast');
|
||||
});
|
||||
}(jQuery));
|
Before Width: | Height: | Size: 470 KiB After Width: | Height: | Size: 470 KiB |
|
@ -5,11 +5,11 @@
|
|||
|
||||
@font-face {
|
||||
font-family: "Flaticon";
|
||||
src: url("./Flaticon.eot");
|
||||
src: url("./Flaticon.eot?#iefix") format("embedded-opentype"),
|
||||
url("./Flaticon.woff") format("woff"),
|
||||
url("./Flaticon.ttf") format("truetype"),
|
||||
url("./Flaticon.svg#Flaticon") format("svg");
|
||||
src: url("Flaticon.eot");
|
||||
src: url("Flaticon.eot?#iefix") format("embedded-opentype"),
|
||||
url("Flaticon.woff") format("woff"),
|
||||
url("Flaticon.ttf") format("truetype"),
|
||||
url("Flaticon.svg#Flaticon") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
|||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
@font-face {
|
||||
font-family: "Flaticon";
|
||||
src: url("./Flaticon.svg#Flaticon") format("svg");
|
||||
src: url("Flaticon.svg#Flaticon") format("svg");
|
||||
}
|
||||
}
|
||||
|
0
js/form-field-dependency.js → assets/helper/form-field-dependency.js
Executable file → Normal file
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 189 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 592 B |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
@ -0,0 +1,782 @@
|
|||
//======================================================Price Format==============//
|
||||
function mp_price_format(price) {
|
||||
price = price.toFixed(mp_num_of_decimal);
|
||||
let total_part = price.toString().split(".");
|
||||
total_part[0] = total_part[0].replace(/\B(?=(\d{3})+(?!\d))/g, mp_currency_thousands_separator);
|
||||
price = total_part.join(mp_currency_decimal);
|
||||
let price_text = '';
|
||||
if (mp_currency_position === 'right') {
|
||||
price_text = price + mp_currency_symbol;
|
||||
} else if (mp_currency_position === 'right_space') {
|
||||
price_text = price + ' ' + mp_currency_symbol;
|
||||
} else if (mp_currency_position === 'left') {
|
||||
price_text = mp_currency_symbol + price;
|
||||
} else {
|
||||
price_text = mp_currency_symbol + ' ' + price;
|
||||
}
|
||||
return price_text;
|
||||
}
|
||||
//=======================================================Loader==============//
|
||||
function dLoader(target) {
|
||||
if (target.find('div[class*="dLoader"]').length < 1) {
|
||||
target.addClass('pRelative').append('<div class="dLoader"><span class="fas fa-spinner fa-pulse"></span></div>');
|
||||
}
|
||||
}
|
||||
function dLoader_xs(target) {
|
||||
if (target.find('div[class*="dLoader"]').length < 1) {
|
||||
target.addClass('pRelative').append('<div class="dLoader_xs"><span class="fas fa-spinner fa-pulse"></span></div>');
|
||||
}
|
||||
}
|
||||
function simpleSpinner(target) {
|
||||
if (target.find('div[class*="simpleSpinner"]').length < 1) {
|
||||
target.addClass('pRelative').append('<div class="simpleSpinner"><span class="fas fa-spinner fa-pulse"></span></div>');
|
||||
}
|
||||
}
|
||||
function simpleSpinnerRemove(target = jQuery('body')) {
|
||||
target.removeClass('noScroll');
|
||||
target.removeClass('pRelative').find('div[class*="simpleSpinner"]').remove();
|
||||
}
|
||||
function dLoaderBody() {
|
||||
let body = jQuery('body');
|
||||
if (body.find('div[class*="dLoader"]').length < 1) {
|
||||
body.addClass('noScroll').append('<div class="dLoader pFixed"><span class="fas fa-spinner fa-pulse"></span></div>');
|
||||
}
|
||||
}
|
||||
function dLoaderBody_xs() {
|
||||
let body = jQuery('body');
|
||||
if (body.find('div[class*="dLoader"]').length < 1) {
|
||||
body.addClass('noScroll').append('<div class="dLoader_xs pFixed"><span class="fas fa-spinner fa-pulse"></span></div>');
|
||||
}
|
||||
}
|
||||
function dLoader_circle(target) {
|
||||
if (target.find('div[class*="dLoader"]').length < 1) {
|
||||
target.addClass('pRelative').append('<div class="dLoader border_spin_loader"><span class="circle"></span></div>');
|
||||
}
|
||||
}
|
||||
function dLoader_xs_circle(target) {
|
||||
if (target.find('div[class*="dLoader"]').length < 1) {
|
||||
target.addClass('pRelative').append('<div class="dLoader_xs border_spin_loader"><span class="circle"></span></div>');
|
||||
}
|
||||
}
|
||||
function dLoaderRemove(target = jQuery('body')) {
|
||||
target.removeClass('noScroll');
|
||||
target.removeClass('pRelative').find('div[class*="dLoader"]').remove();
|
||||
}
|
||||
function placeholderLoader(target) {
|
||||
target.addClass('placeholderLoader');
|
||||
}
|
||||
function placeholderLoaderRemove(target) {
|
||||
target.each(function () {
|
||||
target.removeClass('placeholderLoader');
|
||||
})
|
||||
}
|
||||
//======================================================Page Scroll==============//
|
||||
function pageScrollTo(target) {
|
||||
jQuery('html, body').animate({
|
||||
scrollTop: target.offset().top -= 150
|
||||
}, 1000);
|
||||
}
|
||||
//====================================================Load Date picker==============//
|
||||
function mp_load_date_picker(parent = jQuery('.mpStyle')) {
|
||||
parent.find(".date_type.hasDatepicker").each(function () {
|
||||
jQuery(this).removeClass('hasDatepicker').attr('id', '').removeData('datepicker').unbind();
|
||||
}).promise().done(function () {
|
||||
parent.find(".date_type").datepicker({
|
||||
dateFormat: mp_date_format,
|
||||
autoSize: true,
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
onSelect: function (dateString, data) {
|
||||
let date = data.selectedYear + '-' + ('0' + (parseInt(data.selectedMonth) + 1)).slice(-2) + '-' + data.selectedDay;
|
||||
jQuery(this).closest('label').find('input[type="hidden"]').val(date).trigger('change');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
//========================================================Alert==============//
|
||||
function mp_alert($this, attr = 'alert') {
|
||||
alert($this.data(attr));
|
||||
}
|
||||
//=====================================================Load initial=================//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
mp_load_date_picker();
|
||||
$('.mp_select2').select2({});
|
||||
});
|
||||
}(jQuery));
|
||||
//====================================================================Load Bg Image=================//
|
||||
function loadBgImage() {
|
||||
jQuery('body').find('[data-bg-image]:visible').each(function () {
|
||||
let target = jQuery(this);
|
||||
let width = target.outerWidth();
|
||||
let height = target.outerHeight();
|
||||
if (target.css('background-image') === 'none' || width === 0 || height === 0) {
|
||||
let bg_url = target.data('bg-image');
|
||||
if (!bg_url || bg_url.width === 0 || bg_url.width === 'undefined') {
|
||||
bg_url = mp_empty_image_url;
|
||||
}
|
||||
mp_resize_bg_image_area(target, bg_url);
|
||||
target.css('background-image', 'url("' + bg_url + '")').promise().done(function () {
|
||||
dLoaderRemove(jQuery(this));
|
||||
});
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
function mp_resize_bg_image_area(target, bg_url) {
|
||||
let tmpImg = new Image();
|
||||
tmpImg.src = bg_url;
|
||||
jQuery(tmpImg).one('load', function () {
|
||||
let imgWidth = tmpImg.width;
|
||||
let imgHeight = tmpImg.height;
|
||||
let height = target.outerWidth() * imgHeight / imgWidth;
|
||||
target.css({"min-height": height});
|
||||
});
|
||||
}
|
||||
(function ($) {
|
||||
let bg_image_load = false;
|
||||
$(document).ready(function () {
|
||||
$('body').find('[data-bg-image]').each(function () {
|
||||
dLoader($(this));
|
||||
});
|
||||
$(window).on('load', function () {
|
||||
load_initial();
|
||||
});
|
||||
if (!bg_image_load) {
|
||||
load_initial();
|
||||
$(document).scroll(function () {
|
||||
load_initial();
|
||||
});
|
||||
}
|
||||
});
|
||||
$(document).on('click', '[data-href]', function () {
|
||||
let href = $(this).data('href');
|
||||
if (href) {
|
||||
window.location.href = href;
|
||||
}
|
||||
});
|
||||
$(window).on('load , resize', function () {
|
||||
$('body').find('[data-bg-image]:visible').each(function () {
|
||||
let target = $(this);
|
||||
let bg_url = target.data('bg-image');
|
||||
if (!bg_url || bg_url.width === 0 || bg_url.width === 'undefined') {
|
||||
bg_url = mp_empty_image_url;
|
||||
}
|
||||
mp_resize_bg_image_area(target, bg_url);
|
||||
});
|
||||
});
|
||||
function load_initial() {
|
||||
if (!bg_image_load) {
|
||||
if (loadBgImage()) {
|
||||
bg_image_load = true;
|
||||
placeholderLoaderRemove($('.mpStyle.placeholderLoader'))
|
||||
}
|
||||
}
|
||||
}
|
||||
}(jQuery));
|
||||
//=============================================================================Change icon and text=================//
|
||||
function content_icon_change(currentTarget) {
|
||||
let openIcon = currentTarget.data('open-icon');
|
||||
let closeIcon = currentTarget.data('close-icon');
|
||||
if (openIcon || closeIcon) {
|
||||
currentTarget.find('[data-icon]').toggleClass(closeIcon).toggleClass(openIcon);
|
||||
}
|
||||
}
|
||||
function content_text_change(currentTarget) {
|
||||
let openText = currentTarget.data('open-text');
|
||||
openText = openText ? openText.toString() : '';
|
||||
let closeText = currentTarget.data('close-text');
|
||||
closeText = closeText ? closeText : '';
|
||||
if (openText || closeText) {
|
||||
let text = currentTarget.find('[data-text]').html();
|
||||
text = text ? text.toString() : ''
|
||||
if (text !== openText) {
|
||||
currentTarget.find('[data-text]').html(openText);
|
||||
} else {
|
||||
currentTarget.find('[data-text]').html(closeText);
|
||||
}
|
||||
}
|
||||
}
|
||||
function content_class_change(currentTarget) {
|
||||
let clsName = currentTarget.data('add-class');
|
||||
if (clsName) {
|
||||
if (currentTarget.find('[data-class]').length > 0) {
|
||||
currentTarget.find('[data-class]').toggleClass(clsName);
|
||||
} else {
|
||||
currentTarget.toggleClass(clsName);
|
||||
}
|
||||
}
|
||||
}
|
||||
function content_input_value_change(currentTarget) {
|
||||
currentTarget.find('[data-value]').each(function () {
|
||||
let value = jQuery(this).val();
|
||||
if (value) {
|
||||
jQuery(this).val('');
|
||||
} else {
|
||||
jQuery(this).val(jQuery(this).data('value'));
|
||||
}
|
||||
jQuery(this).trigger('change');
|
||||
});
|
||||
}
|
||||
function mp_all_content_change($this) {
|
||||
loadBgImage();
|
||||
content_class_change($this);
|
||||
content_icon_change($this);
|
||||
content_text_change($this);
|
||||
content_input_value_change($this);
|
||||
}
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on('click', '.mp_load_more_text_area [data-read]', function (e) {
|
||||
e.stopPropagation();
|
||||
let parent = $(this).closest('.mp_load_more_text_area');
|
||||
let open_text = parent.find('[data-read-open]').html();
|
||||
let close_text = parent.find('[data-read-close]').html();
|
||||
parent.find('[data-read-close]').html(open_text);
|
||||
parent.find('[data-read-open]').html(close_text);
|
||||
content_text_change($(this));
|
||||
});
|
||||
$(document).on('click', '[data-all-change]', function () {
|
||||
mp_all_content_change($(this));
|
||||
});
|
||||
$(document).on('click', '[data-icon-change]', function () {
|
||||
content_icon_change($(this));
|
||||
});
|
||||
$(document).on('click', '[data-text-change]', function () {
|
||||
content_text_change($(this));
|
||||
});
|
||||
$(document).on('click', '[data-class-change]', function () {
|
||||
content_class_change($(this));
|
||||
});
|
||||
$(document).on('click', '[data-value-change]', function () {
|
||||
content_input_value_change($(this));
|
||||
});
|
||||
$(document).on('keyup change', '.mpStyle [data-input-text]', function () {
|
||||
let input_value = $(this).val();
|
||||
let input_id = $(this).data('input-text');
|
||||
$("[data-input-change='" + input_id + "']").each(function () {
|
||||
$(this).html(input_value);
|
||||
});
|
||||
});
|
||||
$(document).on('keyup change', '.mpStyle [data-target-same-input]', function () {
|
||||
let input_value = $(this).val();
|
||||
let input_id = $(this).data('target-same-input');
|
||||
$("[data-same-input='" + input_id + "']").each(function () {
|
||||
$(this).val(input_value);
|
||||
});
|
||||
});
|
||||
}(jQuery));
|
||||
//==============================================================================Qty inc dec================//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on("click", "div.mpStyle .decQty ,div.mpStyle .incQty", function () {
|
||||
let current = $(this);
|
||||
let target = current.closest('.qtyIncDec').find('input');
|
||||
let currentValue = parseInt(target.val());
|
||||
let value = current.hasClass('incQty') ? (currentValue + 1) : ((currentValue - 1) > 0 ? (currentValue - 1) : 0);
|
||||
let min = parseInt(target.attr('min'));
|
||||
let max = parseInt(target.attr('max'));
|
||||
target.parents('.qtyIncDec').find('.incQty , .decQty').removeClass('mpDisabled');
|
||||
if (value < min || isNaN(value) || value === 0) {
|
||||
value = min;
|
||||
target.parents('.qtyIncDec').find('.decQty').addClass('mpDisabled');
|
||||
}
|
||||
if (value > max) {
|
||||
value = max;
|
||||
target.parents('.qtyIncDec').find('.incQty').addClass('mpDisabled');
|
||||
}
|
||||
target.val(value).trigger('change').trigger('input');
|
||||
});
|
||||
}(jQuery));
|
||||
//==============================================================================Input use as select================//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on("click", "div.mpStyle .mp_input_select input.formControl", function () {
|
||||
$(this).closest('.mp_input_select').find('.mp_input_select_list').slideDown(250);
|
||||
});
|
||||
$(document).on("click", "div.mpStyle .mp_input_select .mp_input_select_list li", function () {
|
||||
let current = $(this);
|
||||
let parent = $(this).closest('.mp_input_select');
|
||||
let value = current.data('value');
|
||||
let text = current.html();
|
||||
parent.find('input.formControl').val(text);
|
||||
parent.find('.mp_input_select_list').slideUp(250);
|
||||
parent.find('input[type="hidden"]').val(value).trigger('change')
|
||||
});
|
||||
}(jQuery));
|
||||
//============================================================================Sticky================//
|
||||
function mp_sticky_management() {
|
||||
if (jQuery('.mpStyle .mp_sticky_area').length > 0) {
|
||||
window.onscroll = function () {
|
||||
jQuery('.mpStyle .mp_sticky_area').each(function () {
|
||||
let body_width = jQuery('body').outerWidth();
|
||||
let scroll_top = jQuery(window).scrollTop();
|
||||
let current = jQuery(this);
|
||||
let target_scroll = current.find('.mp_sticky_on_scroll');
|
||||
let content_top = current.parent().offset().top;
|
||||
let parent = current.closest('.mp_sticky_section');
|
||||
let depend_height = parent.find('.mp_sticky_depend_area').innerHeight();
|
||||
let content_height = depend_height - Math.max(scroll_top - content_top, 0) - (target_scroll.offset().top - current.offset().top) - 100;
|
||||
if (body_width > 800 && scroll_top + 100 >= content_top) {
|
||||
target_scroll.css('max-height', content_height);
|
||||
if (!current.hasClass('mpSticky')) {
|
||||
current.addClass('mpSticky').css('top', 100);
|
||||
}
|
||||
} else {
|
||||
target_scroll.css('max-height', content_height + 100);
|
||||
current.removeClass('mpSticky');
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
mp_sticky_management();
|
||||
});
|
||||
}(jQuery));
|
||||
//============================================================================Tabs================//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
function active_next_tab(parent, targetTab) {
|
||||
parent.height(parent.height());
|
||||
let tabsContent = parent.find('.tabsContentNext:first');
|
||||
let target_tabContent = tabsContent.children('[data-tabs-next="' + targetTab + '"]');
|
||||
let index = target_tabContent.index() + 1;
|
||||
let num_of_tab = parent.find('.tabListsNext:first').children('[data-tabs-target-next]').length;
|
||||
let i = 1;
|
||||
for (i; i <= num_of_tab; i++) {
|
||||
let target_tab = parent.find('.tabListsNext:first').children('[data-tabs-target-next]:nth-child(' + i + ')');
|
||||
if (i <= index) {
|
||||
target_tab.addClass('active');
|
||||
} else {
|
||||
target_tab.removeClass('active');
|
||||
}
|
||||
if (i === index - 1) {
|
||||
mp_all_content_change(target_tab);
|
||||
}
|
||||
}
|
||||
if (index < 2 && num_of_tab > index) {
|
||||
parent.find('.nextTab_next').slideDown('fast');
|
||||
parent.find('.nextTab_prev').slideUp('fast');
|
||||
} else if (num_of_tab === index) {
|
||||
parent.find('.nextTab_next').slideUp('fast');
|
||||
parent.find('.nextTab_prev').slideDown('fast');
|
||||
} else {
|
||||
parent.find('.nextTab_next').slideDown('fast');
|
||||
parent.find('.nextTab_prev').slideDown('fast');
|
||||
}
|
||||
target_tabContent.slideDown(350);
|
||||
tabsContent.children('[data-tabs-next].active').slideUp(350).removeClass('active').promise().done(function () {
|
||||
target_tabContent.addClass('active').promise().done(function () {
|
||||
pageScrollTo(tabsContent);
|
||||
parent.height('auto').promise().done(function () {
|
||||
loadBgImage();
|
||||
mp_sticky_management();
|
||||
dLoaderRemove(parent);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
$(document).on('click', '.mpStyle .mpTabsNext .nextTab_prev_link', function () {
|
||||
let parent = $(this).closest('.mpTabsNext');
|
||||
if (parent.find('[data-tabs-target-next].active').length > 1) {
|
||||
parent.find('.nextTab_prev').trigger('click');
|
||||
}
|
||||
});
|
||||
$(document).on('click', '.mpStyle .mpTabsNext .nextTab_next', function () {
|
||||
let parent = $(this).closest('.mpTabsNext');
|
||||
let target = parent.find('.tabListsNext:first');
|
||||
let num_of_tab = target.children('[data-tabs-target-next].active').length + 1;
|
||||
let targetTab = target.children('[data-tabs-target-next]:nth-child(' + num_of_tab + ')').data('tabs-target-next');
|
||||
active_next_tab(parent, targetTab);
|
||||
});
|
||||
$(document).on('click', '.mpStyle .mpTabsNext .nextTab_prev', function () {
|
||||
let parent = $(this).closest('.mpTabsNext');
|
||||
let target = parent.find('.tabListsNext:first');
|
||||
let num_of_tab = target.children('[data-tabs-target-next].active').length - 1;
|
||||
let targetTab = target.children('[data-tabs-target-next]:nth-child(' + num_of_tab + ')').data('tabs-target-next');
|
||||
active_next_tab(parent, targetTab);
|
||||
});
|
||||
$(document).ready(function () {
|
||||
$('.mpStyle .mpTabs').each(function () {
|
||||
let tabLists = $(this).find('.tabLists:first');
|
||||
let activeTab = tabLists.find('[data-tabs-target].active');
|
||||
let targetTab = activeTab.length > 0 ? activeTab : tabLists.find('[data-tabs-target]').first();
|
||||
targetTab.trigger('click');
|
||||
});
|
||||
$('.mpStyle .mpTabsNext').each(function () {
|
||||
let parent = $(this);
|
||||
if (parent.find('[data-tabs-target-next].active').length < 1) {
|
||||
dLoader(parent);
|
||||
let tabLists = parent.find('.tabListsNext:first');
|
||||
let targetTab = tabLists.find('[data-tabs-target-next]').first().data('tabs-target-next')
|
||||
active_next_tab(parent, targetTab);
|
||||
}
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.mpStyle [data-tabs-target]', function () {
|
||||
if (!$(this).hasClass('active')) {
|
||||
let tabsTarget = $(this).data('tabs-target');
|
||||
let parent = $(this).closest('.mpTabs');
|
||||
parent.height(parent.height());
|
||||
let tabLists = $(this).closest('.tabLists');
|
||||
let tabsContent = parent.find('.tabsContent:first');
|
||||
tabLists.find('[data-tabs-target].active').each(function () {
|
||||
$(this).removeClass('active').promise().done(function () {
|
||||
mp_all_content_change($(this))
|
||||
});
|
||||
});
|
||||
$(this).addClass('active').promise().done(function () {
|
||||
mp_all_content_change($(this))
|
||||
});
|
||||
tabsContent.children('[data-tabs="' + tabsTarget + '"]').slideDown(350);
|
||||
tabsContent.children('[data-tabs].active').slideUp(350).removeClass('active').promise().done(function () {
|
||||
tabsContent.children('[data-tabs="' + tabsTarget + '"]').addClass('active').promise().done(function () {
|
||||
//dLoaderRemove(tabsContent);
|
||||
loadBgImage();
|
||||
parent.height('auto');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}(jQuery));
|
||||
//======================================================================Collapse=================//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on('click', '[data-collapse-target]', function () {
|
||||
let currentTarget = $(this);
|
||||
let target_id = currentTarget.data('collapse-target');
|
||||
let close_id = currentTarget.data('close-target');
|
||||
let target = $('[data-collapse="' + target_id + '"]');
|
||||
if (target_close(close_id, target_id) && collapse_close_inside(currentTarget) && target_collapse(target, currentTarget)) {
|
||||
mp_all_content_change(currentTarget);
|
||||
}
|
||||
});
|
||||
$(document).on('change', 'select[data-collapse-target]', function () {
|
||||
let currentTarget = $(this);
|
||||
let value = currentTarget.val();
|
||||
currentTarget.find('option').each(function () {
|
||||
let target_id = $(this).data('option-target');
|
||||
let target = $('[data-collapse="' + target_id + '"]');
|
||||
target.slideUp('fast').removeClass('mActive');
|
||||
}).promise().done(function () {
|
||||
currentTarget.find('option').each(function () {
|
||||
let current_value = $(this).val();
|
||||
if (current_value === value) {
|
||||
if ($(this).attr('data-option-target-multi')) {
|
||||
let target_ids = $(this).data('option-target-multi');
|
||||
target_ids = target_ids.toString().split(" ");
|
||||
target_ids.forEach(function (target_id) {
|
||||
let target = $('[data-collapse="' + target_id + '"]');
|
||||
target.slideDown(350).removeClass('mActive');
|
||||
});
|
||||
} else {
|
||||
let target_id = $(this).data('option-target');
|
||||
let target = $('[data-collapse="' + target_id + '"]');
|
||||
target.slideDown(350).removeClass('mActive');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
function target_close(close_id, target_id) {
|
||||
$('body').find('[data-close="' + close_id + '"]:not([data-collapse="' + target_id + '"])').slideUp(250);
|
||||
return true;
|
||||
}
|
||||
function target_collapse(target, $this) {
|
||||
if ($this.is('[type="radio"]')) {
|
||||
target.slideDown(250);
|
||||
} else {
|
||||
target.each(function () {
|
||||
$(this).slideToggle(250).toggleClass('mActive');
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function collapse_close_inside(currentTarget) {
|
||||
let parent_target_close = currentTarget.data('collapse-close-inside');
|
||||
if (parent_target_close) {
|
||||
$(parent_target_close).find('[data-collapse]').each(function () {
|
||||
if ($(this).hasClass('mActive')) {
|
||||
let collapse_id = $(this).data('collapse');
|
||||
let target_collapse = $('[data-collapse-target="' + collapse_id + '"]');
|
||||
if (collapse_id !== currentTarget.data('collapse-target')) {
|
||||
$(this).slideUp(250).removeClass('mActive');
|
||||
let clsName = target_collapse.data('add-class');
|
||||
if (clsName) {
|
||||
target_collapse.removeClass(clsName);
|
||||
}
|
||||
content_text_change(target_collapse);
|
||||
content_icon_change(target_collapse);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}(jQuery));
|
||||
//=====================================================================Group Check box==========//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on('click', '.groupCheckBox .customCheckboxLabel', function () {
|
||||
let parent = $(this).closest('.groupCheckBox');
|
||||
let value = '';
|
||||
let separator = ',';
|
||||
parent.find(' input[type="checkbox"]').each(function () {
|
||||
if ($(this).is(":checked")) {
|
||||
let currentValue = $(this).attr('data-checked');
|
||||
value = value + (value ? separator : '') + currentValue;
|
||||
}
|
||||
}).promise().done(function () {
|
||||
parent.find('input[type="hidden"]').val(value);
|
||||
});
|
||||
});
|
||||
// radio
|
||||
$(document).on('click', '[data-radio]', function () {
|
||||
let target = $(this).closest('label');
|
||||
let value = $(this).attr('data-radio');
|
||||
target.find('.customRadio').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
target.find('input').val(value).trigger('change');
|
||||
});
|
||||
$(document).on('click', '.groupRadioBox [data-group-radio]', function () {
|
||||
let parent = $(this).closest('.groupRadioBox');
|
||||
let $this = $(this);
|
||||
let value = $this.data('group-radio');
|
||||
parent.find('[data-group-radio]').each(function () {
|
||||
$(this).removeClass('active');
|
||||
}).promise().done(function () {
|
||||
$this.addClass('active');
|
||||
parent.find('input[type="text"]').val(value);
|
||||
});
|
||||
});
|
||||
//Group radio like checkbox
|
||||
$(document).on('click', '.groupRadioCheck [data-radio-check]', function () {
|
||||
//e.stopPropagation();
|
||||
let parent = $(this).closest('.groupRadioCheck');
|
||||
let $this = $(this);
|
||||
if (!$this.hasClass('mpActive')) {
|
||||
let value = $this.data('radio-check');
|
||||
parent.find('.mpActive[data-radio-check]').each(function () {
|
||||
$(this).removeClass('mpActive');
|
||||
mp_all_content_change($(this));
|
||||
}).promise().done(function () {
|
||||
$this.addClass('mpActive');
|
||||
mp_all_content_change($this);
|
||||
parent.find('input[type="hidden"]').val(value).trigger('change');
|
||||
});
|
||||
}
|
||||
});
|
||||
}(jQuery));
|
||||
//=======================================================validation ==============//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on('keyup change', '.mpStyle .mp_number_validation', function () {
|
||||
let n = $(this).val();
|
||||
$(this).val(n.replace(/\D/g, ''));
|
||||
return true;
|
||||
});
|
||||
$(document).on('keyup change', '.mpStyle .mp_price_validation', function () {
|
||||
let n = $(this).val();
|
||||
$(this).val(n.replace(/[^\d.]/g, ''));
|
||||
return true;
|
||||
});
|
||||
$(document).on('keyup change', '.mpStyle .mp_name_validation', function () {
|
||||
let n = $(this).val();
|
||||
$(this).val(n.replace(/[@%'":;&_]/g, ''));
|
||||
return true;
|
||||
});
|
||||
$(document).on('keyup change', '.mpStyle [required]', function () {
|
||||
if ($(this).val() !== '') {
|
||||
$(this).removeClass('mpRequired');
|
||||
} else {
|
||||
$(this).addClass('mpRequired');
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}(jQuery));
|
||||
//==========================================================pagination==========//
|
||||
function mp_pagination_page_management(parent, pagination_page, total_item) {
|
||||
let per_page_item = parseInt(parent.find('input[name="pagination_per_page"]').val());
|
||||
let total_active_page = Math.floor(total_item / per_page_item) + ((total_item % per_page_item) > 0 ? 1 : 0);
|
||||
let page_limit_start = (pagination_page > 2) ? (pagination_page - 2) : 0;
|
||||
let page_limit_end = (pagination_page > 2) ? (pagination_page + 2) : 4;
|
||||
let limit_dif = total_active_page - pagination_page;
|
||||
if (total_active_page > 5 && limit_dif < 3) {
|
||||
page_limit_start = page_limit_start - ((limit_dif > 1) ? 1 : 2);
|
||||
}
|
||||
let total_page = parent.find('[data-pagination]').length;
|
||||
for (let i = 0; i < total_page; i++) {
|
||||
if (i < total_active_page && i >= page_limit_start && i <= page_limit_end) {
|
||||
parent.find('[data-pagination="' + i + '"]').slideDown(200);
|
||||
} else {
|
||||
parent.find('[data-pagination="' + i + '"]').slideUp(200);
|
||||
}
|
||||
}
|
||||
if (pagination_page > 0) {
|
||||
parent.find('.page_prev').removeAttr('disabled');
|
||||
} else {
|
||||
parent.find('.page_prev').prop('disabled', true);
|
||||
}
|
||||
if (pagination_page > 2 && total_active_page > 5) {
|
||||
parent.find('.ellipse_left').slideDown(200);
|
||||
} else {
|
||||
parent.find('.ellipse_left').slideUp(200);
|
||||
}
|
||||
if (pagination_page < total_active_page - 3 && total_active_page > 5) {
|
||||
parent.find('.ellipse_right').slideDown(200);
|
||||
} else {
|
||||
parent.find('.ellipse_right').slideUp(200);
|
||||
}
|
||||
if (pagination_page < total_active_page - 1) {
|
||||
parent.find('.page_next').removeAttr('disabled');
|
||||
} else {
|
||||
parent.find('.page_next').prop('disabled', true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on('click', '.pagination_area .page_prev', function (e) {
|
||||
e.preventDefault();
|
||||
let parent = $(this).closest('.pagination_area');
|
||||
let page_no = parseInt(parent.find('.active_pagination').data('pagination')) - 1;
|
||||
parent.find('[data-pagination="' + page_no + '"]').trigger('click');
|
||||
});
|
||||
$(document).on('click', '.pagination_area .page_next', function (e) {
|
||||
e.preventDefault();
|
||||
let parent = $(this).closest('.pagination_area');
|
||||
let page_no = parseInt(parent.find('.active_pagination').data('pagination')) + 1;
|
||||
parent.find('[data-pagination="' + page_no + '"]').trigger('click');
|
||||
});
|
||||
}(jQuery));
|
||||
//==============================================================Modal / Popup==========//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).on('click', '.mpStyle [data-target-popup]', function () {
|
||||
let target = $(this).attr('data-active-popup', '').data('target-popup');
|
||||
$('body').addClass('noScroll').find('[data-popup="' + target + '"]').addClass('in').promise().done(function () {
|
||||
loadBgImage();
|
||||
return true;
|
||||
});
|
||||
});
|
||||
$(document).on('click', 'div.mpPopup .popupClose', function () {
|
||||
$(this).closest('[data-popup]').removeClass('in');
|
||||
$('body').removeClass('noScroll').find('[data-active-popup]').removeAttr('data-active-popup');
|
||||
return true;
|
||||
});
|
||||
}(jQuery));
|
||||
//==============================================================Slider=================//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
//=================initial call============//
|
||||
$('.superSlider').each(function () {
|
||||
sliderItemActive($(this), 1);
|
||||
});
|
||||
//==============Slider===================//
|
||||
$(document).on('click', '.superSlider [data-slide-target]', function () {
|
||||
if (!$(this).hasClass('activeSlide')) {
|
||||
let activeItem = $(this).data('slide-target');
|
||||
let parent = $(this).closest('.superSlider');
|
||||
sliderItemActive(parent, activeItem);
|
||||
parent.find('[data-slide-target]').removeClass('activeSlide');
|
||||
$(this).addClass('activeSlide');
|
||||
}
|
||||
});
|
||||
$(document).on('click', '.superSlider .iconIndicator', function () {
|
||||
let parent = $(this).closest('.superSlider');
|
||||
let activeItem = parseInt(parent.find('.sliderAllItem').first().find('.sliderItem.activeSlide').data('slide-index'));
|
||||
if ($(this).hasClass('nextItem')) {
|
||||
++activeItem;
|
||||
} else {
|
||||
--activeItem;
|
||||
}
|
||||
sliderItemActive(parent, activeItem);
|
||||
});
|
||||
function sliderItemActive(parent, activeItem) {
|
||||
let itemLength = parent.find('.sliderAllItem').first().find('[data-slide-index]').length;
|
||||
let currentItem = getSliderItem(parent, activeItem);
|
||||
let activeCurrent = parseInt(parent.find('.sliderAllItem').first().find('.sliderItem.activeSlide').data('slide-index'));
|
||||
let i = 1;
|
||||
for (i; i <= itemLength; i++) {
|
||||
let target = parent.find('.sliderAllItem').first().find('[data-slide-index="' + i + '"]').first();
|
||||
if (i < currentItem && currentItem !== 1) {
|
||||
sliderClassControl(target, currentItem, activeCurrent, 'prevSlider', 'nextSlider');
|
||||
}
|
||||
if (i === currentItem) {
|
||||
parent.find('.sliderAllItem').first().find('[data-slide-index="' + currentItem + '"]').removeClass('prevSlider nextSlider').addClass('activeSlide');
|
||||
}
|
||||
if (i > currentItem && currentItem !== itemLength) {
|
||||
sliderClassControl(target, currentItem, activeCurrent, 'nextSlider', 'prevSlider');
|
||||
}
|
||||
if (i === itemLength && itemLength > 1) {
|
||||
if (currentItem === 1) {
|
||||
target = parent.find('.sliderAllItem').first().find('[data-slide-index="' + itemLength + '"]');
|
||||
sliderClassControl(target, currentItem, activeCurrent, 'prevSlider', 'nextSlider');
|
||||
}
|
||||
if (currentItem === itemLength) {
|
||||
target = parent.find('.sliderAllItem').first().find('[data-slide-index="1"]');
|
||||
sliderClassControl(target, currentItem, activeCurrent, 'nextSlider', 'prevSlider');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function sliderClassControl(target, currentItem, activeCurrent, add_class, remove_class) {
|
||||
if (target.hasClass('activeSlide')) {
|
||||
if (currentItem > activeCurrent) {
|
||||
target.removeClass('activeSlide').addClass(add_class);
|
||||
} else {
|
||||
target.removeClass('activeSlide').removeClass(remove_class).addClass(add_class);
|
||||
}
|
||||
} else if (target.hasClass(remove_class)) {
|
||||
target.removeClass(remove_class).delay(600).addClass(add_class);
|
||||
} else {
|
||||
if (!target.hasClass(add_class)) {
|
||||
target.addClass(add_class);
|
||||
}
|
||||
}
|
||||
}
|
||||
function getSliderItem(parent, activeItem) {
|
||||
let itemLength = parent.find('.sliderAllItem').first().find('[data-slide-index]').length;
|
||||
activeItem = activeItem < 1 ? itemLength : activeItem;
|
||||
activeItem = activeItem > itemLength ? 1 : activeItem;
|
||||
return activeItem;
|
||||
}
|
||||
//popup
|
||||
$(document).on('click', '.superSlider [data-target-popup]', function () {
|
||||
let target = $(this).data('target-popup');
|
||||
let activeItem = $(this).data('slide-index');
|
||||
$('body').addClass('noScroll').find('[data-popup="' + target + '"]').addClass('in').promise().done(function () {
|
||||
sliderItemActive($(this), activeItem);
|
||||
loadBgImage();
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.superSlider .popupClose', function () {
|
||||
$(this).closest('[data-popup]').removeClass('in');
|
||||
$('body').removeClass('noScroll');
|
||||
});
|
||||
}(jQuery));
|
||||
//======================================================================Outer Close==========//
|
||||
(function ($) {
|
||||
"use strict";
|
||||
$(document).click(function (e) {
|
||||
let target = $(e.target);
|
||||
let popup = target.closest('[data-popup]');
|
||||
if (popup.length > 0) {
|
||||
let hLength = target.closest('.popupHeader').length;
|
||||
let bLength = target.closest('.popupBody').length;
|
||||
let fLength = target.closest('.popupFooter').length;
|
||||
if (hLength === 0 && bLength === 0 && fLength === 0) {
|
||||
popup.find('.popupClose').trigger('click');
|
||||
}
|
||||
}
|
||||
let mp_input_select_list = target.closest('.mp_input_select');
|
||||
if (mp_input_select_list.length === 0) {
|
||||
$('body').find('.mp_input_select_list').slideUp(250);
|
||||
}
|
||||
});
|
||||
}(jQuery));
|
0
css/mage-options-framework.css → assets/helper/pick_plugin/mage-options-framework.css
Executable file → Normal file
0
js/mage-options-framework.js → assets/helper/pick_plugin/mage-options-framework.js
Executable file → Normal file
1460
css/admin_style.css
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":["codemirror.css"],"names":[],"mappings":"AAEA,YAEE,YAA2F,UAC3F,OAAQ,MACR,MAAO,KAKT,kBACE,QAAS,IAAI,EAEf,gBACE,QAAS,EAAE,IAGiB,0BAA9B,6BACE,iBAAkB,KAKpB,oBACE,aAAc,IAAI,MAAM,KACxB,iBAAkB,QAClB,YAAa,OAGf,uBACE,QAAS,EAAE,IAAI,EAAE,IACjB,UAAW,KACX,WAAY,MACZ,MAAO,KACP,YAAa,OAGf,yBAA2B,MAAO,KAClC,gCAAkC,MAAO,KAIzC,mBACE,YAAa,IAAI,MAAM,KACvB,aAAc,KACd,MAAO,EAGT,2CACE,YAAa,IAAI,MAAM,OAEzB,kCACE,MAAO,KACP,OAAQ,YACR,WAAY,KAEd,sCACE,QAAS,EAGX,uBACE,MAAO,KACP,OAAQ,EACR,kBAAmB,MAAM,MAAM,SAAS,SACxC,eAAgB,MAAM,MAAM,SAAS,SACrC,UAAW,MAAM,MAAM,SAAS,SAChC,iBAAkB,KAEpB,sBAEE,IAAM,iBAAkB,aAG1B,yBAEE,IAAM,iBAAkB,aAG1B,iBAEE,IAAM,iBAAkB,aAO1B,QAAU,QAAS,aAAc,gBAAiB,QAElD,kBACE,YAAa,IAAI,MAAM,KACvB,SAAU,SAKZ,yBAA0B,MAAO,KACjC,wBAAyB,MAAO,KAChC,aAAc,MAAO,KACrB,aAAc,MAAO,KACrB,WAAY,WAAY,YAAa,IACrC,OAAQ,WAAY,OACpB,SAAU,gBAAiB,UAC3B,kBAAmB,gBAAiB,aAEpC,0BAA2B,MAAO,KAClC,uBAAwB,MAAO,KAC/B,yBAA0B,MAAO,KACjC,sBAAuB,MAAO,KAK9B,6BAA8B,MAAO,KACrC,6BAA8B,MAAO,KACrC,0BAA2B,MAAO,KAClC,yBAA0B,MAAO,KACjC,2BAA4B,MAAO,KACnC,uBACA,4BADwB,MAAO,KAE/B,0BAA2B,MAAO,KAClC,0BAA2B,MAAO,KAClC,sBAAuB,MAAO,KAC9B,4BAA6B,MAAO,KACpC,qBAAsB,MAAO,KAC7B,uBAAwB,MAAO,KAG/B,gBADA,wBAAyB,MAAO,IAGhC,sBAAwB,cAAe,IAAI,MAI3C,+CAAgD,MAAO,KACvD,kDAAmD,MAAO,KAC1D,wBAA0B,WAAY,mBACtC,kCAAmC,WAAY,QAO/C,YACE,SAAU,SACV,SAAU,OACV,WAAY,KAGd,mBACE,SAAU,iBAGV,cAAmf,MAAO,aAAc,MACxgB,eAAgB,KAChB,OAAQ,KACR,QAAS,EACT,SAAqR,SAEvR,kBACE,SAAU,SACV,aAAc,KAAK,MAAM,YAMmD,0BAAtD,uBAAwB,6BAAhD,uBACE,SAAU,SACV,QAAS,EACT,QAAS,KAEX,uBACE,MAAO,EAAG,IAAK,EACf,WAAY,OACZ,WAAY,OAEd,uBACE,OAAQ,EAAG,KAAM,EACjB,WAAY,OACZ,WAAY,OAEd,6BACE,MAAO,EAAG,OAAQ,EAEpB,0BACE,KAAM,EAAG,OAAQ,EAGnB,oBACE,SAAU,SAAU,KAAM,EAAG,IAAK,EAClC,WAAY,KACZ,QAAS,EAEX,mBACE,YAAa,OACb,OAAQ,KACR,QAAS,aACT,eAAgB,IAChB,cAAe,MAKjB,2BACE,SAAU,SACV,QAAS,EACT,yBACA,sBAaA,oBAAqB,KACrB,iBAAkB,KAClB,YAAa,KAbf,8BACE,SAAU,SACV,IAAK,EAAG,OAAQ,EAChB,QAAS,EAEX,uBACE,SAAU,SACV,OAAQ,QACR,QAAS,EAQX,kBACE,OAAQ,KACR,WAAY,IAEd,gBAEE,mBAA0L,EAAG,sBAAuB,EAAG,cAAe,EACtO,aAAc,EACd,eACA,YAAa,QACb,UAAW,QACX,OAAQ,EACR,YAAa,IACb,UAAW,OACX,YAAa,QACb,MAAO,QACP,QAAS,EACT,SAAU,SACV,SAAU,QACV,4BAA6B,YAC7B,+BAAgC,KAChC,uBAAwB,KAE1B,qBACE,UAAW,WACX,YAAa,SACb,WAAY,OAGd,2BACE,SAAU,SACV,KAAM,EAAG,MAAO,EAAG,IAAK,EAAG,OAAQ,EACnC,QAAS,EAGX,uBACE,SAAU,SACV,QAAS,EACT,SAAU,KAKZ,iBACE,QAAS,EAMX,mBACA,oBACA,uBAJA,mBACA,kBAIE,gBAAiB,YACjB,WAAY,YAGd,oBACE,SAAU,SACV,MAAO,KACP,OAAQ,EACR,SAAU,OACV,WAAY,OAGd,mBAAqB,SAAU,SAC/B,wBAA0B,SAAU,OAEpC,uBACE,WAAY,OACZ,SAAU,SACV,QAAS,EAMX,2CAJA,2BACE,WAAY,QAOd,qBAAuB,WAAY,QACnC,yCAEA,4BAA6B,iCAAoC,sCAC2D,WAAY,QAFxI,sBAAwB,OAAQ,UAEhC,iCAAkC,sCAAyC,2CAAiD,WAAY,QAExI,cACE,WAAY,KACZ,WAAY,mBAOd,iBAAmB,cAAe,KAElC,aAEE,mCACE,WAAY,QAKhB,wBAA0B,QAAS,GAGnC,6BAA+B"}
|
|
@ -1,183 +0,0 @@
|
|||
div.list_with_filter_section {margin: 0 0 20px 0;}
|
||||
div.list_with_filter_section div.all_filter_item{display: none;}
|
||||
div.item_bg_image {
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
height: 100%;
|
||||
-webkit-transition: all 0.5s ease-in-out;
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
div.item_bg_image:hover {
|
||||
transform: scale(1.1);
|
||||
-webkit-transition: all 0.5s ease-in-out;
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
|
||||
/****************************************/
|
||||
div.search_result_empty {
|
||||
display: none;font-weight: 500;
|
||||
font-size: 22px;
|
||||
color: #6B003E;
|
||||
}
|
||||
|
||||
div.search_sort_code {position: relative; width: 100%;}
|
||||
div.search_sort_code .filter_input_area .formControl {border: none;border-radius: 0;height: 100%;}
|
||||
div.search_sort_code span.fa {margin: 0 7px 0 0;font-size: 12px;}
|
||||
|
||||
div.filter_input_area {position: relative;width: 100%;height: 50%;margin: 0 auto;border: 4px solid #DDD;}
|
||||
div.filter_input_area:first-child {border-bottom-width: 2px;}
|
||||
div.filter_input_area:last-child {border-top-width: 2px;}
|
||||
div.filter_input_area > * {border-right: 4px solid #DDD;}
|
||||
div.filter_input_area > *:last-child {border-right: none;}
|
||||
/****************************************/
|
||||
div.spinner_loading {position: absolute;z-index: 1111;left: 0;right: 0;top: 0;bottom: 0;background-color: #FFFD;}
|
||||
div.spinner_loading > div {height: 100%;}
|
||||
div.icon_loader {
|
||||
display: flex !important;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-justify-content: center;
|
||||
justify-content: center;
|
||||
font-size: 40px;
|
||||
z-index: 11111;
|
||||
position: relative;
|
||||
}
|
||||
div.icon_loader_xs {
|
||||
display: flex !important;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-justify-content: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
z-index: 11111;
|
||||
position: relative
|
||||
}
|
||||
|
||||
.pagination_area .ellipse_left,
|
||||
.pagination_area .ellipse_right {
|
||||
min-width: 50px;background-color: #FFF;
|
||||
}
|
||||
.pagination_area .ellipse_left > div,
|
||||
.pagination_area .ellipse_right > div {
|
||||
width: 100%;height: 100%;
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-justify-content: center;justify-content: center;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
}
|
||||
.pagination_area [class*="Button"] {
|
||||
padding: 0 15px;
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
min-width: 150px;
|
||||
height: auto;
|
||||
min-height: 40px;
|
||||
-webkit-appearance: button;
|
||||
overflow: visible;
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-justify-content: center;justify-content: center;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
border-radius: 5px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.pagination_area [class*="Button"]:hover{opacity: 0.8;}
|
||||
.pagination_area button.pagination_load_more {border:none;}
|
||||
.pagination_area button[class*="defaultButton_xs"] {
|
||||
min-width: 50px;
|
||||
padding: 0;
|
||||
}
|
||||
.pagination_area button[class*="defaultButton_xs"]:first-child {border: none;}
|
||||
.pagination_area button[class*="defaultButton_xs"]:last-child {border-radius: 0 5px 5px 0 !important;}
|
||||
.pagination_area button[class*="defaultButton_xs"].active_pagination {
|
||||
color: #000;
|
||||
background-color: #DDD;
|
||||
}
|
||||
|
||||
.pagination_area .ellipse_left {display: none;}
|
||||
.pagination_area button[disabled] {cursor: not-allowed;opacity: 0.8;background-color: #DDD;}
|
||||
/****************************************/
|
||||
.list_with_filter_section div.buttonGroup [class*="Button"] {
|
||||
border: none;
|
||||
border-left: 2px solid #DDD;
|
||||
border-radius: 0;
|
||||
}
|
||||
.list_with_filter_section div.buttonGroup {
|
||||
position: relative;
|
||||
border: 0;
|
||||
border-radius: 5px;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
}
|
||||
div.buttonGroup [class*="Button"]:first-child {
|
||||
-webkit-border-radius: 5px 0 0 5px;
|
||||
border-radius: 5px 0 0 5px;
|
||||
border-left: none;
|
||||
}
|
||||
.list_with_filter_section .flexEqual {display: -webkit-flex;display: flex;}
|
||||
div.buttonGroup > *,
|
||||
.list_with_filter_section .flexEqual > * {
|
||||
-webkit-flex: 1;-ms-flex: 1;flex: 1;
|
||||
}
|
||||
.list_with_filter_section .circleIcon_xs {
|
||||
width: 25px;height: 25px;min-width: 25px;
|
||||
background-color: #FF5959;
|
||||
color: #FFF;
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-justify-content: center;justify-content: center;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
}
|
||||
.list_with_filter_section .sort_code_search_box {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
border: 1px solid #DDD;
|
||||
-webkit-flex-wrap: wrap;flex-wrap: wrap;
|
||||
padding: 5px;
|
||||
}
|
||||
.list_with_filter_section .sort_code_search_box label {display: block; margin: 0;}
|
||||
.list_with_filter_section [class*="defaultButton"] { color: #FFF;}
|
||||
.list_with_filter_section [class*="defaultButton_xs"] {min-width: auto;padding: 7px;font-size: 16px;}
|
||||
.list_with_filter_section .search_sort_code_area {margin: 15px 0;}
|
||||
.list_with_filter_section .formControl {
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
-webkit-flex-wrap: nowrap;flex-wrap: nowrap;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
min-width: auto;max-width: inherit;
|
||||
padding: 7px;
|
||||
margin: 0;
|
||||
color: #555;
|
||||
line-height: 1.25;
|
||||
background: rgba(255, 255, 255, .99);
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, .1) inset;
|
||||
border: 1px solid #CCC !important;
|
||||
height: 40px !important;
|
||||
}
|
||||
.list_with_filter_section .formControl:-webkit-autofill,
|
||||
.list_with_filter_section .formControl:-webkit-autofill:hover,
|
||||
.list_with_filter_section .formControl:-webkit-autofill:focus,
|
||||
.list_with_filter_section .formControl:-webkit-autofill:active {
|
||||
-webkit-transition: color 9999s ease-out, background-color 9999s ease-out;
|
||||
transition: color 9999s ease-out, background-color 9999s ease-out;
|
||||
-webkit-transition-delay: 9999s;
|
||||
transition-delay: 9999s;
|
||||
}
|
||||
.list_with_filter_section .alignCenter {
|
||||
display: -webkit-flex;display: flex;
|
||||
-webkit-align-items: center;align-items: center;
|
||||
-webkit-flex-wrap: nowrap;flex-wrap: nowrap;
|
||||
}
|
||||
.list_with_filter_section .allCenter {
|
||||
display: -webkit-flex !important;
|
||||
display: flex !important;
|
||||
-webkit-justify-content: flex-start;
|
||||
justify-content: flex-start;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-flex-direction: column;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
}
|
||||
.list_with_filter_section label{position: relative;}
|
||||
.list_with_filter_section span.filter_date_icon{position: absolute;top: 0;right: 0; padding: 7px 5px; bottom: 0; margin: 5px; color: #ddd;cursor:pointer;}
|
Before Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 120 B |
Before Width: | Height: | Size: 105 B |
Before Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 110 B |
Before Width: | Height: | Size: 119 B |
Before Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 6.2 KiB |
|
@ -1,6 +0,0 @@
|
|||
/**
|
||||
* Owl Carousel v2.3.4
|
||||
* Copyright 2013-2018 David Deutsch
|
||||
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
|
||||
*/
|
||||
.owl-theme .owl-dots,.owl-theme .owl-nav{text-align:center;-webkit-tap-highlight-color:transparent}.owl-theme .owl-nav{margin-top:10px}.owl-theme .owl-nav [class*=owl-]{color:#FFF;font-size:14px;margin:5px;padding:4px 7px;background:#D6D6D6;display:inline-block;cursor:pointer;border-radius:3px}.owl-theme .owl-nav [class*=owl-]:hover{background:#869791;color:#FFF;text-decoration:none}.owl-theme .owl-nav .disabled{opacity:.5;cursor:default}.owl-theme .owl-nav.disabled+.owl-dots{margin-top:10px}.owl-theme .owl-dots .owl-dot{display:inline-block;zoom:1}.owl-theme .owl-dots .owl-dot span{width:10px;height:10px;margin:5px 7px;background:#D6D6D6;display:block;-webkit-backface-visibility:visible;transition:opacity .2s ease;border-radius:30px}.owl-theme .owl-dots .owl-dot.active span,.owl-theme .owl-dots .owl-dot:hover span{background:#869791}
|
4918
css/style.css
|
@ -1,121 +0,0 @@
|
|||
@charset "utf-8";
|
||||
/*General CSS*/
|
||||
.welcome-tabs p { font-size: 15px;}
|
||||
.welcome-tabs h1, .welcome-tabs h2 { font-size: 30px;}
|
||||
.welcome-tabs h3, .welcome-tabs h4 { font-size: 25px;}
|
||||
.welcome-tabs h5, .welcome-tabs h6 { font-size: 20px;}
|
||||
body.events_page_mep_event_quick_setup_page .notice,
|
||||
body.events_page_mep_event_quick_setup_page .error,
|
||||
body.events_page_mep_event_quick_setup_page .updated { display: none !important;}
|
||||
.welcome-tabs .float-right { float: right;}
|
||||
.welcome-tabs .float-left { float: right;}
|
||||
.welcome-tabs .float-none { float: right;}
|
||||
.welcome-tabs.vertical { position: relative;}
|
||||
.welcome-tabs .tab-navs { text-align: center;margin: 0;}
|
||||
.welcome-tabs .tab-nav {
|
||||
padding: 10px 20px;
|
||||
background: #FFF;
|
||||
margin: 4px 25px;
|
||||
border: 1px solid #EEE;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
font-size: 20px;
|
||||
}
|
||||
.welcome-tabs .tab-nav.active { background: #2271b1; color: #FFF;border-bottom: 5px solid #000;}
|
||||
.welcome-tabs .tab-nav:after {
|
||||
content: "";
|
||||
width: 60px;
|
||||
height: 2px;
|
||||
top: 40%;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
transform: translate(100%, 50%);
|
||||
border-bottom: 2px dashed #DDD;
|
||||
}
|
||||
.welcome-tabs .tab-nav:last-child:after { width: 0;}
|
||||
.welcome-tabs .tab-nav.done:after { border-bottom: 2px dashed #2FBD1A;}
|
||||
.welcome-tabs .tab-content {
|
||||
padding: 30px;
|
||||
background: #F2f2f2;
|
||||
display: none;
|
||||
max-width: 100%;
|
||||
margin: 40px auto;
|
||||
}
|
||||
.welcome-tabs .tab-content.active { display: block;}
|
||||
.welcome-tabs .next-prev {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
}
|
||||
.welcome-tabs .next-prev .prev { display: none; width: auto; transition: all ease 1s;border: 1px solid #555;float: left;}
|
||||
.welcome-tabs .next-prev .next {border: 1px solid #555;float: right;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
text-align: right;
|
||||
transition: all ease 1s;
|
||||
}
|
||||
.welcome-tabs .wc_status_table .info, .welcome-tabs .wc_status_table input, .welcome-tabs .wc_status_table select {
|
||||
text-align: left!important;
|
||||
float: left;
|
||||
}
|
||||
.welcome-tabs .next-prev span { padding: 15px 20px; display: block; cursor: pointer;font-size: 18px;}
|
||||
.welcome-tabs .next-prev .next:hover, .welcome-tabs .next-prev .prev:hover { background: #444; color: #FFF;}
|
||||
.welcome-tabs .submit-wrap { padding: 10px 0; text-align: center;}
|
||||
.welcome-tabs .submit-wrap input[type="submit"] { padding: 8px 40px; height: auto; font-size: 17px;}
|
||||
.welcome-tabs .section-title { padding: 0 15px; font-size: 16px; font-weight: 600;}
|
||||
.welcome-tabs .section-description { padding: 0 15px; margin-bottom: 25px;}
|
||||
.welcome-tabs .setting-field { margin-bottom: 15px; border-bottom: 1px solid #EEE; padding: 0 15px 15px 15px;}
|
||||
.welcome-tabs .setting-field:last-child { border-bottom: 1px solid #EEE0;}
|
||||
.welcome-tabs .setting-field .field-lable { width: 270px; float: left; font-size: 14px; word-break: break-word;}
|
||||
.welcome-tabs .setting-field .field-input { margin-left: 270px;}
|
||||
.welcome-tabs .setting-field .description { word-break: break-word;}
|
||||
/*field-repeatable-wrapper*/
|
||||
.ppof-settings .repeatable .item-wrap { margin-bottom: 5px; padding-bottom: 0;}
|
||||
.field-repeatable-wrapper .field-list { margin-top: 18px;}
|
||||
.welcome-tabs input[type="text"], .welcome-tabs textarea, .welcome-tabs select, .welcome-tabs input[type="range"] { width: 360px; background: #F1F1F1;}
|
||||
@media (max-width: 1170px) {
|
||||
.welcome-tabs input[type="text"],
|
||||
.welcome-tabs textarea,
|
||||
.welcome-tabs select,
|
||||
.welcome-tabs input[type="range"],
|
||||
.welcome-tabs .select2 { width: 100% !important; }
|
||||
}
|
||||
@media (max-width: 1440px) {
|
||||
.welcome-tabs .setting-field .field-lable { width: auto; float: none; font-size: 14px; }
|
||||
.welcome-tabs .setting-field .field-input { margin-left: 0; }
|
||||
}
|
||||
@media (max-width: 1700px) {
|
||||
.welcome-tabs .setting-field .setting-field .field-lable { width: auto; float: none; font-size: 14px; }
|
||||
.welcome-tabs .setting-field .setting-field .field-input { margin-left: 0; }
|
||||
}
|
||||
.welcome-tabs .pro-feature { background: #FFD87F; padding: 0 5px;}
|
||||
#ttbm_quick_setup {padding: 50px;max-width: 850px;background-color: #FFF;margin: 100px auto;border-radius: 5px;}
|
||||
td.woo_btn_td{text-align: right !important;}
|
||||
.button.setup_save_finish,
|
||||
td.woo_btn_td .button{
|
||||
width: auto;font-size: 20px;font-weight: 500;position: relative;
|
||||
-webkit-justify-content: center;justify-content: center;
|
||||
background-image: -webkit-linear-gradient(#FF8F8E, #FF8787, #FF7B7D, #FF6369, #FF575F, #FF515A);
|
||||
background-image: -moz-linear-gradient(#FF8F8E, #FF8787, #FF7B7D, #FF6369, #FF575F, #FF515A);
|
||||
background-image: linear-gradient(#FF8F8E, #FF8787, #FF7B7D, #FF6369, #FF575F, #FF515A);
|
||||
border-radius: 5px;
|
||||
display: -webkit-inline-flex;display: inline-flex;-webkit-align-items: center;align-items: center;
|
||||
padding: 0 20px;
|
||||
color: #FFF;min-width: 170px;
|
||||
}
|
||||
.setup_save_finish_area{
|
||||
display: flex;display: -webkit-flex;-webkit-justify-content: center;justify-content: center;
|
||||
}
|
||||
table.wc_status_table td{vertical-align: middle;font-size: 16px;min-width: 150px;}
|
||||
table.wc_status_table td.woo_btn_td span{font-size: 20px; color: #10dd10;}
|
||||
/*3rd Party*/
|
||||
.welcome-tabs .field-input .CodeMirror { background: #F1F1F1;}
|
||||
.welcome-tabs .addon-list .item { display: inline-block; width: 215px; overflow: hidden; padding: 15px 20px;}
|
||||
.welcome-tabs .addon-list .thumb-wrap img { width: 100%;}
|
||||
.welcome-tabs .addon-list .addon-title { margin: 10px 0; font-size: 17px;}
|
||||
.welcome-tabs .addon-list .addon-link a { text-decoration: none;}
|
||||
div#ttbm_quick_setup .notice {
|
||||
display: none;
|
||||
}
|
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB |
|
@ -0,0 +1,245 @@
|
|||
<?php
|
||||
/*
|
||||
* @Author engr.sumonazma@gmail.com
|
||||
* Copyright: mage-people.com
|
||||
*/
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
if (!class_exists('MPWEM_Dependencies')) {
|
||||
class MPWEM_Dependencies {
|
||||
public function __construct() {
|
||||
add_action('init', array($this, 'language_load'));
|
||||
$this->load_global_file();
|
||||
$this->load_file();
|
||||
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue'), 90);
|
||||
add_action('wp_enqueue_scripts', array($this, 'frontend_enqueue'), 90);
|
||||
add_action('admin_head', array($this, 'add_admin_head'), 5);
|
||||
add_action('wp_head', array($this, 'add_frontend_head'), 5);
|
||||
}
|
||||
public function language_load(): void {
|
||||
$plugin_dir = basename(dirname(__DIR__)) . "/languages/";
|
||||
load_plugin_textdomain('mage-eventpress', false, $plugin_dir);
|
||||
}
|
||||
public function load_global_file() {
|
||||
require_once MPWEM_PLUGIN_DIR . '/inc/global/MP_Global_Function.php';
|
||||
require_once MPWEM_PLUGIN_DIR . '/inc/global/MP_Global_Style.php';
|
||||
require_once MPWEM_PLUGIN_DIR . '/inc/global/MP_Custom_Layout.php';
|
||||
//require_once MPWEM_PLUGIN_DIR . '/inc/global/MP_Custom_Slider.php';
|
||||
require_once MPWEM_PLUGIN_DIR . '/inc/global/MP_Select_Icon_image.php';
|
||||
}
|
||||
private function load_file(): void {
|
||||
require_once MPWEM_PLUGIN_DIR . '/Admin/MPWEM_Admin.php';
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-mep.php');
|
||||
require_once(dirname(__DIR__) . "/inc/mep_functions.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_tax.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_event_meta.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_event_fw_meta.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_extra_price.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_shortcode.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_user_custom_style.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_tax_meta.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_query.php");
|
||||
//require_once MPWEM_PLUGIN_DIR . '/inc/MPTBM_Function.php';
|
||||
//require_once MPTBM_PLUGIN_DIR . '/inc/MPTBM_Query.php';
|
||||
//require_once MPTBM_PLUGIN_DIR . '/inc/MPTBM_Layout.php';
|
||||
//require_once MPTBM_PLUGIN_DIR . '/Admin/MPTBM_Admin.php';
|
||||
//require_once MPTBM_PLUGIN_DIR . '/Frontend/MPTBM_Frontend.php';
|
||||
}
|
||||
public function global_enqueue() {
|
||||
wp_enqueue_script('jquery');
|
||||
wp_enqueue_script('jquery-ui-core');
|
||||
wp_enqueue_script('jquery-ui-datepicker');
|
||||
wp_enqueue_script('jquery-ui-accordion');
|
||||
wp_localize_script('jquery', 'mep_ajax', array('mep_ajaxurl' => admin_url('admin-ajax.php')));
|
||||
wp_enqueue_style('mp_jquery_ui', MPWEM_PLUGIN_URL . '/assets/helper/jquery-ui.min.css', array(), '1.13.2');
|
||||
$fontAwesome = MP_Global_Function::get_settings('general_setting_sec', 'mep_load_fontawesome_from_theme', 'no');
|
||||
if ($fontAwesome == 'no') {
|
||||
wp_enqueue_style('mp_font_awesome', '//cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/all.min.css', array(), '5.15.4');
|
||||
}
|
||||
$flatIcon = MP_Global_Function::get_settings('general_setting_sec', 'mep_load_flaticon_from_theme', 'no');
|
||||
if ($flatIcon == 'no') {
|
||||
wp_enqueue_style('mp_flat_icon', MPWEM_PLUGIN_URL . '/assets/helper/flaticon/flaticon.css');
|
||||
}
|
||||
wp_enqueue_style('mp_select_2', MPWEM_PLUGIN_URL . '/assets/helper/select_2/select2.min.css', array(), '4.0.13');
|
||||
wp_enqueue_script('mp_select_2', MPWEM_PLUGIN_URL . '/assets/helper/select_2/select2.min.js', array(), '4.0.13');
|
||||
$owlCarousel = MP_Global_Function::get_settings('carousel_setting_sec', 'mep_load_carousal_from_theme', 'no');
|
||||
if ($owlCarousel == 'no') {
|
||||
wp_enqueue_style('mp_owl_carousel', MPWEM_PLUGIN_URL . '/assets/helper/owl_carousel/owl.carousel.min.css', array(), '2.3.4');
|
||||
wp_enqueue_script('mp_owl_carousel', MPWEM_PLUGIN_URL . '/assets/helper/owl_carousel/owl.carousel.min.js', array(), '2.3.4');
|
||||
}
|
||||
if (is_admin()) {
|
||||
wp_enqueue_style('mp_plugin_global', MPWEM_PLUGIN_URL . '/assets/helper/mp_style/mp_style.css', array(), time());
|
||||
wp_enqueue_script('mp_plugin_global', MPWEM_PLUGIN_URL . '/assets/helper/mp_style/mp_script.js', array('jquery'), time(), true);
|
||||
}
|
||||
do_action('add_mpwem_common_script');
|
||||
}
|
||||
public function admin_enqueue($hook) {
|
||||
global $post;
|
||||
$this->global_enqueue();
|
||||
wp_enqueue_editor();
|
||||
//admin script
|
||||
wp_enqueue_script('jquery-ui-sortable');
|
||||
wp_enqueue_style('wp-color-picker');
|
||||
wp_enqueue_script('wp-color-picker');
|
||||
wp_enqueue_style('wp-codemirror');
|
||||
wp_enqueue_script('wp-codemirror');
|
||||
//wp_enqueue_script('jquery-ui-accordion');
|
||||
//********//
|
||||
$user_api = mep_get_option('google-map-api', 'general_setting_sec', '');
|
||||
// Load Only when the New Event Add Page Open.
|
||||
if ($hook == 'post-new.php' || $hook == 'post.php') {
|
||||
if ('mep_events' === $post->post_type) {
|
||||
wp_enqueue_script('gmap-scripts', MPWEM_PLUGIN_URL . '/assets/admin/mkb-admin.js', array('jquery', 'jquery-ui-core'), time(), true);
|
||||
}
|
||||
}
|
||||
if ($user_api) {
|
||||
wp_enqueue_script('gmap-libs', 'https://maps.googleapis.com/maps/api/js?key=' . esc_attr($user_api) . '&libraries=places&callback=initMap', array('jquery', 'gmap-scripts'), 1, true);
|
||||
}
|
||||
wp_localize_script('mep_ajax', 'mep_ajax_var', array('url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('mep-ajax-nonce')));
|
||||
//loading pick plugin
|
||||
wp_enqueue_style('mage-options-framework', MPWEM_PLUGIN_URL . '/assets/helper/pick_plugin/mage-options-framework.css');
|
||||
wp_enqueue_script('magepeople-options-framework', MPWEM_PLUGIN_URL . '/assets/helper/pick_plugin/mage-options-framework.js', array('jquery'));
|
||||
wp_localize_script('PickpluginsOptionsFramework', 'PickpluginsOptionsFramework_ajax', array('PickpluginsOptionsFramework_ajaxurl' => admin_url('admin-ajax.php')));
|
||||
wp_enqueue_script('form-field-dependency', MPWEM_PLUGIN_URL . '/assets/helper/form-field-dependency.js', array('jquery'), null, false);
|
||||
//loading modal
|
||||
wp_enqueue_style('jquery.modal.min', MPWEM_PLUGIN_URL . '/assets/helper/jquery_modal/jquery.modal.min.css', array(), 1.0);
|
||||
wp_enqueue_script('jquery.modal.min', MPWEM_PLUGIN_URL . '/assets/helper/jquery_modal/jquery.modal.min.js', array('jquery'), 1.0, true);
|
||||
//wp_enqueue_script('mp_admin_settings', MPWEM_PLUGIN_URL . '/assets/admin/mp_admin_settings.js', array('jquery'), time(), true);
|
||||
wp_enqueue_style('mp_admin_settings', MPWEM_PLUGIN_URL . '/assets/admin/mp_admin_settings.css', array(), time());
|
||||
// custom
|
||||
wp_enqueue_script('mpwem_admin', MPWEM_PLUGIN_URL . '/assets/admin/mpwem_admin.js', array('jquery'), time(), true);
|
||||
wp_enqueue_style('mpwem_admin', MPWEM_PLUGIN_URL . '/assets/admin/mpwem_admin.css', array(), time());
|
||||
do_action('add_mpwem_admin_script');
|
||||
}
|
||||
public function frontend_enqueue() {
|
||||
$this->global_enqueue();
|
||||
//wp_enqueue_script('wc-checkout');
|
||||
//wp_enqueue_script('mptbm_registration', MPWEM_PLUGIN_URL . '/assets/frontend/mptbm_registration.js', array('jquery'), time(), true);
|
||||
//wp_enqueue_style('mptbm_registration', MPWEM_PLUGIN_URL . '/assets/frontend/mptbm_registration.css', array(), time());
|
||||
//timeline
|
||||
wp_enqueue_style('mep-event-timeline-min-style', MPWEM_PLUGIN_URL . '/assets/helper/timeline/timeline.min.css', array('mep-event-style'));
|
||||
wp_enqueue_script('mep-timeline-min', MPWEM_PLUGIN_URL . '/assets/helper/timeline/timeline.min.js', array('jquery'), 1, true);
|
||||
//calender
|
||||
wp_enqueue_style('mep-calendar-min-style', MPWEM_PLUGIN_URL . '/assets/helper/calender/calendar.min.css', array());
|
||||
wp_enqueue_script('mep-calendar-scripts', MPWEM_PLUGIN_URL . '/assets/helper/calender/calendar.min.js', array('jquery', 'mep-moment-js'), 1, false);
|
||||
//
|
||||
wp_enqueue_script('mep-mixitup-min-js', 'https://cdnjs.cloudflare.com/ajax/libs/mixitup/3.3.0/mixitup.min.js', array(), '3.3.0', true);
|
||||
wp_enqueue_script('mep-countdown-js', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.countdown/2.2.0/jquery.countdown.min.js', array(), 1, true);
|
||||
wp_enqueue_script('mep-moment-js', 'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment-with-locales.min.js', array(), 1, true);
|
||||
//custom
|
||||
wp_enqueue_style('filter_pagination', MPWEM_PLUGIN_URL . '/assets/frontend/filter_pagination.css', array(), time());
|
||||
wp_enqueue_script('filter_pagination', MPWEM_PLUGIN_URL . '/assets/frontend/filter_pagination.js', array(), time(), true);
|
||||
wp_enqueue_style('mpwem_style', MPWEM_PLUGIN_URL . '/assets/frontend/mpwem_style.css', array(), time());
|
||||
wp_enqueue_script('mpwem_script', MPWEM_PLUGIN_URL . '/assets/frontend/mpwem_script.js', array('jquery'), time(), true);
|
||||
do_action('add_mpwem_frontend_script');
|
||||
}
|
||||
public function add_admin_head() {
|
||||
$this->js_constant();
|
||||
}
|
||||
public function add_frontend_head() {
|
||||
$this->js_constant();
|
||||
$this->custom_css();
|
||||
$this->event_rich_text_data();
|
||||
}
|
||||
public function js_constant() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
let mp_ajax_url = "<?php echo admin_url('admin-ajax.php'); ?>";
|
||||
let mp_currency_symbol = "<?php echo get_woocommerce_currency_symbol(); ?>";
|
||||
let mp_currency_position = "<?php echo get_option('woocommerce_currency_pos'); ?>";
|
||||
let mp_currency_decimal = "<?php echo wc_get_price_decimal_separator(); ?>";
|
||||
let mp_currency_thousands_separator = "<?php echo wc_get_price_thousand_separator(); ?>";
|
||||
let mp_num_of_decimal = "<?php echo get_option('woocommerce_price_num_decimals', 2); ?>";
|
||||
let mp_empty_image_url = "<?php echo esc_attr(MPWEM_PLUGIN_URL . '/assets/helper/images/no_image.png'); ?>";
|
||||
let mp_date_format = "'D d M , yy'";
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
public function custom_css() {
|
||||
$custom_css = MP_Global_Function::get_settings('mep_settings_custom_css', 'mep_custom_css');
|
||||
$not_available_hide = MP_Global_Function::get_settings('general_setting_sec', 'mep_hide_not_available_event_from_list_page', 'no');
|
||||
ob_start();
|
||||
?>
|
||||
<style>
|
||||
<?php echo $custom_css; ?>
|
||||
<?php if($not_available_hide == 'yes'){ ?>
|
||||
.event-no-availabe-seat { display: none !important; }
|
||||
<?php } ?>
|
||||
</style>
|
||||
<?php
|
||||
echo ob_get_clean();
|
||||
}
|
||||
//This the function which will create the Rich Text Schema For each event into the <head></head> section.
|
||||
public function event_rich_text_data() {
|
||||
global $post;
|
||||
if (is_single()) {
|
||||
$event_id = $post->ID;
|
||||
if ($event_id && get_post_type($event_id) == 'mep_events') {
|
||||
$event_name = get_the_title($event_id);
|
||||
$event_start_date = get_post_meta($post->ID, 'event_start_datetime', true) ? wp_date('Y-m-d H:i:s T', strtotime(get_post_meta($post->ID, 'event_start_datetime', true))) : '';
|
||||
$event_end_date = get_post_meta($post->ID, 'event_end_datetime', true) ? get_post_meta($post->ID, 'event_end_datetime', true) : '';
|
||||
$event_rt_status = get_post_meta($post->ID, 'mep_rt_event_status', true) ? get_post_meta($post->ID, 'mep_rt_event_status', true) : 'EventRescheduled';
|
||||
$event_rt_atdnce_mode = get_post_meta($post->ID, 'mep_rt_event_attandence_mode', true) ? get_post_meta($post->ID, 'mep_rt_event_attandence_mode', true) : 'OfflineEventAttendanceMode';
|
||||
$event_rt_prv_date = get_post_meta($post->ID, 'mep_rt_event_prvdate', true) ? get_post_meta($post->ID, 'mep_rt_event_prvdate', true) : $event_start_date;
|
||||
$terms = get_the_terms($event_id, 'mep_org');
|
||||
$org_name = is_array($terms) && sizeof($terms) > 0 ? $terms[0]->name : 'No Performer';
|
||||
$rt_status = get_post_meta($event_id, 'mep_rich_text_status', true) ? get_post_meta($event_id, 'mep_rich_text_status', true) : 'enable';
|
||||
if ($rt_status == 'enable') {
|
||||
ob_start();
|
||||
?>
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context" : "https://schema.org",
|
||||
"@type" : "Event",
|
||||
"name" : "<?php echo esc_attr($event_name); ?>",
|
||||
"startDate" : "<?php echo esc_attr($event_start_date); ?>",
|
||||
"endDate" : "<?php echo esc_attr($event_end_date); ?>",
|
||||
"offers": {
|
||||
"@type" : "Offer",
|
||||
"url" : "<?php echo get_the_permalink($event_id); ?>",
|
||||
"price" : "<?php echo strip_tags(mep_event_list_number_price($event_id)); ?>",
|
||||
"priceCurrency" : "<?php echo get_woocommerce_currency(); ?>",
|
||||
"availability" : "https://schema.org/InStock",
|
||||
"validFrom" : "<?php echo esc_attr($event_end_date); ?>"
|
||||
},
|
||||
"organizer": {
|
||||
"@type" : "Organization",
|
||||
"name" : "<?php echo esc_attr($org_name); ?>",
|
||||
"url" : "<?php echo get_the_permalink($event_id); ?>"
|
||||
},
|
||||
"eventStatus" : "https://schema.org/<?php echo esc_attr($event_rt_status); ?>",
|
||||
"eventAttendanceMode" : "https://schema.org/<?php echo esc_attr($event_rt_atdnce_mode); ?>",
|
||||
"previousStartDate" : "<?php echo esc_attr($event_rt_prv_date); ?>",
|
||||
"location" : {
|
||||
"@type" : "Place",
|
||||
"name" : "<?php echo mep_get_event_location($event_id); ?>",
|
||||
"address" : {
|
||||
"@type" : "PostalAddress",
|
||||
"streetAddress" : "<?php echo mep_get_event_location_street($event_id); ?>",
|
||||
"addressLocality": "<?php echo mep_get_event_location_city($event_id); ?>",
|
||||
"postalCode" : "<?php echo mep_get_event_location_postcode($event_id) ?>",
|
||||
"addressRegion" : "<?php echo mep_get_event_location_state($event_id) ?>",
|
||||
"addressCountry": "<?php echo mep_get_event_location_country($event_id) ?>"
|
||||
}
|
||||
},
|
||||
"image": [
|
||||
"<?php echo get_the_post_thumbnail_url($event_id, 'full'); ?>"
|
||||
],
|
||||
"description": "<?php echo strip_tags(mep_string_sanitize(get_the_excerpt($event_id))); ?>",
|
||||
"performer": {
|
||||
"@type" : "PerformingGroup",
|
||||
"name" : "<?php echo esc_attr($org_name); ?>"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
echo ob_get_clean();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
new MPWEM_Dependencies();
|
||||
}
|
||||
|
|
@ -1,673 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MagePeople Settings API wrapper class
|
||||
*/
|
||||
if ( !class_exists( 'MAGE_Setting_API' ) ):
|
||||
class MAGE_Setting_API {
|
||||
|
||||
/**
|
||||
* settings sections array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $settings_sections = array();
|
||||
|
||||
/**
|
||||
* Settings fields array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $settings_fields = array();
|
||||
|
||||
public function __construct() {
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue scripts and styles
|
||||
*/
|
||||
function admin_enqueue_scripts() {
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_script( 'wp-color-picker' );
|
||||
wp_enqueue_script( 'jquery' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set settings sections
|
||||
*
|
||||
* @param array $sections setting sections array
|
||||
*/
|
||||
function set_sections( $sections ) {
|
||||
$this->settings_sections = $sections;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a single section
|
||||
*
|
||||
* @param array $section
|
||||
*/
|
||||
function add_section( $section ) {
|
||||
$this->settings_sections[] = $section;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set settings fields
|
||||
*
|
||||
* @param array $fields settings fields array
|
||||
*/
|
||||
function set_fields( $fields ) {
|
||||
$this->settings_fields = $fields;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
function add_field( $section, $field ) {
|
||||
$defaults = array(
|
||||
'name' => '',
|
||||
'label' => '',
|
||||
'desc' => '',
|
||||
'type' => 'text'
|
||||
);
|
||||
|
||||
$arg = wp_parse_args( $field, $defaults );
|
||||
$this->settings_fields[$section][] = $arg;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize and registers the settings sections and fileds to WordPress
|
||||
*
|
||||
* Usually this should be called at `admin_init` hook.
|
||||
*
|
||||
* This function gets the initiated settings sections and fields. Then
|
||||
* registers them to WordPress and ready for use.
|
||||
*/
|
||||
function admin_init() {
|
||||
//register settings sections
|
||||
foreach ( $this->settings_sections as $section ) {
|
||||
if ( false == get_option( $section['id'] ) ) {
|
||||
add_option( $section['id'] );
|
||||
}
|
||||
|
||||
if ( isset($section['desc']) && !empty($section['desc']) ) {
|
||||
$section['desc'] = '<div class="inside">' . $section['desc'] . '</div>';
|
||||
$callback = function() use ( $section ) {
|
||||
echo str_replace( '"', '\"', esc_html($section['desc']) );
|
||||
};
|
||||
} else if ( isset( $section['callback'] ) ) {
|
||||
$callback = $section['callback'];
|
||||
} else {
|
||||
$callback = null;
|
||||
}
|
||||
|
||||
add_settings_section( $section['id'], $section['title'], $callback, $section['id'] );
|
||||
}
|
||||
|
||||
//register settings fields
|
||||
foreach ( $this->settings_fields as $section => $field ) {
|
||||
foreach ( $field as $option ) {
|
||||
|
||||
$name = $option['name'];
|
||||
$type = isset( $option['type'] ) ? $option['type'] : 'text';
|
||||
$label = isset( $option['label'] ) ? $option['label'] : '';
|
||||
$callback = isset( $option['callback'] ) ? $option['callback'] : array( $this, 'callback_' . $type );
|
||||
|
||||
$args = array(
|
||||
'id' => $name,
|
||||
'class' => isset( $option['class'] ) ? $option['class'] : $name,
|
||||
'label_for' => "{$section}[{$name}]",
|
||||
'desc' => isset( $option['desc'] ) ? $option['desc'] : '',
|
||||
'name' => $label,
|
||||
'section' => $section,
|
||||
'size' => isset( $option['size'] ) ? $option['size'] : null,
|
||||
'options' => isset( $option['options'] ) ? $option['options'] : '',
|
||||
'std' => isset( $option['default'] ) ? $option['default'] : '',
|
||||
'sanitize_callback' => isset( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : '',
|
||||
'type' => $type,
|
||||
'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : '',
|
||||
'min' => isset( $option['min'] ) ? $option['min'] : '',
|
||||
'max' => isset( $option['max'] ) ? $option['max'] : '',
|
||||
'step' => isset( $option['step'] ) ? $option['step'] : '',
|
||||
);
|
||||
|
||||
add_settings_field( "{$section}[{$name}]", $label, $callback, $section, $section, $args );
|
||||
}
|
||||
}
|
||||
|
||||
// creates our settings in the options table
|
||||
foreach ( $this->settings_sections as $section ) {
|
||||
register_setting( $section['id'], $section['id'], array( $this, 'sanitize_options' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get field description for display
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
public function get_field_description( $args ) {
|
||||
if ( ! empty( $args['desc'] ) ) {
|
||||
$desc = sprintf( '<p class="description">%s</p>', $args['desc'] );
|
||||
} else {
|
||||
$desc = '';
|
||||
}
|
||||
|
||||
return $desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a text field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_text( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$type = isset( $args['type'] ) ? $args['type'] : 'text';
|
||||
$placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
|
||||
|
||||
$html = sprintf( '<input type="%1$s" class="%2$s-text" id="%3$s[%4$s]" name="%3$s[%4$s]" value="%5$s"%6$s/>', $type, $size, $args['section'], $args['id'], $value, $placeholder );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a url field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_url( $args ) {
|
||||
$this->callback_text( $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a number field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_number( $args ) {
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$type = isset( $args['type'] ) ? $args['type'] : 'number';
|
||||
$placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
|
||||
$min = ( $args['min'] == '' ) ? '' : ' min="' . $args['min'] . '"';
|
||||
$max = ( $args['max'] == '' ) ? '' : ' max="' . $args['max'] . '"';
|
||||
$step = ( $args['step'] == '' ) ? '' : ' step="' . $args['step'] . '"';
|
||||
|
||||
$html = sprintf( '<input type="%1$s" class="%2$s-number" id="%3$s[%4$s]" name="%3$s[%4$s]" value="%5$s"%6$s%7$s%8$s%9$s/>', $type, $size, $args['section'], $args['id'], $value, $placeholder, $min, $max, $step );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a checkbox for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_checkbox( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
|
||||
$html = '<fieldset>';
|
||||
$html .= sprintf( '<label for="wpuf-%1$s[%2$s]">', $args['section'], $args['id'] );
|
||||
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="off" />', $args['section'], $args['id'] );
|
||||
$html .= sprintf( '<input type="checkbox" class="checkbox" id="wpuf-%1$s[%2$s]" name="%1$s[%2$s]" value="on" %3$s />', $args['section'], $args['id'], checked( $value, 'on', false ) );
|
||||
$html .= sprintf( '%1$s</label>', $args['desc'] );
|
||||
$html .= '</fieldset>';
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a multicheckbox for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_multicheck( $args ) {
|
||||
|
||||
$value = $this->get_option( $args['id'], $args['section'], $args['std'] );
|
||||
$html = '<fieldset>';
|
||||
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="" />', $args['section'], $args['id'] );
|
||||
foreach ( $args['options'] as $key => $label ) {
|
||||
$checked = isset( $value[$key] ) ? $value[$key] : '0';
|
||||
$html .= sprintf( '<label for="wpuf-%1$s[%2$s][%3$s]">', $args['section'], $args['id'], $key );
|
||||
$html .= sprintf( '<input type="checkbox" class="checkbox" id="wpuf-%1$s[%2$s][%3$s]" name="%1$s[%2$s][%3$s]" value="%3$s" %4$s />', $args['section'], $args['id'], $key, checked( $checked, $key, false ) );
|
||||
$html .= sprintf( '%1$s</label><br>', $label );
|
||||
}
|
||||
|
||||
$html .= $this->get_field_description( $args );
|
||||
$html .= '</fieldset>';
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a radio button for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_radio( $args ) {
|
||||
|
||||
$value = $this->get_option( $args['id'], $args['section'], $args['std'] );
|
||||
$html = '<fieldset>';
|
||||
|
||||
foreach ( $args['options'] as $key => $label ) {
|
||||
$html .= sprintf( '<label for="wpuf-%1$s[%2$s][%3$s]">', $args['section'], $args['id'], $key );
|
||||
$html .= sprintf( '<input type="radio" class="radio" id="wpuf-%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s" %4$s />', $args['section'], $args['id'], $key, checked( $value, $key, false ) );
|
||||
$html .= sprintf( '%1$s</label><br>', $label );
|
||||
}
|
||||
|
||||
$html .= $this->get_field_description( $args );
|
||||
$html .= '</fieldset>';
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a selectbox for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_select( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$html = sprintf( '<select class="%1$s %3$s" name="%2$s[%3$s]" id="%2$s[%3$s]">', $size, $args['section'], $args['id'] );
|
||||
|
||||
foreach ( $args['options'] as $key => $label ) {
|
||||
$html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $value, $key, false ), $label );
|
||||
}
|
||||
|
||||
$html .= sprintf( '</select>' );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a textarea for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_textarea( $args ) {
|
||||
|
||||
$value = esc_textarea( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="'.$args['placeholder'].'"';
|
||||
|
||||
$html = sprintf( '<textarea rows="5" cols="55" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]"%4$s>%5$s</textarea>', $size, $args['section'], $args['id'], $placeholder, $value );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the html for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
* @return string
|
||||
*/
|
||||
function callback_html( $args ) {
|
||||
echo mep_esc_html($this->get_field_description( $args ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a rich text textarea for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_wysiwyg( $args ) {
|
||||
|
||||
$value = $this->get_option( $args['id'], $args['section'], $args['std'] );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : '500px';
|
||||
|
||||
echo '<div style="max-width: ' . $size . ';">';
|
||||
|
||||
$editor_settings = array(
|
||||
'teeny' => true,
|
||||
'textarea_name' => $args['section'] . '[' . $args['id'] . ']',
|
||||
'textarea_rows' => 10
|
||||
);
|
||||
|
||||
if ( isset( $args['options'] ) && is_array( $args['options'] ) ) {
|
||||
$editor_settings = array_merge( $editor_settings, $args['options'] );
|
||||
}
|
||||
|
||||
wp_editor( $value, $args['section'] . '-' . $args['id'], $editor_settings );
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo wp_kses_post($this->get_field_description( $args ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a file upload field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_file( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$id = $args['section'] . '[' . $args['id'] . ']';
|
||||
$label = isset( $args['options']['button_label'] ) ? $args['options']['button_label'] : __( 'Choose File' );
|
||||
|
||||
$html = sprintf( '<input type="text" class="%1$s-text wpsa-url" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s"/>', $size, $args['section'], $args['id'], $value );
|
||||
$html .= '<input type="button" class="button wpsa-browse" value="' . $label . '" />';
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a password field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_password( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
|
||||
$html = sprintf( '<input type="password" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s"/>', $size, $args['section'], $args['id'], $value );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a color picker field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_color( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
|
||||
$html = sprintf( '<input type="text" class="%1$s-text wp-color-picker-field" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s" data-default-color="%5$s" />', $size, $args['section'], $args['id'], $value, $args['std'] );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo mep_esc_html($html);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Displays a select box for creating the pages select box
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_pages( $args ) {
|
||||
|
||||
$dropdown_args = array(
|
||||
'selected' => esc_attr($this->get_option($args['id'], $args['section'], $args['std'] ) ),
|
||||
'name' => $args['section'] . '[' . $args['id'] . ']',
|
||||
'id' => $args['section'] . '[' . $args['id'] . ']',
|
||||
'echo' => 0
|
||||
);
|
||||
$html = wp_dropdown_pages( $dropdown_args );
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a icon library
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_iconlib( $args ) {
|
||||
$output = '';
|
||||
$desc = $this->get_field_description( $args );
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$id = esc_attr($args['id']);
|
||||
$type = 'hidden';
|
||||
$class = 'mep_global_settings_icon';
|
||||
if(! empty($value)){
|
||||
$output .= '<div class="mep_global_settings_icon_preview" data-key="'.$id.'">';
|
||||
$output .= '<i class="'.$value.'"></i>';
|
||||
$output .= '</div>';
|
||||
}
|
||||
$output .= '<a class="mep_global_icon_lib_btn" data-key="'.$id.'">'.esc_html__('Icon Library','mage-eventpress').'</a>';
|
||||
|
||||
$output .= sprintf( '<input type="%1$s" class="%2$s" id="%4$s" name="%3$s[%4$s]" value="%5$s" data-key="'.$id.'"/>', $type, $class, $args['section'], $args['id'], $value);
|
||||
|
||||
$output .= $desc;
|
||||
echo $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize callback for Settings API
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function sanitize_options( $options ) {
|
||||
|
||||
if ( !$options ) {
|
||||
return $options;
|
||||
}
|
||||
|
||||
foreach( $options as $option_slug => $option_value ) {
|
||||
$sanitize_callback = $this->get_sanitize_callback( $option_slug );
|
||||
|
||||
// If callback is set, call it
|
||||
if ( $sanitize_callback ) {
|
||||
$options[ $option_slug ] = call_user_func( $sanitize_callback, $option_value );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sanitization callback for given option slug
|
||||
*
|
||||
* @param string $slug option slug
|
||||
*
|
||||
* @return mixed string or bool false
|
||||
*/
|
||||
function get_sanitize_callback( $slug = '' ) {
|
||||
if ( empty( $slug ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Iterate over registered fields and see if we can find proper callback
|
||||
foreach( $this->settings_fields as $section => $options ) {
|
||||
foreach ( $options as $option ) {
|
||||
if ( $option['name'] != $slug ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Return the callback name
|
||||
return isset( $option['sanitize_callback'] ) && is_callable( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of a settings field
|
||||
*
|
||||
* @param string $option settings field name
|
||||
* @param string $section the section name this field belongs to
|
||||
* @param string $default default text if it's not found
|
||||
* @return string
|
||||
*/
|
||||
function get_option( $option, $section, $default = '' ) {
|
||||
|
||||
$options = get_option( $section );
|
||||
|
||||
if ( isset( $options[$option] ) ) {
|
||||
return $options[$option];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show navigations as tab
|
||||
*
|
||||
* Shows all the settings section labels as tab
|
||||
*/
|
||||
function show_navigation() {
|
||||
$html = '<h2 class="nav-tab-wrapper">';
|
||||
$count = count( $this->settings_sections );
|
||||
// don't show the navigation if only one section exists
|
||||
if ( $count === 1 ) {
|
||||
return;
|
||||
}
|
||||
foreach ( $this->settings_sections as $tab ) {
|
||||
$html .= sprintf( '<a href="#%1$s" class="nav-tab" id="%1$s-tab">%2$s</a>', $tab['id'], $tab['title'] );
|
||||
}
|
||||
$html .= '</h2>';
|
||||
|
||||
echo mep_esc_html($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the section settings forms
|
||||
*
|
||||
* This function displays every sections in a different form
|
||||
*/
|
||||
function show_forms() {
|
||||
?>
|
||||
<div class="metabox-holder">
|
||||
<?php foreach ( $this->settings_sections as $form ) { ?>
|
||||
<div id="<?php echo esc_attr($form['id']); ?>" class="group" style="display: none;">
|
||||
<form method="post" action="options.php">
|
||||
<?php
|
||||
do_action( 'wsa_form_top_' . $form['id'], $form );
|
||||
settings_fields( $form['id'] );
|
||||
do_settings_sections( $form['id'] );
|
||||
do_action( 'wsa_form_bottom_' . $form['id'], $form );
|
||||
if ( isset( $this->settings_fields[ $form['id'] ] ) ):
|
||||
?>
|
||||
<div style="padding-left: 10px">
|
||||
<?php submit_button(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
$this->script();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tabbable JavaScript codes & Initiate Color Picker
|
||||
*
|
||||
* This code uses localstorage for displaying active tabs
|
||||
*/
|
||||
function script() {
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
//Initiate Color Picker
|
||||
$('.wp-color-picker-field').wpColorPicker();
|
||||
|
||||
// Switches option sections
|
||||
$('.group').hide();
|
||||
var activetab = '';
|
||||
if (typeof(localStorage) != 'undefined' ) {
|
||||
activetab = localStorage.getItem("activetab");
|
||||
}
|
||||
|
||||
//if url has section id as hash then set it as active or override the current local storage value
|
||||
if(window.location.hash){
|
||||
activetab = window.location.hash;
|
||||
if (typeof(localStorage) != 'undefined' ) {
|
||||
localStorage.setItem("activetab", activetab);
|
||||
}
|
||||
}
|
||||
|
||||
if (activetab != '' && $(activetab).length ) {
|
||||
$(activetab).fadeIn();
|
||||
} else {
|
||||
$('.group:first').fadeIn();
|
||||
}
|
||||
$('.group .collapsed').each(function(){
|
||||
$(this).find('input:checked').parent().parent().parent().nextAll().each(
|
||||
function(){
|
||||
if ($(this).hasClass('last')) {
|
||||
$(this).removeClass('hidden');
|
||||
return false;
|
||||
}
|
||||
$(this).filter('.hidden').removeClass('hidden');
|
||||
});
|
||||
});
|
||||
|
||||
if (activetab != '' && $(activetab + '-tab').length ) {
|
||||
$(activetab + '-tab').addClass('nav-tab-active');
|
||||
}
|
||||
else {
|
||||
$('.nav-tab-wrapper a:first').addClass('nav-tab-active');
|
||||
}
|
||||
$('.nav-tab-wrapper a').click(function(evt) {
|
||||
$('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
||||
$(this).addClass('nav-tab-active').blur();
|
||||
var clicked_group = $(this).attr('href');
|
||||
if (typeof(localStorage) != 'undefined' ) {
|
||||
localStorage.setItem("activetab", $(this).attr('href'));
|
||||
}
|
||||
$('.group').hide();
|
||||
$(clicked_group).fadeIn();
|
||||
evt.preventDefault();
|
||||
});
|
||||
|
||||
$('.wpsa-browse').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var self = $(this);
|
||||
|
||||
// Create the media frame.
|
||||
var file_frame = wp.media.frames.file_frame = wp.media({
|
||||
title: self.data('uploader_title'),
|
||||
button: {
|
||||
text: self.data('uploader_button_text'),
|
||||
},
|
||||
multiple: false
|
||||
});
|
||||
|
||||
file_frame.on('select', function () {
|
||||
attachment = file_frame.state().get('selection').first().toJSON();
|
||||
self.prev('.wpsa-url').val(attachment.url).change();
|
||||
});
|
||||
|
||||
// Finally, open the modal
|
||||
file_frame.open();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$this->_style_fix();
|
||||
}
|
||||
|
||||
function _style_fix() {
|
||||
global $wp_version;
|
||||
|
||||
if (version_compare($wp_version, '3.8', '<=')):
|
||||
?>
|
||||
<style type="text/css">
|
||||
/** WordPress 3.8 Fix **/
|
||||
.form-table th { padding: 20px 10px; }
|
||||
#wpbody-content .metabox-holder { padding-top: 5px; }
|
||||
</style>
|
||||
<?php
|
||||
endif;
|
||||
}
|
||||
|
||||
}
|
||||
endif;
|
|
@ -0,0 +1,190 @@
|
|||
<?php
|
||||
/*
|
||||
* @Author engr.sumonazma@gmail.com
|
||||
* Copyright: mage-people.com
|
||||
*/
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
if (!class_exists('MP_Custom_Layout')) {
|
||||
class MP_Custom_Layout {
|
||||
public function __construct() {
|
||||
add_action('add_mp_hidden_table', array($this, 'hidden_table'), 10, 2);
|
||||
add_action('add_mp_pagination_section', array($this, 'pagination'), 10, 3);
|
||||
}
|
||||
public function hidden_table($hook_name, $data = array()) {
|
||||
?>
|
||||
<div class="mp_hidden_content">
|
||||
<table>
|
||||
<tbody class="mp_hidden_item">
|
||||
<?php do_action($hook_name, $data); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
public function pagination($params, $total_item, $active_page = 0) {
|
||||
ob_start();
|
||||
$per_page = $params['show'] > 1 ? $params['show'] : $total_item;
|
||||
?>
|
||||
<input type="hidden" name="pagination_per_page" value="<?php echo esc_attr($per_page); ?>"/>
|
||||
<input type="hidden" name="pagination_style" value="<?php echo esc_attr($params['pagination-style']); ?>"/>
|
||||
<input type="hidden" name="mp_total_item" value="<?php echo esc_attr($total_item); ?>"/>
|
||||
<?php if ($total_item > $per_page) { ?>
|
||||
<div class="allCenter pagination_area" data-placeholder>
|
||||
<?php
|
||||
if ($params['pagination-style'] == 'load_more') {
|
||||
?>
|
||||
<button type="button" class="_mpBtn_xs_min_200 pagination_load_more" data-load-more="0">
|
||||
<?php esc_html_e('Load More', 'mage-eventpress'); ?>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$page_mod = $total_item % $per_page;
|
||||
$total_page = (int)($total_item / $per_page) + ($page_mod > 0 ? 1 : 0);
|
||||
?>
|
||||
<div class="buttonGroup">
|
||||
<?php if ($total_page > 2) { ?>
|
||||
<button class="_mpBtn_xs page_prev" type="button" title="<?php esc_html_e('GoTO Previous Page', 'mage-eventpress'); ?>" disabled>
|
||||
<span class="fas fa-chevron-left mp_zero"></span>
|
||||
</button>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($total_page > 5) { ?>
|
||||
<button class="_mpBtn_xs ellipse_left" type="button" disabled>
|
||||
<span class="fas fa-ellipsis-h mp_zero"></span>
|
||||
</button>
|
||||
<?php } ?>
|
||||
|
||||
<?php for ($i = 0; $i < $total_page; $i++) { ?>
|
||||
<button class="_mpBtn_xs <?php echo esc_html($i) == $active_page ? 'active_pagination' : ''; ?>" type="button" data-pagination="<?php echo esc_html($i); ?>"><?php echo esc_html($i + 1); ?></button>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($total_page > 5) { ?>
|
||||
<button class="_mpBtn_xs ellipse_right" type="button" disabled>
|
||||
<span class="fas fa-ellipsis-h mp_zero"></span>
|
||||
</button>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($total_page > 2) { ?>
|
||||
<button class="_mpBtn_xs page_next" type="button" title="<?php esc_html_e('GoTO Next Page', 'mage-eventpress'); ?>">
|
||||
<span class="fas fa-chevron-right mp_zero"></span>
|
||||
</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
echo ob_get_clean();
|
||||
}
|
||||
/*****************************/
|
||||
public static function switch_button($name, $checked = '') {
|
||||
?>
|
||||
<label class="roundSwitchLabel">
|
||||
<input type="checkbox" name="<?php echo esc_attr($name); ?>" <?php echo esc_attr($checked); ?>>
|
||||
<span class="roundSwitch" data-collapse-target="#<?php echo esc_attr($name); ?>"></span>
|
||||
</label>
|
||||
<?php
|
||||
}
|
||||
public static function popup_button($target_popup_id, $text) {
|
||||
?>
|
||||
<button type="button" class="_dButton_bgBlue" data-target-popup="<?php echo esc_attr($target_popup_id); ?>">
|
||||
<span class="fas fa-plus-square"></span>
|
||||
<?php echo esc_html($text); ?>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
public static function popup_button_xs($target_popup_id, $text) {
|
||||
?>
|
||||
<button type="button" class="_dButton_xs_bgBlue" data-target-popup="<?php echo esc_attr($target_popup_id); ?>">
|
||||
<span class="fas fa-plus-square"></span>
|
||||
<?php echo esc_html($text); ?>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
/*****************************/
|
||||
public static function add_new_button($button_text, $class = 'mp_add_item', $button_class = '_themeButton_xs_mT_xs', $icon_class = 'fas fa-plus-square') {
|
||||
?>
|
||||
<button class="<?php echo esc_attr($button_class . ' ' . $class); ?>" type="button">
|
||||
<span class="<?php echo esc_attr($icon_class); ?>"></span>
|
||||
<span class="mL_xs"><?php echo MP_Global_Function::esc_html($button_text); ?></span>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
public static function move_remove_button() {
|
||||
?>
|
||||
<div class="allCenter">
|
||||
<div class="buttonGroup max_100">
|
||||
<?php
|
||||
self::remove_button();
|
||||
self::move_button();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
public static function remove_button() {
|
||||
?>
|
||||
<button class="_warningButton_xs mp_item_remove" type="button">
|
||||
<span class="fas fa-trash-alt mp_zero"></span>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
public static function move_button() {
|
||||
?>
|
||||
<div class="_mpBtn_navy_blueButton_xs mp_sortable_button" type="">
|
||||
<span class="fas fa-expand-arrows-alt mp_zero"></span>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
/*****************************/
|
||||
public static function load_more_text($text = '', $length = 150) {
|
||||
$text_length = strlen($text);
|
||||
if ($text && $text_length > $length) {
|
||||
?>
|
||||
<div class="mp_load_more_text_area">
|
||||
<span data-read-close><?php echo esc_html(substr($text, 0, $length)); ?> ....</span>
|
||||
<span data-read-open class="dNone"><?php echo esc_html($text); ?></span>
|
||||
<div data-read data-open-text="<?php esc_attr_e('Load More', 'mage-eventpress'); ?>" data-close-text="<?php esc_attr_e('Less More', 'mage-eventpress'); ?>">
|
||||
<span data-text><?php esc_html_e('Load More', 'mage-eventpress'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
?>
|
||||
<span><?php echo esc_html($text); ?></span>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
/*****************************/
|
||||
public static function qty_input($input_name, $price, $available_seat = 1, $default_qty = 0, $min_qty = 0, $max_qty = '') {
|
||||
$min_qty = max($default_qty, $min_qty);
|
||||
if ($available_seat > $min_qty) {
|
||||
?>
|
||||
<div class="groupContent qtyIncDec">
|
||||
<div class="decQty addonGroupContent">
|
||||
<span class="fas fa-minus"></span>
|
||||
</div>
|
||||
<label>
|
||||
<input type="text"
|
||||
class="formControl inputIncDec mp_number_validation"
|
||||
data-price="<?php echo esc_attr($price); ?>"
|
||||
name="<?php echo esc_attr($input_name); ?>"
|
||||
value="<?php echo esc_attr(max(0, $default_qty)); ?>"
|
||||
min="<?php echo esc_attr($min_qty); ?>"
|
||||
max="<?php echo esc_attr($max_qty > 0 ? $max_qty : $available_seat); ?>"
|
||||
/>
|
||||
</label>
|
||||
<div class="incQty addonGroupContent">
|
||||
<span class="fas fa-plus"></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
new MP_Custom_Layout();
|
||||
}
|
|
@ -0,0 +1,478 @@
|
|||
<?php
|
||||
/*
|
||||
* @Author engr.sumonazma@gmail.com
|
||||
* Copyright: mage-people.com
|
||||
*/
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
if (!class_exists('MP_Global_Function')) {
|
||||
class MP_Global_Function {
|
||||
public function __construct() {
|
||||
add_action('mp_load_date_picker_js', [$this, 'date_picker_js'], 10, 2);
|
||||
}
|
||||
public static function query_post_type($post_type, $show = -1, $page = 1): WP_Query {
|
||||
$args = array(
|
||||
'post_type' => $post_type,
|
||||
'posts_per_page' => $show,
|
||||
'paged' => $page,
|
||||
'post_status' => 'publish'
|
||||
);
|
||||
return new WP_Query($args);
|
||||
}
|
||||
public static function get_all_post_id($post_type, $show = -1, $page = 1): array {
|
||||
return get_posts(array(
|
||||
'fields' => 'ids',
|
||||
'post_type' => $post_type,
|
||||
'posts_per_page' => $show,
|
||||
'paged' => $page,
|
||||
'post_status' => 'publish'
|
||||
));
|
||||
}
|
||||
public static function get_taxonomy($name) {
|
||||
return get_terms(array('taxonomy' => $name, 'hide_empty' => false));
|
||||
}
|
||||
public static function get_post_info($post_id, $key, $default = '') {
|
||||
$data = get_post_meta($post_id, $key, true) ?: $default;
|
||||
return self::data_sanitize($data);
|
||||
}
|
||||
public static function get_submit_info($key, $default = '') {
|
||||
return self::data_sanitize($_POST[$key] ?? $default);
|
||||
}
|
||||
public static function data_sanitize($data) {
|
||||
$data = maybe_unserialize($data);
|
||||
if (is_string($data)) {
|
||||
$data = maybe_unserialize($data);
|
||||
if (is_array($data)) {
|
||||
$data = self::data_sanitize($data);
|
||||
}
|
||||
else {
|
||||
$data = sanitize_text_field(stripslashes(strip_tags($data)));
|
||||
}
|
||||
}
|
||||
elseif (is_array($data)) {
|
||||
foreach ($data as &$value) {
|
||||
if (is_array($value)) {
|
||||
$value = self::data_sanitize($value);
|
||||
}
|
||||
else {
|
||||
$value = sanitize_text_field(stripslashes(strip_tags($value)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
//**************Date related*********************//
|
||||
public static function date_picker_format($option, $key = 'date_format'): string {
|
||||
$format = MP_Global_Function::get_settings($option, $key, 'D d M , yy');
|
||||
$date_format = 'Y-m-d';
|
||||
$date_format = $format == 'yy/mm/dd' ? 'Y/m/d' : $date_format;
|
||||
$date_format = $format == 'yy-dd-mm' ? 'Y-d-m' : $date_format;
|
||||
$date_format = $format == 'yy/dd/mm' ? 'Y/d/m' : $date_format;
|
||||
$date_format = $format == 'dd-mm-yy' ? 'd-m-Y' : $date_format;
|
||||
$date_format = $format == 'dd/mm/yy' ? 'd/m/Y' : $date_format;
|
||||
$date_format = $format == 'mm-dd-yy' ? 'm-d-Y' : $date_format;
|
||||
$date_format = $format == 'mm/dd/yy' ? 'm/d/Y' : $date_format;
|
||||
$date_format = $format == 'd M , yy' ? 'j M , Y' : $date_format;
|
||||
$date_format = $format == 'D d M , yy' ? 'D j M , Y' : $date_format;
|
||||
$date_format = $format == 'M d , yy' ? 'M j, Y' : $date_format;
|
||||
return $format == 'D M d , yy' ? 'D M j, Y' : $date_format;
|
||||
}
|
||||
public function date_picker_js($selector, $dates) {
|
||||
$start_date = $dates[0];
|
||||
$start_year = date('Y', strtotime($start_date));
|
||||
$start_month = (date('n', strtotime($start_date)) - 1);
|
||||
$start_day = date('j', strtotime($start_date));
|
||||
$end_date = end($dates);
|
||||
$end_year = date('Y', strtotime($end_date));
|
||||
$end_month = (date('n', strtotime($end_date)) - 1);
|
||||
$end_day = date('j', strtotime($end_date));
|
||||
$all_date = [];
|
||||
foreach ($dates as $date) {
|
||||
$all_date[] = '"' . date('j-n-Y', strtotime($date)) . '"';
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function () {
|
||||
jQuery("<?php echo esc_attr($selector); ?>").datepicker({
|
||||
dateFormat: mp_date_format,
|
||||
minDate: new Date(<?php echo esc_attr($start_year); ?>, <?php echo esc_attr($start_month); ?>, <?php echo esc_attr($start_day); ?>),
|
||||
maxDate: new Date(<?php echo esc_attr($end_year); ?>, <?php echo esc_attr($end_month); ?>, <?php echo esc_attr($end_day); ?>),
|
||||
autoSize: true,
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
beforeShowDay: WorkingDates,
|
||||
onSelect: function (dateString, data) {
|
||||
let date = data.selectedYear + '-' + ('0' + (parseInt(data.selectedMonth) + 1)).slice(-2) + '-' + data.selectedDay;
|
||||
jQuery(this).closest('label').find('input[type="hidden"]').val(date).trigger('change');
|
||||
}
|
||||
});
|
||||
function WorkingDates(date) {
|
||||
let availableDates = [<?php echo implode(',', $all_date); ?>];
|
||||
let dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
|
||||
if (jQuery.inArray(dmy, availableDates) !== -1) {
|
||||
return [true, "", "Available"];
|
||||
} else {
|
||||
return [false, "", "unAvailable"];
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
public static function date_format($date, $format = 'date') {
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
$wp_settings = $date_format . ' ' . $time_format;
|
||||
$timezone = wp_timezone_string();
|
||||
$timestamp = strtotime($date . ' ' . $timezone);
|
||||
if ($format == 'date') {
|
||||
$date = date_i18n($date_format, $timestamp);
|
||||
}
|
||||
elseif ($format == 'time') {
|
||||
$date = date_i18n($time_format, $timestamp);
|
||||
}
|
||||
elseif ($format == 'full') {
|
||||
$date = date_i18n($wp_settings, $timestamp);
|
||||
}
|
||||
elseif ($format == 'day') {
|
||||
$date = date_i18n('d', $timestamp);
|
||||
}
|
||||
elseif ($format == 'month') {
|
||||
$date = date_i18n('M', $timestamp);
|
||||
}
|
||||
elseif ($format == 'year') {
|
||||
$date = date_i18n('Y', $timestamp);
|
||||
}
|
||||
else {
|
||||
$date = date_i18n($format, $timestamp);
|
||||
}
|
||||
return $date;
|
||||
}
|
||||
public static function date_separate_period($start_date, $end_date, $repeat = 1): DatePeriod {
|
||||
$repeat = max($repeat, 1);
|
||||
$_interval = "P" . $repeat . "D";
|
||||
$end_date = date('Y-m-d', strtotime($end_date . ' +1 day'));
|
||||
return new DatePeriod(new DateTime($start_date), new DateInterval($_interval), new DateTime($end_date));
|
||||
}
|
||||
public static function check_time_exit_date($date) {
|
||||
if ($date) {
|
||||
$parse_date = date_parse($date);
|
||||
if (($parse_date['hour'] && $parse_date['hour'] > 0) || ($parse_date['minute'] && $parse_date['minute'] > 0) || ($parse_date['second'] && $parse_date['second'] > 0)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static function sort_date($a, $b) {
|
||||
return strtotime($a) - strtotime($b);
|
||||
}
|
||||
//***********************************//
|
||||
public static function get_settings($section, $key, $default = '') {
|
||||
$options = get_option($section);
|
||||
if (isset($options[$key]) && $options[$key]) {
|
||||
$default = $options[$key];
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
public static function get_style_settings($key, $default = '') {
|
||||
return self::get_settings('mp_style_settings', $key, $default);
|
||||
}
|
||||
public static function get_slider_settings($key, $default = '') {
|
||||
return self::get_settings('mp_slider_settings', $key, $default);
|
||||
}
|
||||
//***********************************//
|
||||
public static function price_convert_raw($price) {
|
||||
$price = wp_strip_all_tags($price);
|
||||
$price = str_replace(get_woocommerce_currency_symbol(), '', $price);
|
||||
$price = str_replace(wc_get_price_thousand_separator(), 't_s', $price);
|
||||
$price = str_replace(wc_get_price_decimal_separator(), 'd_s', $price);
|
||||
$price = str_replace('t_s', '', $price);
|
||||
$price = str_replace('d_s', '.', $price);
|
||||
$price = str_replace(' ', '', $price);
|
||||
return max($price, 0);
|
||||
}
|
||||
public static function wc_price($post_id, $price, $args = array()): string {
|
||||
$num_of_decimal = get_option('woocommerce_price_num_decimals', 2);
|
||||
$args = wp_parse_args($args, array(
|
||||
'qty' => '',
|
||||
'price' => '',
|
||||
));
|
||||
$_product = self::get_post_info($post_id, 'link_wc_product', $post_id);
|
||||
$product = wc_get_product($_product);
|
||||
$qty = '' !== $args['qty'] ? max(0.0, (float)$args['qty']) : 1;
|
||||
$tax_with_price = get_option('woocommerce_tax_display_shop');
|
||||
if ('' === $price) {
|
||||
return '';
|
||||
}
|
||||
elseif (empty($qty)) {
|
||||
return 0.0;
|
||||
}
|
||||
$line_price = (float)$price * (int)$qty;
|
||||
$return_price = $line_price;
|
||||
if ($product->is_taxable()) {
|
||||
if (!wc_prices_include_tax()) {
|
||||
$tax_rates = WC_Tax::get_rates($product->get_tax_class());
|
||||
$taxes = WC_Tax::calc_tax($line_price, $tax_rates);
|
||||
if ('yes' === get_option('woocommerce_tax_round_at_subtotal')) {
|
||||
$taxes_total = array_sum($taxes);
|
||||
}
|
||||
else {
|
||||
$taxes_total = array_sum(array_map('wc_round_tax_total', $taxes));
|
||||
}
|
||||
$return_price = $tax_with_price == 'excl' ? round($line_price, $num_of_decimal) : round($line_price + $taxes_total, $num_of_decimal);
|
||||
}
|
||||
else {
|
||||
$tax_rates = WC_Tax::get_rates($product->get_tax_class());
|
||||
$base_tax_rates = WC_Tax::get_base_tax_rates($product->get_tax_class('unfiltered'));
|
||||
if (!empty(WC()->customer) && WC()->customer->get_is_vat_exempt()) { // @codingStandardsIgnoreLine.
|
||||
$remove_taxes = apply_filters('woocommerce_adjust_non_base_location_prices', true) ? WC_Tax::calc_tax($line_price, $base_tax_rates, true) : WC_Tax::calc_tax($line_price, $tax_rates, true);
|
||||
if ('yes' === get_option('woocommerce_tax_round_at_subtotal')) {
|
||||
$remove_taxes_total = array_sum($remove_taxes);
|
||||
}
|
||||
else {
|
||||
$remove_taxes_total = array_sum(array_map('wc_round_tax_total', $remove_taxes));
|
||||
}
|
||||
// $return_price = round( $line_price, $num_of_decimal);
|
||||
$return_price = round($line_price - $remove_taxes_total, $num_of_decimal);
|
||||
}
|
||||
else {
|
||||
$base_taxes = WC_Tax::calc_tax($line_price, $base_tax_rates, true);
|
||||
$modded_taxes = WC_Tax::calc_tax($line_price - array_sum($base_taxes), $tax_rates);
|
||||
if ('yes' === get_option('woocommerce_tax_round_at_subtotal')) {
|
||||
$base_taxes_total = array_sum($base_taxes);
|
||||
$modded_taxes_total = array_sum($modded_taxes);
|
||||
}
|
||||
else {
|
||||
$base_taxes_total = array_sum(array_map('wc_round_tax_total', $base_taxes));
|
||||
$modded_taxes_total = array_sum(array_map('wc_round_tax_total', $modded_taxes));
|
||||
}
|
||||
$return_price = $tax_with_price == 'excl' ? round($line_price - $base_taxes_total, $num_of_decimal) : round($line_price - $base_taxes_total + $modded_taxes_total, $num_of_decimal);
|
||||
}
|
||||
}
|
||||
}
|
||||
$return_price = apply_filters('woocommerce_get_price_including_tax', $return_price, $qty, $product);
|
||||
$display_suffix = get_option('woocommerce_price_display_suffix') ? get_option('woocommerce_price_display_suffix') : '';
|
||||
return wc_price($return_price) . ' ' . $display_suffix;
|
||||
}
|
||||
//***********************************//
|
||||
public static function get_image_url($post_id = '', $image_id = '', $size = 'full') {
|
||||
if ($post_id) {
|
||||
$image_id = get_post_thumbnail_id($post_id);
|
||||
$image_id = $image_id ?: self::get_post_info($post_id, 'mp_thumbnail');
|
||||
}
|
||||
return wp_get_attachment_image_url($image_id, $size);
|
||||
}
|
||||
public static function get_page_by_slug($slug) {
|
||||
if ($pages = get_pages()) {
|
||||
foreach ($pages as $page) {
|
||||
if ($slug === $page->post_name) {
|
||||
return $page;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//***********************************//
|
||||
public static function check_woocommerce(): int {
|
||||
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
$plugin_dir = ABSPATH . 'wp-content/plugins/woocommerce';
|
||||
if (is_plugin_active('woocommerce/woocommerce.php')) {
|
||||
return 1;
|
||||
}
|
||||
elseif (is_dir($plugin_dir)) {
|
||||
return 2;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public static function get_order_item_meta($item_id, $key): string {
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "woocommerce_order_itemmeta";
|
||||
$results = $wpdb->get_results($wpdb->prepare("SELECT meta_value FROM $table_name WHERE order_item_id = %d AND meta_key = %s", $item_id, $key));
|
||||
foreach ($results as $result) {
|
||||
$value = $result->meta_value;
|
||||
}
|
||||
return $value ?? '';
|
||||
}
|
||||
public static function check_product_in_cart($post_id) {
|
||||
$status = MP_Global_Function::check_woocommerce();
|
||||
if ($status == 1) {
|
||||
$product_id = MP_Global_Function::get_post_info($post_id, 'link_wc_product');
|
||||
foreach (WC()->cart->get_cart() as $cart_item) {
|
||||
if ($cart_item['product_id'] == $product_id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static function wc_product_sku($product_id) {
|
||||
if ($product_id) {
|
||||
return new WC_Product($product_id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//***********************************//
|
||||
public static function all_tax_list(): array {
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . 'wc_tax_rate_classes';
|
||||
$result = $wpdb->get_results("SELECT * FROM $table_name");
|
||||
$tax_list = [];
|
||||
foreach ($result as $tax) {
|
||||
$tax_list[$tax->slug] = $tax->name;
|
||||
}
|
||||
return $tax_list;
|
||||
}
|
||||
public static function week_day(): array {
|
||||
return [
|
||||
'monday' => esc_html__('Monday', 'mage-eventpress'),
|
||||
'tuesday' => esc_html__('Tuesday', 'mage-eventpress'),
|
||||
'wednesday' => esc_html__('Wednesday', 'mage-eventpress'),
|
||||
'thursday' => esc_html__('Thursday', 'mage-eventpress'),
|
||||
'friday' => esc_html__('Friday', 'mage-eventpress'),
|
||||
'saturday' => esc_html__('Saturday', 'mage-eventpress'),
|
||||
'sunday' => esc_html__('Sunday', 'mage-eventpress'),
|
||||
];
|
||||
}
|
||||
public static function get_plugin_data($data) {
|
||||
$plugin_data = get_plugin_data(__FILE__);
|
||||
return $plugin_data[$data];
|
||||
}
|
||||
public static function array_to_string($array) {
|
||||
$ids = '';
|
||||
if (sizeof($array) > 0) {
|
||||
foreach ($array as $data) {
|
||||
if ($data) {
|
||||
$ids = $ids ? $ids . ',' . $data : $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ids;
|
||||
}
|
||||
public static function esc_html($string): string {
|
||||
$allow_attr = array(
|
||||
'input' => [
|
||||
'type' => [],
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'name' => [],
|
||||
'value' => [],
|
||||
'size' => [],
|
||||
'placeholder' => [],
|
||||
'min' => [],
|
||||
'max' => [],
|
||||
'checked' => [],
|
||||
'required' => [],
|
||||
'disabled' => [],
|
||||
'readonly' => [],
|
||||
'step' => [],
|
||||
'data-default-color' => [],
|
||||
'data-price' => [],
|
||||
],
|
||||
'p' => ['class' => []],
|
||||
'img' => ['class' => [], 'id' => [], 'src' => [], 'alt' => [],],
|
||||
'fieldset' => [
|
||||
'class' => []
|
||||
],
|
||||
'label' => [
|
||||
'for' => [],
|
||||
'class' => []
|
||||
],
|
||||
'select' => [
|
||||
'class' => [],
|
||||
'name' => [],
|
||||
'id' => [],
|
||||
'data-price' => [],
|
||||
],
|
||||
'option' => [
|
||||
'class' => [],
|
||||
'value' => [],
|
||||
'id' => [],
|
||||
'selected' => [],
|
||||
],
|
||||
'textarea' => [
|
||||
'class' => [],
|
||||
'rows' => [],
|
||||
'id' => [],
|
||||
'cols' => [],
|
||||
'name' => [],
|
||||
],
|
||||
'h1' => ['class' => [], 'id' => [],],
|
||||
'h2' => ['class' => [], 'id' => [],],
|
||||
'h3' => ['class' => [], 'id' => [],],
|
||||
'h4' => ['class' => [], 'id' => [],],
|
||||
'h5' => ['class' => [], 'id' => [],],
|
||||
'h6' => ['class' => [], 'id' => [],],
|
||||
'a' => ['class' => [], 'id' => [], 'href' => [],],
|
||||
'div' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'data-ticket-type-name' => [],
|
||||
],
|
||||
'span' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'data' => [],
|
||||
'data-input-change' => [],
|
||||
],
|
||||
'i' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'data' => [],
|
||||
],
|
||||
'table' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'data' => [],
|
||||
],
|
||||
'tr' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'data' => [],
|
||||
],
|
||||
'td' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'data' => [],
|
||||
],
|
||||
'thead' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'data' => [],
|
||||
],
|
||||
'tbody' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'data' => [],
|
||||
],
|
||||
'th' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'data' => [],
|
||||
],
|
||||
'svg' => [
|
||||
'class' => [],
|
||||
'id' => [],
|
||||
'width' => [],
|
||||
'height' => [],
|
||||
'viewBox' => [],
|
||||
'xmlns' => [],
|
||||
],
|
||||
'g' => [
|
||||
'fill' => [],
|
||||
],
|
||||
'path' => [
|
||||
'd' => [],
|
||||
],
|
||||
'br' => array(),
|
||||
'em' => array(),
|
||||
'strong' => array(),
|
||||
);
|
||||
return wp_kses($string, $allow_attr);
|
||||
}
|
||||
//***********************************//
|
||||
}
|
||||
new MP_Global_Function();
|
||||
}
|
|
@ -0,0 +1,145 @@
|
|||
<?php
|
||||
/*
|
||||
* @Author engr.sumonazma@gmail.com
|
||||
* Copyright: mage-people.com
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
if ( ! class_exists( 'MP_Global_Style' ) ) {
|
||||
class MP_Global_Style {
|
||||
public function __construct() {
|
||||
add_action( 'wp_head', array( $this, 'add_global_style' ), 100 );
|
||||
add_action( 'admin_head', array( $this, 'add_global_style' ), 100 );
|
||||
}
|
||||
public function add_global_style() {
|
||||
$default_color = MP_Global_Function::get_style_settings( 'default_text_color', '#303030' );
|
||||
$theme_color = MP_Global_Function::get_style_settings( 'theme_color', '#2F9DF4' );
|
||||
$alternate_color = MP_Global_Function::get_style_settings( 'theme_alternate_color', '#fff' );
|
||||
$warning_color = MP_Global_Function::get_style_settings( 'warning_color', '#E67C30' );
|
||||
$default_fs = MP_Global_Function::get_style_settings( 'default_font_size', '14' ) . 'px';
|
||||
$fs_h1 = MP_Global_Function::get_style_settings( 'font_size_h1', '35' ) . 'px';
|
||||
$fs_h2 = MP_Global_Function::get_style_settings( 'font_size_h2', '30' ) . 'px';
|
||||
$fs_h3 = MP_Global_Function::get_style_settings( 'font_size_h3', '25' ) . 'px';
|
||||
$fs_h4 = MP_Global_Function::get_style_settings( 'font_size_h4', '22' ) . 'px';
|
||||
$fs_h5 = MP_Global_Function::get_style_settings( 'font_size_h5', '18' ) . 'px';
|
||||
$fs_h6 = MP_Global_Function::get_style_settings( 'font_size_h6', '16' ) . 'px';
|
||||
$fs_label = MP_Global_Function::get_style_settings( 'font_size_label', '16' ) . 'px';
|
||||
$button_fs = MP_Global_Function::get_style_settings( 'button_font_size', '16' ) . 'px';
|
||||
$button_color = MP_Global_Function::get_style_settings( 'button_color', $alternate_color );
|
||||
$button_bg = MP_Global_Function::get_style_settings( 'button_bg', '#ea8125' );
|
||||
$section_bg = MP_Global_Function::get_style_settings( 'section_bg', '#FAFCFE' );
|
||||
?>
|
||||
<style>
|
||||
:root {
|
||||
--dContainer_Width: 1320px;
|
||||
--sidebarLeft: 280px;
|
||||
--sidebarRight: 300px;
|
||||
--mainSection: calc(100% - 300px);
|
||||
--dMPL: 40px;
|
||||
--dMP: 20px;
|
||||
--dMP_negetive: -20px;
|
||||
--dMP_xs: 10px;
|
||||
--dMP_xs_negative: -10px;
|
||||
--dBRL: 10px;
|
||||
--dBR: 5px;
|
||||
--dShadow: 0 0 2px #665F5F7A;
|
||||
}
|
||||
/*****Font size********/
|
||||
:root {
|
||||
--fs: <?php echo esc_attr($default_fs); ?>;
|
||||
--fw: normal;
|
||||
--fs_small: 13px;
|
||||
--fs_label: <?php echo esc_attr($fs_label); ?>;
|
||||
--fs_h6: <?php echo esc_attr($fs_h6); ?>;
|
||||
--fs_h5: <?php echo esc_attr($fs_h5); ?>;
|
||||
--fs_h4: <?php echo esc_attr($fs_h4); ?>;
|
||||
--fs_h3: <?php echo esc_attr($fs_h3); ?>;
|
||||
--fs_h2: <?php echo esc_attr($fs_h2); ?>;
|
||||
--fs_h1: <?php echo esc_attr($fs_h1); ?>;
|
||||
--fw-thin: 300; /*font weight medium*/
|
||||
--fw-normal: 500; /*font weight medium*/
|
||||
--fw-medium: 600; /*font weight medium*/
|
||||
--fw-bold: bold; /*font weight bold*/
|
||||
}
|
||||
/*****Button********/
|
||||
:root {
|
||||
--button_bg: <?php echo esc_attr($button_bg); ?>;
|
||||
--color_button: <?php echo esc_attr($button_color); ?>;
|
||||
--button_fs: <?php echo esc_attr($button_fs); ?>;
|
||||
--button_height: 40px;
|
||||
--button_height_xs: 30px;
|
||||
--button_width: 120px;
|
||||
--button_shadows: 0 8px 12px rgb(51 65 80 / 6%), 0 14px 44px rgb(51 65 80 / 11%);
|
||||
}
|
||||
/*******Color***********/
|
||||
:root {
|
||||
--d_color: <?php echo esc_attr($default_color); ?>;
|
||||
--color_border: #DDD;
|
||||
--color_active: #0E6BB7;
|
||||
--color_section: <?php echo esc_attr($section_bg); ?>;
|
||||
--color_theme: <?php echo esc_attr($theme_color); ?>;
|
||||
--color_theme_ee: <?php echo esc_attr($theme_color).'ee'; ?>;
|
||||
--color_theme_cc: <?php echo esc_attr($theme_color).'cc'; ?>;
|
||||
--color_theme_aa: <?php echo esc_attr($theme_color).'aa'; ?>;
|
||||
--color_theme_88: <?php echo esc_attr($theme_color).'88'; ?>;
|
||||
--color_theme_77: <?php echo esc_attr($theme_color).'77'; ?>;
|
||||
--color_theme_alter: <?php echo esc_attr($alternate_color); ?>;
|
||||
--color_warning: <?php echo esc_attr($warning_color); ?>;
|
||||
--color_black: #000;
|
||||
--color_success: #006607;
|
||||
--color_danger: #C00;
|
||||
--color_required: #C00;
|
||||
--color_white: #FFFFFF;
|
||||
--color_light: #F2F2F2;
|
||||
--color_light_1: #BBB;
|
||||
--color_light_2: #EAECEE;
|
||||
--color_info: #666;
|
||||
--color_yellow: #FEBB02;
|
||||
--color_blue: #815DF2;
|
||||
--color_navy_blue: #007CBA;
|
||||
--color_1: #0C5460;
|
||||
--color_2: #0CB32612;
|
||||
--color_3: #FAFCFE;
|
||||
--color_4: #6148BA;
|
||||
--color_5: #BCB;
|
||||
}
|
||||
@media only screen and (max-width: 1100px) {
|
||||
:root {
|
||||
--fs: 14px;
|
||||
--fs_small: 12px;
|
||||
--fs_label: 15px;
|
||||
--fs_h4: 20px;
|
||||
--fs_h3: 22px;
|
||||
--fs_h2: 25px;
|
||||
--fs_h1: 30px;
|
||||
--dMPL: 32px;
|
||||
--dMP: 16px;
|
||||
--dMP_negetive: -16px;
|
||||
--dMP_xs: 8px;
|
||||
--dMP_xs_negative: -8px;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 700px) {
|
||||
:root {
|
||||
--fs: 12px;
|
||||
--fs_small: 10px;
|
||||
--fs_label: 13px;
|
||||
--fs_h6: 15px;
|
||||
--fs_h5: 16px;
|
||||
--fs_h4: 18px;
|
||||
--fs_h3: 20px;
|
||||
--fs_h2: 22px;
|
||||
--fs_h1: 24px;
|
||||
--dMP: 10px;
|
||||
--dMP_xs: 5px;
|
||||
--dMP_xs_negative: -5px;
|
||||
--button_fs: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
new MP_Global_Style();
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<?php
|
115
inc/mep_cpt.php
|
@ -1,115 +0,0 @@
|
|||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
|
||||
/**
|
||||
* The Magical Event Post Type Going to registred here to make your WordPress and WooCommerce a Event Manager :)
|
||||
*/
|
||||
function mep_cpt()
|
||||
{
|
||||
$speaker_status = mep_get_option('mep_enable_speaker_list', 'single_event_setting_sec', 'no');
|
||||
$event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events');
|
||||
$event_slug = mep_get_option('mep_event_slug', 'general_setting_sec', 'events');
|
||||
$event_icon = mep_get_option('mep_event_icon', 'general_setting_sec', 'dashicons-calendar-alt');
|
||||
|
||||
$labels = array(
|
||||
'name' => __($event_label, 'mage-eventpress'),
|
||||
'singular_name' => __($event_label, 'mage-eventpress'),
|
||||
'menu_name' => __($event_label, 'mage-eventpress'),
|
||||
'name_admin_bar' => __($event_label, 'mage-eventpress'),
|
||||
'archives' => __($event_label . ' List', 'mage-eventpress'),
|
||||
'attributes' => __($event_label . ' List', 'mage-eventpress'),
|
||||
'parent_item_colon' => __($event_label . ' Item:', 'mage-eventpress'),
|
||||
'all_items' => __('All ','mage-eventpress') . $event_label,
|
||||
'add_new_item' => __('Add New ','mage-eventpress') . $event_label,
|
||||
'add_new' => __('Add New ','mage-eventpress') . $event_label,
|
||||
'new_item' => __('New ','mage-eventpress') . $event_label,
|
||||
'edit_item' => __('Edit ','mage-eventpress') . $event_label,
|
||||
'update_item' => __('Update ','mage-eventpress') . $event_label,
|
||||
'view_item' => __('View ','mage-eventpress') . $event_label,
|
||||
'view_items' => __('View ','mage-eventpress') . $event_label,
|
||||
'search_items' => __('Search ','mage-eventpress') . $event_label,
|
||||
'not_found' => $event_label . __(' Not found', 'mage-eventpress'),
|
||||
'not_found_in_trash' => $event_label . __(' Not found in Trash', 'mage-eventpress'),
|
||||
'featured_image' => $event_label . __(' Feature Image', 'mage-eventpress'),
|
||||
'set_featured_image' => __('Set ','mage-eventpress') . $event_label . __(' featured image', 'mage-eventpress'),
|
||||
'remove_featured_image' => __('Remove ','mage-eventpress') . $event_label . __(' featured image', 'mage-eventpress'),
|
||||
'use_featured_image' => __('Use as ','mage-eventpress') . $event_label . __(' featured image', 'mage-eventpress'),
|
||||
'insert_into_item' => __('Insert into ','mage-eventpress') . $event_label,
|
||||
'uploaded_to_this_item' => __('Uploaded to this ','mage-eventpress') . $event_label,
|
||||
'items_list' => $event_label . __(' list', 'mage-eventpress'),
|
||||
'items_list_navigation' => $event_label . __(' list navigation', 'mage-eventpress'),
|
||||
'filter_items_list' => __('Filter ','mage-eventpress') . $event_label . __(' list', 'mage-eventpress'),
|
||||
);
|
||||
|
||||
$rewrite = array(
|
||||
'slug' => $event_slug,
|
||||
'with_front' => true,
|
||||
'pages' => true,
|
||||
'feeds' => true,
|
||||
);
|
||||
|
||||
$args = array(
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'labels' => $labels,
|
||||
'menu_icon' => $event_icon,
|
||||
'supports' => apply_filters('mep_events_post_type_support',array('title', 'editor', 'thumbnail', 'excerpt')),
|
||||
'rewrite' => $rewrite,
|
||||
'show_in_rest' => apply_filters('mep_events_post_type_show_in_rest',true)
|
||||
|
||||
);
|
||||
register_post_type('mep_events', $args);
|
||||
|
||||
$labels = array(
|
||||
'name' => __('Speakers', 'mage-eventpress'),
|
||||
'singular_name' => __('Speaker', 'mage-eventpress'),
|
||||
'menu_name' => __('Speakers', 'mage-eventpress'),
|
||||
'name_admin_bar' => __('Speakers', 'mage-eventpress'),
|
||||
'archives' => __('Speakers List', 'mage-eventpress'),
|
||||
'attributes' => __('Speakers List', 'mage-eventpress'),
|
||||
'parent_item_colon' => __('Speakers Item:', 'mage-eventpress'),
|
||||
'all_items' => __('Speakers', 'mage-eventpress'),
|
||||
'add_new_item' => __('Add New Speaker', 'mage-eventpress'),
|
||||
'add_new' => __('Add New Speaker', 'mage-eventpress'),
|
||||
'new_item' => __('New Speaker', 'mage-eventpress'),
|
||||
'edit_item' => __('Edit Speaker', 'mage-eventpress'),
|
||||
'update_item' => __('Update Speaker', 'mage-eventpress'),
|
||||
'view_item' => __('View Speaker', 'mage-eventpress'),
|
||||
'view_items' => __('View Speaker', 'mage-eventpress'),
|
||||
'search_items' => __('Search Speaker', 'mage-eventpress'),
|
||||
'not_found' => __('Speaker Not found', 'mage-eventpress'),
|
||||
'not_found_in_trash' => __('Speaker Not found in Trash', 'mage-eventpress'),
|
||||
'featured_image' => __('Speaker Image', 'mage-eventpress'),
|
||||
'set_featured_image' => __('Set Speaker image', 'mage-eventpress'),
|
||||
'remove_featured_image' => __('Remove Speaker image', 'mage-eventpress'),
|
||||
'use_featured_image' => __('Use as Speaker image', 'mage-eventpress'),
|
||||
'insert_into_item' => __('Insert into Speaker', 'mage-eventpress'),
|
||||
'uploaded_to_this_item' => __('Uploaded to this Speaker', 'mage-eventpress'),
|
||||
'items_list' => __('Speaker list', 'mage-eventpress'),
|
||||
'items_list_navigation' => __('Speaker list navigation', 'mage-eventpress'),
|
||||
'filter_items_list' => __('Filter Speaker list', 'mage-eventpress'),
|
||||
);
|
||||
$sprewrite = array(
|
||||
'slug' => 'event-speaker',
|
||||
'with_front' => true,
|
||||
'pages' => true,
|
||||
'feeds' => true,
|
||||
);
|
||||
|
||||
$args = array(
|
||||
'public' => true,
|
||||
'labels' => $labels,
|
||||
'menu_icon' => 'dashicons-calendar-alt',
|
||||
'supports' => array('title', 'editor', 'thumbnail', 'excerpt'),
|
||||
'rewrite' => $sprewrite,
|
||||
'show_in_menu' => 'edit.php?post_type=mep_events',
|
||||
'show_in_rest' => apply_filters('mep_speaker_post_type_show_in_rest',true)
|
||||
);
|
||||
|
||||
if ($speaker_status == 'yes') {
|
||||
register_post_type('mep_event_speaker', $args);
|
||||
}
|
||||
}
|
||||
add_action('init', 'mep_cpt');
|
|
@ -1,2 +0,0 @@
|
|||
<?php
|
||||
// Noting is Here....
|
|
@ -1,168 +0,0 @@
|
|||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
|
||||
/**
|
||||
* The Admin Enqueue Scripts & Style Files are Hooked up below for WooOCmmerce Event Manager Plugin
|
||||
*/
|
||||
add_action('admin_enqueue_scripts', 'mep_add_admin_scripts', 10, 1);
|
||||
function mep_add_admin_scripts($hook)
|
||||
{
|
||||
global $post;
|
||||
$user_api = mep_get_option('google-map-api', 'general_setting_sec', '');
|
||||
$flaticonLoad = mep_get_option('mep_load_flaticon_from_theme', 'general_setting_sec', 'no');
|
||||
|
||||
/**
|
||||
* Load Only when the New Event Add Page Open.
|
||||
*/
|
||||
if ($hook == 'post-new.php' || $hook == 'post.php') {
|
||||
if ('mep_events' === $post->post_type) {
|
||||
wp_enqueue_style('mep-jquery-ui-style', plugin_dir_url(__DIR__) . 'css/jquery-ui.css', array());
|
||||
wp_enqueue_script('gmap-scripts', plugin_dir_url(__DIR__) . 'js/mkb-admin.js', array('jquery', 'jquery-ui-core'),time(), true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If Your Save Google API Then Load the Google Map API
|
||||
*/
|
||||
if ($user_api) {
|
||||
wp_enqueue_script('gmap-libs', 'https://maps.googleapis.com/maps/api/js?key=' . esc_attr($user_api) . '&libraries=places&callback=initMap', array('jquery', 'gmap-scripts'), 1, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enquue Admin Styles
|
||||
*/
|
||||
|
||||
wp_enqueue_style('mage-jquery-ui-style', plugin_dir_url(__DIR__) . 'css/jquery-ui.css', array());
|
||||
wp_enqueue_style('mage-options-framework', plugin_dir_url(__DIR__) . 'css/mage-options-framework.css');
|
||||
wp_enqueue_style('jquery-ui', plugin_dir_url(__DIR__) . 'css/jquery-ui.css');
|
||||
wp_enqueue_style('select2.min', plugin_dir_url(__DIR__) . 'css/select2.min.css');
|
||||
wp_enqueue_style('codemirror', plugin_dir_url(__DIR__) . 'css/codemirror.css');
|
||||
wp_enqueue_style('font-awesome-css-cdn', "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.2.0/css/all.min.css", null, 1);
|
||||
wp_enqueue_style('mep-admin-style', plugin_dir_url(__DIR__) . 'css/admin_style.css', array());
|
||||
|
||||
//loading modal css
|
||||
wp_enqueue_style('jquery.modal.min', plugin_dir_url(__DIR__) . 'css/jquery.modal.min.css', array(), 1.0);
|
||||
|
||||
//flaticon
|
||||
if($flaticonLoad == 'no'){
|
||||
wp_enqueue_style('flaticon', plugin_dir_url(__DIR__) . 'fonts/flaticon/flaticon.css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Enquue Admin Scripts
|
||||
*/
|
||||
wp_enqueue_script('jquery-ui-core');
|
||||
wp_enqueue_script('jquery-ui-datepicker');
|
||||
wp_enqueue_script('jquery-ui-sortable');
|
||||
wp_enqueue_script('jquery-ui-accordion');
|
||||
wp_enqueue_style('wp-color-picker');
|
||||
wp_enqueue_script('wp-color-picker');
|
||||
wp_enqueue_script('magepeople-options-framework', plugins_url('js/mage-options-framework.js', __DIR__), array('jquery'));
|
||||
wp_localize_script('PickpluginsOptionsFramework', 'PickpluginsOptionsFramework_ajax', array('PickpluginsOptionsFramework_ajaxurl' => admin_url('admin-ajax.php')));
|
||||
wp_enqueue_script('codemirror', plugin_dir_url(__DIR__) . 'js/codemirror.min.js', array('jquery'), null, false);
|
||||
wp_enqueue_script('form-field-dependency', plugins_url('js/form-field-dependency.js', __DIR__), array('jquery'), null, false);
|
||||
wp_localize_script('jquery', 'mep_ajax', array( 'mep_ajaxurl' => admin_url( 'admin-ajax.php')));
|
||||
wp_localize_script('mep_ajax', 'mep_ajax_var', array( 'url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('mep-ajax-nonce')));
|
||||
|
||||
//loading modal script
|
||||
wp_enqueue_script('jquery.modal.min', plugin_dir_url(__DIR__) . 'js/jquery.modal.min.js', array('jquery'), 1.0, true);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
wp_register_script('welcome-tabs', plugin_dir_url(__DIR__) . 'js/welcome-tabs.js', array('jquery'));
|
||||
wp_register_style('welcome-tabs', plugin_dir_url(__DIR__) . 'css/welcome-tabs.css');
|
||||
|
||||
wp_register_script('welcome-tabs', plugin_dir_url(__DIR__) . 'js/welcome-tabs.js', array('jquery'));
|
||||
wp_register_style('welcome-tabs', plugin_dir_url(__DIR__) . 'css/welcome-tabs.css');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Event Manager For Woocommerce Style & Scripts Hooked up below for the Frontend
|
||||
*/
|
||||
add_action('wp_enqueue_scripts', 'mep_event_enqueue_scripts', 90);
|
||||
function mep_event_enqueue_scripts()
|
||||
{
|
||||
$owlThemeLoad = mep_get_option('mep_load_carousal_from_theme', 'carousel_setting_sec', 'no');
|
||||
$fontAwesoneLoad = mep_get_option('mep_load_fontawesome_from_theme', 'general_setting_sec', 'no');
|
||||
$flaticonLoad = mep_get_option('mep_load_flaticon_from_theme', 'general_setting_sec', 'no');
|
||||
|
||||
wp_enqueue_script('jquery');
|
||||
wp_enqueue_script('jquery-ui-datepicker');
|
||||
wp_enqueue_script('jquery-ui-core');
|
||||
wp_enqueue_script('jquery-ui-accordion');
|
||||
wp_enqueue_style('mep-jquery-ui-style', plugin_dir_url(__DIR__) . 'css/jquery-ui.css', array());
|
||||
wp_enqueue_style('mep-event-style', plugin_dir_url(__DIR__) . 'css/style.css', array(),time());
|
||||
wp_enqueue_style('filter_pagination', plugin_dir_url(__DIR__) . 'css/filter_pagination.css', array());
|
||||
wp_enqueue_style('mep-event-timeline-min-style', plugin_dir_url(__DIR__) . 'css/timeline.min.css', array('mep-event-style'));
|
||||
|
||||
if($fontAwesoneLoad == 'no'){
|
||||
wp_enqueue_style('font-awesome-css-cdn', "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css", null, 1);
|
||||
wp_enqueue_style('font-awesome-css-cdn-5.2.0', "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.2.0/css/all.min.css", null, 1);
|
||||
}
|
||||
wp_enqueue_style('mep-calendar-min-style', plugin_dir_url(__DIR__) . 'css/calendar.min.css', array());
|
||||
|
||||
wp_enqueue_script('mep-calendar-scripts', plugin_dir_url(__DIR__) . 'js/calendar.min.js', array('jquery', 'mep-moment-js'), 1, false);
|
||||
wp_enqueue_script('mep-mixitup-min-js', plugin_dir_url(__DIR__) . 'js/mixitup.min.js', array(), 1, true);
|
||||
|
||||
// wp_enqueue_script('mep-countdown-js', plugin_dir_url(__DIR__) . 'js/countdown.jquery.min.js', array(), 1, true);
|
||||
wp_enqueue_script('mep-countdown-js', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.countdown/2.2.0/jquery.countdown.min.js', array(), 1, true);
|
||||
|
||||
//wp_enqueue_script('mep-lazysizes', plugin_dir_url(__DIR__) . 'js/lazysizes.min.js', array(), 1, true);
|
||||
|
||||
wp_enqueue_script('filter_pagination', plugin_dir_url(__DIR__) . 'js/filter_pagination.js', array(), time(), true);
|
||||
wp_enqueue_script('mp_event_custom_script', plugin_dir_url(__DIR__) . 'js/mp_event_custom_script.js', array(), time(), true);
|
||||
|
||||
wp_enqueue_script('mep-moment-js','https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment-with-locales.min.js',array(),1,true);
|
||||
wp_enqueue_script('mep-timeline-min', plugin_dir_url(__DIR__) . 'js/timeline.min.js', array('jquery'), 1, true);
|
||||
wp_enqueue_script('mep-event-custom-scripts', plugin_dir_url(__DIR__) . 'js/mkb-scripts.js', array(), time(), true);
|
||||
wp_localize_script('jquery', 'mep_ajax', array( 'mep_ajaxurl' => admin_url( 'admin-ajax.php')));
|
||||
|
||||
//loading event faq accordion script
|
||||
wp_enqueue_script('mep-event-faq', plugin_dir_url(__DIR__) . 'js/mep_event_faq.js', array('jquery'), 1.0, true);
|
||||
|
||||
//flaticon
|
||||
if($flaticonLoad == 'no'){
|
||||
wp_enqueue_style('flaticon', plugin_dir_url(__DIR__) . 'fonts/flaticon/flaticon.css');
|
||||
}
|
||||
|
||||
if($owlThemeLoad == 'no'){
|
||||
wp_enqueue_style('mep-event-owl-carousal-main-style', plugin_dir_url(__DIR__) . 'css/owl.carousel.min.css', array('mep-event-style'));
|
||||
wp_enqueue_style('mep-event-owl-carousal-default-style', plugin_dir_url(__DIR__) . 'css/owl.theme.default.min.css', array('mep-event-style'));
|
||||
wp_enqueue_script('mep-owl-carousel-min', plugin_dir_url(__DIR__) . 'js/owl.carousel.min.js', array('jquery'), 1, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Ajax Issue
|
||||
add_action('wp_head','mep_ajax_url',5);
|
||||
add_action('admin_head','mep_ajax_url',5);
|
||||
function mep_ajax_url(){
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
// Event Manager For Woocommerce Ajax URL
|
||||
var ajaxurl = "<?php echo admin_url('admin-ajax.php'); ?>";
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
add_action('wp_head', 'mep_add_wp_header_scripts');
|
||||
function mep_add_wp_header_scripts(){
|
||||
echo mep_event_rich_text_data();
|
||||
echo mep_apply_custom_css();
|
||||
}
|
|
@ -284,8 +284,8 @@ function mep_add_custom_fields_text_to_order_items($item, $cart_item_key, $value
|
|||
|
||||
$eid = array_key_exists('event_id', $values) ? $values['event_id'] : 0; //$values['event_id'];
|
||||
$start_time = get_post_meta($eid, 'event_start_time', true);
|
||||
$location_text = mep_get_option('mep_location_text', 'label_setting_sec', esc_html__('Location', 'mage-eventpress')) ? mep_get_option('mep_location_text', 'label_setting_sec', esc_html__('Location', 'mage-eventpress')) : 'Location';
|
||||
$date_text = mep_get_option('mep_event_date_text', 'label_setting_sec', esc_html__('Date', 'mage-eventpress')) ? mep_get_option('mep_event_date_text', 'label_setting_sec', esc_html__('Date', 'mage-eventpress')) : 'Date';
|
||||
$location_text = mep_get_option('mep_location_text', 'label_setting_sec', esc_html__('Location', 'mage-eventpress'));
|
||||
$date_text = mep_get_option('mep_event_date_text', 'label_setting_sec', esc_html__('Date', 'mage-eventpress'));
|
||||
|
||||
if (get_post_type($eid) == 'mep_events') {
|
||||
$event_id = $eid;
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
if (!class_exists('EDD_SL_Plugin_Updater')) {
|
||||
require_once(dirname(__DIR__) . '/lib/classes/EDD_SL_Plugin_Updater.php');
|
||||
}
|
||||
// require_once(dirname(__DIR__) . '/lib/classes/class-wc-product-data.php');
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-form-fields-generator.php');
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-meta-box.php');
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-taxonomy-edit.php');
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-mep.php');
|
||||
require_once(dirname(__DIR__) . "/inc/class/mep_settings_api.php");
|
||||
|
||||
require_once(dirname(__DIR__) . "/inc/welcome.php");
|
||||
require_once(dirname(__DIR__) . "/inc/status.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_cpt.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_tax.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_event_meta.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_event_fw_meta.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_extra_price.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_shortcode.php");
|
||||
require_once(dirname(__DIR__) . "/inc/admin_setting_panel.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_enque.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_user_custom_style.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_tax_meta.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_dummy_import.php");
|
||||
|
||||
require_once(dirname(__DIR__) . "/inc/mep_functions.php");
|
||||
require_once(dirname(__DIR__) . "/inc/mep_query.php");
|
||||
require_once(dirname(__DIR__) . "/support/elementor/elementor-support.php");
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-icon-library.php');
|
||||
require_once(dirname(__DIR__) . '/lib/classes/class-icon-popup.php');
|
|
@ -55,14 +55,6 @@ function mep_add_event_into_feed_request($qv) {
|
|||
}
|
||||
add_filter('request', 'mep_add_event_into_feed_request');
|
||||
|
||||
// Language Load
|
||||
add_action('init', 'mep_language_load');
|
||||
if (!function_exists('mep_language_load')) {
|
||||
function mep_language_load() {
|
||||
$plugin_dir = basename(dirname(__DIR__)) . "/languages/";
|
||||
load_plugin_textdomain('mage-eventpress', false, $plugin_dir);
|
||||
}
|
||||
}
|
||||
if (!function_exists('mepfix_sitemap_exclude_post_type')) {
|
||||
function mepfix_sitemap_exclude_post_type() {
|
||||
return ['auto-draft'];
|
||||
|
@ -3374,87 +3366,6 @@ function mep_string_sanitize($s) {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This the function which will create the Rich Text Schema For each event into the <head></head> section.
|
||||
*/
|
||||
|
||||
if (!function_exists('mep_event_rich_text_data')) {
|
||||
function mep_event_rich_text_data() {
|
||||
global $post;
|
||||
|
||||
if (is_single()) {
|
||||
$event_id = $post->ID;
|
||||
if ($event_id && get_post_type($event_id) == 'mep_events') {
|
||||
$event_name = get_the_title($event_id);
|
||||
$event_start_date = get_post_meta($post->ID, 'event_start_datetime', true) ? wp_date('Y-m-d H:i:s T', strtotime(get_post_meta($post->ID, 'event_start_datetime', true))) : '';
|
||||
$event_end_date = get_post_meta($post->ID, 'event_end_datetime', true) ? get_post_meta($post->ID, 'event_end_datetime', true) : '';
|
||||
$event_rt_status = get_post_meta($post->ID, 'mep_rt_event_status', true) ? get_post_meta($post->ID, 'mep_rt_event_status', true) : 'EventRescheduled';
|
||||
$event_rt_atdnce_mode = get_post_meta($post->ID, 'mep_rt_event_attandence_mode', true) ? get_post_meta($post->ID, 'mep_rt_event_attandence_mode', true) : 'OfflineEventAttendanceMode';
|
||||
$event_rt_prv_date = get_post_meta($post->ID, 'mep_rt_event_prvdate', true) ? get_post_meta($post->ID, 'mep_rt_event_prvdate', true) : $event_start_date;
|
||||
$terms = get_the_terms($event_id, 'mep_org');
|
||||
$org_name = is_array($terms) && sizeof($terms) > 0 ? $terms[0]->name : 'No Performer';
|
||||
$rt_status = get_post_meta($event_id, 'mep_rich_text_status', true) ? get_post_meta($event_id, 'mep_rich_text_status', true) : 'enable';
|
||||
if ($rt_status == 'enable') {
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context" : "https://schema.org",
|
||||
"@type" : "Event",
|
||||
"name" : "<?php echo esc_attr($event_name); ?>",
|
||||
"startDate" : "<?php echo esc_attr($event_start_date); ?>",
|
||||
"endDate" : "<?php echo esc_attr($event_end_date); ?>",
|
||||
"offers": {
|
||||
"@type" : "Offer",
|
||||
"url" : "<?php echo get_the_permalink($event_id); ?>",
|
||||
"price" : "<?php echo strip_tags(mep_event_list_number_price($event_id)); ?>",
|
||||
"priceCurrency" : "<?php echo get_woocommerce_currency(); ?>",
|
||||
"availability" : "https://schema.org/InStock",
|
||||
"validFrom" : "<?php echo esc_attr($event_end_date); ?>"
|
||||
},
|
||||
"organizer": {
|
||||
"@type" : "Organization",
|
||||
"name" : "<?php echo esc_attr($org_name); ?>",
|
||||
"url" : "<?php echo get_the_permalink($event_id); ?>"
|
||||
},
|
||||
"eventStatus" : "https://schema.org/<?php echo esc_attr($event_rt_status); ?>",
|
||||
"eventAttendanceMode" : "https://schema.org/<?php echo esc_attr($event_rt_atdnce_mode); ?>",
|
||||
"previousStartDate" : "<?php echo esc_attr($event_rt_prv_date); ?>",
|
||||
"location" : {
|
||||
"@type" : "Place",
|
||||
"name" : "<?php echo mep_get_event_location($event_id); ?>",
|
||||
"address" : {
|
||||
"@type" : "PostalAddress",
|
||||
"streetAddress" : "<?php echo mep_get_event_location_street($event_id); ?>",
|
||||
"addressLocality": "<?php echo mep_get_event_location_city($event_id); ?>",
|
||||
"postalCode" : "<?php echo mep_get_event_location_postcode($event_id) ?>",
|
||||
"addressRegion" : "<?php echo mep_get_event_location_state($event_id) ?>",
|
||||
"addressCountry": "<?php echo mep_get_event_location_country($event_id) ?>"
|
||||
}
|
||||
},
|
||||
"image": [
|
||||
"<?php echo get_the_post_thumbnail_url($event_id, 'full'); ?>"
|
||||
],
|
||||
"description": "<?php echo strip_tags(mep_string_sanitize(get_the_excerpt($event_id))); ?>",
|
||||
"performer": {
|
||||
"@type" : "PerformingGroup",
|
||||
"name" : "<?php echo esc_attr($org_name); ?>"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We added event id with every order for using in the attendee & seat inventory calculation, but this info was showing in the thank you page, so i decided to hide this, and here is the fucntion which will hide the event id from the thank you page.
|
||||
*/
|
||||
|
@ -3471,17 +3382,16 @@ if (!function_exists('mep_hide_event_order_meta_in_emails')) {
|
|||
add_filter('woocommerce_order_item_get_formatted_meta_data', 'mep_hide_event_order_data_from_thankyou_and_email', 10, 1);
|
||||
if (!function_exists('mep_hide_event_order_data_from_thankyou_and_email')) {
|
||||
function mep_hide_event_order_data_from_thankyou_and_email($formatted_meta) {
|
||||
|
||||
$hide_location_status = mep_get_option('mep_hide_location_from_order_page', 'general_setting_sec', 'no');
|
||||
$hide_date_status = mep_get_option('mep_hide_date_from_order_page', 'general_setting_sec', 'no');
|
||||
$location_text = mep_get_option('mep_location_text', 'label_setting_sec', esc_html__('Location', 'mage-eventpress')) ? mep_get_option('mep_location_text', 'label_setting_sec', __('Location', 'mage-eventpress')) : 'Location';
|
||||
$date_text = mep_get_option('mep_event_date_text', 'label_setting_sec', esc_html__('Date', 'mage-eventpress')) ? mep_get_option('mep_event_date_text', 'label_setting_sec', __('Date', 'mage-eventpress')) : 'Date';
|
||||
|
||||
$location_text = mep_get_option('mep_location_text', 'label_setting_sec', esc_html__('Location', 'mage-eventpress'));
|
||||
$date_text = mep_get_option('mep_event_date_text', 'label_setting_sec', esc_html__('Date', 'mage-eventpress'));
|
||||
$hide_location = $hide_location_status == 'yes' ? array($location_text) : array();
|
||||
$hide_date = $hide_date_status == 'yes' ? array($date_text) : array();
|
||||
$default = array('event_id');
|
||||
$default = array_merge($default, $hide_date);
|
||||
$hide_them = array_merge($default, $hide_location);
|
||||
|
||||
$temp_metas = [];
|
||||
|
||||
foreach ($formatted_meta as $key => $meta) {
|
||||
|
@ -3530,31 +3440,6 @@ if (!function_exists('mep_custom_css_sectings_fields')) {
|
|||
return array_merge($default_fields, $settings_fields);
|
||||
}
|
||||
}
|
||||
// add_action('wp_head', 'mep_apply_custom_css', 90);
|
||||
if (!function_exists('mep_apply_custom_css')) {
|
||||
function mep_apply_custom_css() {
|
||||
$custom_css = mep_get_option('mep_custom_css', 'mep_settings_custom_css', '');
|
||||
$hide_booked_event_on_list = mep_get_option('mep_hide_not_available_event_from_list_page', 'general_setting_sec', 'no');
|
||||
ob_start();
|
||||
?>
|
||||
<style>
|
||||
/* Custom CSS Code From Event Manager For Woocommerce Plugin */
|
||||
<?php
|
||||
echo esc_attr($custom_css);
|
||||
|
||||
if($hide_booked_event_on_list == 'yes'){
|
||||
?>
|
||||
.event-no-availabe-seat{
|
||||
display: none !important;
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</style>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('mep_get_ticket_type_price_by_name')) {
|
||||
function mep_get_ticket_type_price_by_name($name, $event_id) {
|
||||
|
@ -4491,7 +4376,7 @@ function mep_get_event_add_cart_sec($post_id) {
|
|||
?>
|
||||
<!-- Register Now Title -->
|
||||
<h4 class="mep-cart-table-title">
|
||||
<?php echo mep_get_option('mep_register_now_text', 'label_setting_sec') ? mep_get_option('mep_register_now_text', 'label_setting_sec') : esc_html__('Register Now:', 'mage-eventpress'); ?>
|
||||
<?php echo mep_get_option('mep_register_now_text', 'label_setting_sec',__('Register Now:', 'mage-eventpress')); ?>
|
||||
</h4>
|
||||
<!--The event add to cart main form start here-->
|
||||
<form action="" method='post' id="mage_event_submit" enctype="multipart/form-data">
|
||||
|
@ -4511,12 +4396,12 @@ function mep_get_event_add_cart_sec($post_id) {
|
|||
<!--The Add to cart button table start Here-->
|
||||
<table class='table table-bordered mep_event_add_cart_table'>
|
||||
<tr>
|
||||
<td style='text-align:left;' class='total-col'><?php echo mep_get_option('mep_quantity_text', 'label_setting_sec') ? mep_get_option('mep_quantity_text', 'label_setting_sec') : esc_html__('Quantity:', 'mage-eventpress');
|
||||
<td style='text-align:left;' class='total-col'><?php echo mep_get_option('mep_quantity_text', 'label_setting_sec',__('Quantity:', 'mage-eventpress'));
|
||||
if ($mep_event_ticket_type) { ?>
|
||||
<input id="quantity_5a7abbd1bff73" class="input-text qty text extra-qty-box" step="1" min="1" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" type="hidden">
|
||||
<span id="ttyttl"></span>
|
||||
<?php } ?>
|
||||
<span class='the-total'> <?php echo mep_get_option('mep_total_text', 'label_setting_sec') ? mep_get_option('mep_total_text', 'label_setting_sec') : esc_html__('Total', 'mage-eventpress'); ?>
|
||||
<span class='the-total'> <?php echo mep_get_option('mep_total_text', 'label_setting_sec', __('Total', 'mage-eventpress')); ?>
|
||||
<span id="usertotal"></span>
|
||||
</span>
|
||||
</td>
|
||||
|
@ -4607,16 +4492,6 @@ function mep_add_expire_min_in_current_date($current_date, $event_date, $event_i
|
|||
}
|
||||
}
|
||||
|
||||
add_filter('use_block_editor_for_post_type', 'mep_disable_gutenberg', 10, 2);
|
||||
if (!function_exists('mep_disable_gutenberg')) {
|
||||
function mep_disable_gutenberg($current_status, $post_type) {
|
||||
$user_status = mep_get_option('mep_disable_block_editor', 'general_setting_sec', 'yes');
|
||||
// Use your post type key instead of 'mep_events'
|
||||
if ($post_type === 'mep_events' && $user_status == 'yes')
|
||||
return false;
|
||||
return $current_status;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('mep_enable_big_selects_for_queries')) {
|
||||
function mep_enable_big_selects_for_queries() {
|
||||
|
@ -4860,9 +4735,9 @@ if (!function_exists('mep_event_recurring_date_list_in_event_list_loop')) {
|
|||
<span class='mep_more_date_btn mep-tem3-title-sec mp_event_visible_event_time'
|
||||
data-event-id="<?php echo esc_attr($event_id); ?>"
|
||||
data-active-text="<?php echo esc_attr(mep_get_option('mep_event_view_more_date_btn_text', 'label_setting_sec', esc_html__('View More Date', 'mage-eventpress'))); ?>"
|
||||
data-hide-text="<?php echo esc_attr(mep_get_option('mep_event_hide_date_list_btn_text', 'label_setting_sec', esc_html__('Hide Date Lists', 'mage-eventpress'))); ?>"
|
||||
data-hide-text="<?php echo esc_attr(mep_get_option('mep_event_hide_date_list_btn_text', 'label_setting_sec', __('Hide Date Lists', 'mage-eventpress'))); ?>"
|
||||
>
|
||||
<?php echo mep_get_option('mep_event_view_more_date_btn_text', 'label_setting_sec', esc_html__('View More Date', 'mage-eventpress')); ?>
|
||||
<?php echo mep_get_option('mep_event_view_more_date_btn_text', 'label_setting_sec', __('View More Date', 'mage-eventpress')); ?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
|
||||
/**
|
||||
* This will be used for Taxonomy Meta Box with the Brand New Mage Freamwork
|
||||
*/
|
|
@ -1,353 +0,0 @@
|
|||
<?php
|
||||
if ( ! defined('ABSPATH')) exit; // if direct access
|
||||
|
||||
|
||||
wp_enqueue_script('welcome-tabs');
|
||||
wp_enqueue_style( 'welcome-tabs' );
|
||||
|
||||
|
||||
$mep_settings_tab = array();
|
||||
|
||||
|
||||
$mep_settings_tab[] = array(
|
||||
'id' => 'start',
|
||||
'title' => sprintf(__('%s Welcome','mage-eventpress'),'<i class="far fa-thumbs-up"></i>'),
|
||||
'priority' => 1,
|
||||
'active' => true,
|
||||
);
|
||||
|
||||
$mep_settings_tab[] = array(
|
||||
'id' => 'general',
|
||||
'title' => sprintf(__('%s General','mage-eventpress'),'<i class="fas fa-list-ul"></i>'),
|
||||
'priority' => 2,
|
||||
'active' => false,
|
||||
);
|
||||
|
||||
|
||||
$mep_settings_tab[] = array(
|
||||
'id' => 'done',
|
||||
'title' => sprintf(__('%s Done','mage-eventpress'),'<i class="fas fa-pencil-alt"></i>'),
|
||||
'priority' => 4,
|
||||
'active' => false,
|
||||
);
|
||||
|
||||
$mep_settings_tab = apply_filters('qa_welcome_tabs', $mep_settings_tab);
|
||||
$tabs_sorted = array();
|
||||
foreach ($mep_settings_tab as $page_key => $tab) $tabs_sorted[$page_key] = isset( $tab['priority'] ) ? $tab['priority'] : 0;
|
||||
array_multisort($tabs_sorted, SORT_ASC, $mep_settings_tab);
|
||||
wp_enqueue_style('font-awesome-5');
|
||||
|
||||
|
||||
if (!function_exists('mep_woo_install_check')) {
|
||||
function mep_woo_install_check() {
|
||||
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
$plugin_dir = ABSPATH . 'wp-content/plugins/woocommerce';
|
||||
if (is_plugin_active('woocommerce/woocommerce.php')) {
|
||||
return 'Yes';
|
||||
} elseif (is_dir($plugin_dir)) {
|
||||
return 'Installed But Not Active';
|
||||
} else {
|
||||
return 'No';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add_action('mep_quick_setup_header','mep_woo_quick_setup_action',90);
|
||||
function mep_woo_quick_setup_action(){
|
||||
|
||||
if(isset($_POST['active_woo_btn'])){
|
||||
activate_plugin('woocommerce/woocommerce.php' );
|
||||
?>
|
||||
<script> location.reload(); </script>
|
||||
<?php
|
||||
}
|
||||
|
||||
if(isset($_POST['install_and_active_woo_btn'])){
|
||||
echo '<div style="display:none">';
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
|
||||
|
||||
$plugin = 'woocommerce';
|
||||
|
||||
$api = plugins_api( 'plugin_information', array(
|
||||
'slug' => $plugin,
|
||||
'fields' => array(
|
||||
'short_description' => false,
|
||||
'sections' => false,
|
||||
'requires' => false,
|
||||
'rating' => false,
|
||||
'ratings' => false,
|
||||
'downloaded' => false,
|
||||
'last_updated' => false,
|
||||
'added' => false,
|
||||
'tags' => false,
|
||||
'compatibility' => false,
|
||||
'homepage' => false,
|
||||
'donate_link' => false,
|
||||
),
|
||||
));
|
||||
|
||||
//includes necessary for Plugin_Upgrader and Plugin_Installer_Skin
|
||||
include_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
include_once( ABSPATH . 'wp-admin/includes/misc.php' );
|
||||
include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
||||
|
||||
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
|
||||
$upgrader->install($api->download_link);
|
||||
activate_plugin('woocommerce/woocommerce.php' );
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($_POST['finish_quick_setup'])){
|
||||
$url = (isset($_SERVER['HTTPS']) ? "" : "") . "$_SERVER[HTTP_HOST]";
|
||||
$event_label = isset($_POST['event_label']) ? sanitize_text_field($_POST['event_label']) : 'Events';
|
||||
$event_slug = isset($_POST['event_slug']) ? sanitize_text_field($_POST['event_slug']) : 'event';
|
||||
$event_expire_on = isset($_POST['event_expire_on']) ? sanitize_text_field($_POST['event_expire_on']) : 'event_expire_datetime';
|
||||
$email_from_name = isset($_POST['email_from_name']) ? sanitize_text_field($_POST['email_from_name']) : get_bloginfo('name');
|
||||
$email_from_addrss = isset($_POST['email_from_address']) ? sanitize_text_field($_POST['email_from_address']) : "no-reply@$url";
|
||||
|
||||
|
||||
$general_settings_data = get_option('general_setting_sec') ? get_option('general_setting_sec') : [];
|
||||
$email_settings_data = get_option('email_setting_sec') ? get_option('email_setting_sec') : [];
|
||||
|
||||
$update_general_settings_arr = [
|
||||
'mep_event_label' => $event_label,
|
||||
'mep_event_expire_on_datetimes' => $event_expire_on,
|
||||
'mep_event_slug' => $event_slug
|
||||
];
|
||||
|
||||
$update_email_settings_arr = [
|
||||
'mep_email_form_name' => $email_from_name,
|
||||
'mep_email_form_email' => $email_from_addrss
|
||||
];
|
||||
|
||||
$new_general_settings_data = array_replace($general_settings_data,$update_general_settings_arr);
|
||||
$new_email_settings_data = array_replace($email_settings_data,$update_email_settings_arr);
|
||||
|
||||
|
||||
|
||||
update_option( 'general_setting_sec', $new_general_settings_data);
|
||||
update_option( 'email_setting_sec', $new_email_settings_data);
|
||||
update_option( 'mep_quick_setup', 'done');
|
||||
|
||||
|
||||
|
||||
flush_rewrite_rules();
|
||||
|
||||
|
||||
wp_redirect(admin_url('edit.php?post_type=mep_events&page=mep_event_welcome_page'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
add_action('mep_quick_setup_content_start', 'mep_quick_setup_welcome_content');
|
||||
function mep_quick_setup_welcome_content($tab){
|
||||
mep_quick_setup_start();
|
||||
}
|
||||
|
||||
add_action('mep_quick_setup_content_general', 'mep_quick_setup_general_content');
|
||||
function mep_quick_setup_general_content($tab){
|
||||
mep_quick_setup_general();
|
||||
}
|
||||
|
||||
|
||||
add_action('mep_quick_setup_content_done', 'mep_quick_setup_done_content');
|
||||
function mep_quick_setup_done_content($tab){
|
||||
mep_quick_setup_done();
|
||||
}
|
||||
|
||||
|
||||
do_action('mep_quick_setup_header');
|
||||
?>
|
||||
|
||||
|
||||
<div id="ttbm_quick_setup" class="wrap">
|
||||
|
||||
<div id="icon-tools" class="icon32"><br></div>
|
||||
<h2></h2>
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="qa_hidden" value="Y">
|
||||
<?php
|
||||
|
||||
?>
|
||||
<div class="welcome-tabs">
|
||||
|
||||
<ul class="tab-navs">
|
||||
<?php
|
||||
foreach ($mep_settings_tab as $tab){
|
||||
$id = $tab['id'];
|
||||
$title = $tab['title'];
|
||||
$active = $tab['active'];
|
||||
$data_visible = isset($tab['data_visible']) ? $tab['data_visible'] : '';
|
||||
$hidden = isset($tab['hidden']) ? $tab['hidden'] : false;
|
||||
?>
|
||||
<li <?php if(!empty($data_visible)): ?> data_visible="<?php echo esc_html($data_visible); ?>" <?php endif; ?> class="tab-nav <?php if($hidden) echo 'hidden';?> <?php if($active) echo 'active';?>" data-id="<?php echo esc_html($id); ?>"><?php echo $title; ?></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
foreach ($mep_settings_tab as $tab){
|
||||
$id = $tab['id'];
|
||||
$title = $tab['title'];
|
||||
$active = $tab['active'];
|
||||
?>
|
||||
|
||||
<div class="tab-content <?php if($active) echo 'active';?>" id="<?php echo esc_html($id); ?>">
|
||||
|
||||
<?php
|
||||
|
||||
do_action('mep_quick_setup_content_'.$id, $tab);
|
||||
do_action('mep_after_quick_setup_content', $tab);
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="next-prev">
|
||||
|
||||
<div class="prev"><span><?php echo sprintf(__('%s Previous','mage-eventpress'),'⟵')?></span></div>
|
||||
|
||||
<div class="next"><span><?php echo sprintf(__('Next %s','mage-eventpress'),'⟶')?></span></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear clearfix"></div>
|
||||
<?Php
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
function mep_quick_setup_start(){
|
||||
$status = mep_check_woocommerce();
|
||||
?>
|
||||
<h2><?php echo __('Event Manager and Tickets Selling Plugin', 'mage-eventpress'); ?></h2>
|
||||
<p><?php echo __('Thanks for choosing Event Manager and Tickets Selling Plugin for WooCommerce for your site, Please go step by step and choose some options to get started.', 'mage-eventpress'); ?></p>
|
||||
|
||||
<table class="wc_status_table widefat" cellspacing="0" id="status">
|
||||
<tr>
|
||||
<td data-export-label="WC Version">
|
||||
<?php if ( $status == 1 ) { ?>
|
||||
<?php _e( 'Woocommerce already installed and activated', 'mage-eventpress' ); ?>
|
||||
<?php } elseif ( $status == 0 ) { ?>
|
||||
<?php _e( 'Woocommerce need to install and active', 'mage-eventpress' ); ?>
|
||||
<?php } else { ?>
|
||||
<?php _e( 'Woocommerce already install , please activate it', 'mage-eventpress' ); ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td class="woo_btn_td">
|
||||
<?php if ( $status == 1 ) { ?>
|
||||
<span class="fas fa-check-circle"></span>
|
||||
<?php } elseif ( $status == 0 ) { ?>
|
||||
<button class="button" type="submit" name="install_and_active_woo_btn">Install & Active Now</button>
|
||||
<?php } else { ?>
|
||||
<button class="button" type="submit" name="active_woo_btn">Active Now</button>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
function mep_quick_setup_general(){
|
||||
$general_data = get_option('general_setting_sec');
|
||||
$email_data = get_option('email_setting_sec');
|
||||
|
||||
$url = (isset($_SERVER['HTTPS']) ? "" : "") . "$_SERVER[HTTP_HOST]";
|
||||
|
||||
$label = isset($general_data['mep_event_label']) ? $general_data['mep_event_label'] : 'Events';
|
||||
$slug = isset($general_data['mep_event_slug']) ? $general_data['mep_event_slug'] : 'event';
|
||||
$expire = isset($general_data['mep_event_expire_on_datetimes']) ? $general_data['mep_event_expire_on_datetimes'] : 'event_expire_datetime';
|
||||
$from_email = isset($email_data['mep_email_form_name']) ? $email_data['mep_email_form_name'] : get_bloginfo('name');
|
||||
$from_email_address = isset($email_data['mep_email_form_email']) ? $email_data['mep_email_form_email'] : "no-reply@$url";
|
||||
?>
|
||||
<div class="section">
|
||||
<div class="section-title"><?php echo __('General settings', 'mage-eventpress'); ?></div>
|
||||
<p class="description section-description"><?php echo __('Choose some general option.', 'mage-eventpress'); ?></p>
|
||||
<table class="wc_status_table widefat" cellspacing="0" id="status">
|
||||
<tr>
|
||||
<td><?php _e('Event Label:','mage-eventpress'); ?></td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td>
|
||||
<input type="text" name="event_label" value='<?php echo esc_html($label); ?>'/>
|
||||
<p class="info"><?php _e('It will change the event post type label on the entire plugin.','mage-eventpress'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Event Slug:','mage-eventpress'); ?></td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td>
|
||||
<input type="text" name="event_slug" value='<?php echo esc_html($slug); ?>'/>
|
||||
<p class="info"><?php _e('It will change the event slug on the entire plugin. Remember after changing this slug you need to flush permalinks. Just go to Settings->Permalinks hit the Save Settings button','mage-eventpress'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('When will the event expire:','mage-eventpress'); ?></td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td>
|
||||
<select class="regular" name="event_expire_on">
|
||||
<option value="event_start_datetime" <?php if($expire == 'event_start_datetime'){ echo 'Selected'; } ?>><?php _e('Event Start Time','mage-eventpress'); ?></option>
|
||||
<option value="event_expire_datetime" <?php if($expire == 'event_expire_datetime'){ echo 'Selected'; } ?>><?php _e('Event End Time','mage-eventpress'); ?></option>
|
||||
</select>
|
||||
<p class="info"><?php _e('Please select when the event will expire','mage-eventpress'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Email From Name:','mage-eventpress'); ?></td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td>
|
||||
<input type="text" name="email_from_name" value='<?php echo esc_html($from_email); ?>'/>
|
||||
<p class="info"><?php _e('Please enter the email from name','mage-eventpress'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('From Email Address:','mage-eventpress'); ?></td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td>
|
||||
|
||||
<input type="text" name="email_from_address" value='<?php echo esc_html($from_email_address); ?>'/>
|
||||
<p class="info"><?php _e('Please enter the email from name','mage-eventpress'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function mep_quick_setup_done(){
|
||||
?>
|
||||
<div class="section">
|
||||
<div class="section-title"><?php echo __('Finalize Setup', 'mage-eventpress'); ?></div>
|
||||
<p class="description section-description"><?php echo __('You are about to Finish & Save Event Manager and Tickets Selling Plugin setup process', 'mage-eventpress'); ?></p>
|
||||
<div class="setup_save_finish_area">
|
||||
<button type="submit" name="finish_quick_setup" class="button setup_save_finish"><?php _e('Finish & Save','mage-eventpress'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
function mep_check_woocommerce(): int {
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
$plugin_dir = ABSPATH . 'wp-content/plugins/woocommerce';
|
||||
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
return 1;
|
||||
} elseif ( is_dir( $plugin_dir ) ) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
<?php
|
||||
if (!defined('ABSPATH')) {
|
||||
die;
|
||||
} // Cannot access pages directly.
|
||||
|
||||
//Add admin page to the menu
|
||||
add_action('admin_menu', 'mep_event_status_admin_menu');
|
||||
function mep_event_status_admin_menu()
|
||||
{
|
||||
add_submenu_page('edit.php?post_type=mep_events', __('Status', 'mage-eventpress'), __('<span style="color:yellow">Status</span>', 'mage-eventpress'), 'manage_options', 'mep_event_status_page', 'mep_event_status_page');
|
||||
}
|
||||
function mep_event_status_page()
|
||||
{
|
||||
$wp_v = get_bloginfo( 'version' );
|
||||
$wc_v = WC()->version;
|
||||
$wc_i = mep_woo_install_check();
|
||||
$from_name = mep_get_option( 'mep_email_form_name', 'email_setting_sec', '');
|
||||
$from_email = mep_get_option( 'mep_email_form_email', 'email_setting_sec', '');
|
||||
?>
|
||||
|
||||
<!-- Create a header in the default WordPress 'wrap' container -->
|
||||
<div class="wrap"></div>
|
||||
<?php do_action('mep_event_status_notice_sec'); ?>
|
||||
<div class="wc_status_table_wrapper">
|
||||
<table class="wc_status_table widefat" cellspacing="0" id="status">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="WordPress Environment"><h2>Event Manager For Woocommerce Environment Status</h2></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-export-label="WC Version">WordPress Version:</td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td><?php if($wp_v > 5.5){ echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>'.esc_html($wp_v).'</span>'; }else{ echo '<span class="mep_warning"> <span class="dashicons dashicons-saved"></span>'.esc_html($wp_v).'</span>'; } ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td data-export-label="WC Version">Woocommerce Installed:</td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td><?php if($wc_i == 'Yes'){ echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>'.esc_html($wc_i).'</span>'; }else{ echo '<span class="mep_error"> <span class="dashicons dashicons-no-alt"></span>'.esc_html($wc_i).'</span>'; } ?></td>
|
||||
</tr>
|
||||
<?php if(mep_woo_install_check() == 'Yes'){ ?>
|
||||
<tr>
|
||||
<td data-export-label="WC Version">Woocommerce Version:</td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td><?php if($wc_v > 4.8){ echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>'.esc_html($wc_v).'</span>'; }else{ echo '<span class="mep_warning"> <span class="dashicons dashicons-no-alt"></span>'.esc_html($wc_v).'</span>'; } ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WC Version">Email From Name:</td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td><?php if($from_name){ echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>'.esc_html($from_name).'</span>'; }else{ echo '<span class="mep_error"> <span class="dashicons dashicons-no-alt"></span></span>'; } ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WC Version">From Email Address:</td>
|
||||
<td class="help"><span class="woocommerce-help-tip"></span></td>
|
||||
<td><?php if($from_email){ echo '<span class="mep_success"> <span class="dashicons dashicons-saved"></span>'.esc_html($from_email).'</span>'; }else{ echo '<span class="mep_error"> <span class="dashicons dashicons-no-alt"></span></span>'; } ?></td>
|
||||
</tr>
|
||||
<?php }
|
||||
do_action('mep_event_status_table_item_sec'); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|