File manager - Edit - /home/premiey/www/wp-includes/images/media/extensions.tar
Back
divi_amelia/includes/DiviAmelia.php 0000666 00000001602 15165413061 0013337 0 ustar 00 <?php class DIVI_DiviAmelia extends DiviExtension { /** * The gettext domain for the extension's translations. * * @since 1.0.0 * * @var string */ public $gettext_domain = 'divi-divi_amelia'; /** * The extension's WP Plugin name. * * @since 1.0.0 * * @var string */ public $name = 'divi_amelia'; /** * The extension's version * * @since 1.0.0 * * @var string */ public $version = '1.0.0'; /** * DIVI_DiviAmelia constructor. * * @param string $name * @param array $args */ public function __construct($name = 'divi_amelia', $args = array()) { $this->plugin_dir = plugin_dir_path(__FILE__); $this->plugin_dir_url = plugin_dir_url($this->plugin_dir); parent::__construct($name, $args); } } new DIVI_DiviAmelia; divi_amelia/includes/modules/StepBooking/style.css 0000666 00000000027 15165413061 0016370 0 ustar 00 .divi_step_booking { } divi_amelia/includes/modules/StepBooking/StepBooking.php 0000666 00000022413 15165413061 0017456 0 ustar 00 <?php use AmeliaBooking\Infrastructure\WP\GutenbergBlock\GutenbergBlock; use AmeliaBooking\Infrastructure\WP\Translations\BackendStrings; class DIVI_StepBooking extends ET_Builder_Module { public $slug = 'divi_step_booking'; public $vb_support = 'on'; private $categories = array(); private $services = array(); private $employees = array(); private $locations = array(); private $packages = array(); private $showPackages = true; public $type = array(); private $trigger_types = array(); protected $module_credits = array( 'module_uri' => '', 'author' => '', 'author_uri' => '', ); public function init() { $this->name = esc_html__(BackendStrings::getWordPressStrings()['step_booking_divi'], 'divi-divi_amelia'); $this->type['0'] = BackendStrings::getWordPressStrings()['show_all']; $this->type['services'] = BackendStrings::getCommonStrings()['services']; $this->type['packages'] = BackendStrings::getCommonStrings()['packages']; if (!is_admin()) { return; } $this->trigger_types = [ 'id' => BackendStrings::getWordPressStrings()['trigger_type_id'], 'class' => BackendStrings::getWordPressStrings()['trigger_type_class'] ]; $data = GutenbergBlock::getEntitiesData()['data']; $this->showPackages = !empty($data['packages']); $this->categories['0'] = BackendStrings::getWordPressStrings()['show_all_categories']; foreach ($data['categories'] as $category) { $this->categories[$category['id']] = $category['name']. ' (id: ' . $category['id'] . ')'; } $this->services['0'] = BackendStrings::getWordPressStrings()['show_all_services']; foreach ($data['servicesList'] as $service) { if ($service) { $this->services[$service['id']] = $service['name']. ' (id: ' . $service['id'] . ')'; } } $this->employees['0'] = BackendStrings::getWordPressStrings()['show_all_employees']; foreach ($data['employees'] as $employee) { $this->employees[$employee['id']] = $employee['firstName'] . ' ' . $employee['lastName'] . ' (id: ' . $employee['id'] . ')'; } $this->locations['0'] = BackendStrings::getWordPressStrings()['show_all_locations']; foreach ($data['locations'] as $location) { $this->locations[$location['id']] = $location['name']. ' (id: ' . $location['id'] . ')'; } $this->packages['0'] = BackendStrings::getWordPressStrings()['show_all_packages']; foreach ($data['packages'] as $package) { $this->packages[$package['id']] = $package['name']. ' (id: ' . $package['id'] . ')'; } } /** * Advanced Fields Config * * @return array */ public function get_advanced_fields_config() { return array( 'button' => false, 'link_options' => false ); } public function get_fields() { $array = array( 'booking_params' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['filter'], 'divi-divi_amelia'), 'type' => 'yes_no_button', 'options' => array( 'on' => esc_html__(BackendStrings::getCommonStrings()['yes'], 'divi-divi_amelia'), 'off' => esc_html__(BackendStrings::getCommonStrings()['no'], 'divi-divi_amelia'), ), 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ), 'categories' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_category'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->categories, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'services' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_service'], 'divi-divi_amelia'), 'type' => 'select', 'toggle_slug' => 'main_content', 'options' => $this->services, 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'employees' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_employee'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->employees, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'locations' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_location'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->locations, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), ); if ($this->showPackages) { $array['packages'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_package'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->packages, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ); $array['type'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['show_all'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->type, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on' )); } $array['trigger'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['manually_loading'], 'divi-divi_amelia'), 'type' => 'text', 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'description' => BackendStrings::getWordPressStrings()['manually_loading_description'], ); $array['trigger_type'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['trigger_type'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->trigger_types, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ); return $array; } public function checkValues($val) { if ($val !== null) { return !is_numeric($val) ? (strpos($val, 'id:') ? substr(explode('id: ', $val)[1], 0, -1) : '0') : $val; } return '0'; } public function render($attrs, $content = null, $render_slug = null) { $preselect = $this->props['booking_params']; $shortcode = '[ameliastepbooking'; $showAll = isset($this->props['type']) ? $this->props['type'] : null; $trigger = $this->props['trigger']; $trigger_type = $this->props['trigger_type']; if ($showAll !== null && $showAll !== '' && $showAll !== '0') { $shortcode .= ' show='.$showAll; } if ($trigger !== null && $trigger !== '') { $shortcode .= ' trigger='.$trigger; } if (!empty($trigger) && !empty($trigger_type)) { $shortcode .= ' trigger_type='.$trigger_type; } if ($preselect === 'on') { $category = $this->checkValues($this->props['categories']); $service = $this->checkValues($this->props['services']); $employee = $this->checkValues($this->props['employees']); $location = $this->checkValues($this->props['locations']); $package = $this->checkValues($this->props['packages']); if ($service !== '0') { $shortcode .= ' service=' . $service; } else if ($category !== '0') { $shortcode .= ' category=' . $category; } if ($employee !== '0') { $shortcode .= ' employee=' . $employee; } if ($location !== '0') { $shortcode .= ' location=' . $location; } if ($package !== '0') { $shortcode .= ' package=' . $package; } } $shortcode .= ']'; return do_shortcode($shortcode); } } new DIVI_StepBooking; divi_amelia/includes/modules/Booking/Booking.php 0000666 00000017052 15165413061 0015771 0 ustar 00 <?php use AmeliaBooking\Infrastructure\WP\GutenbergBlock\GutenbergBlock; use AmeliaBooking\Infrastructure\WP\Translations\BackendStrings; class DIVI_Booking extends ET_Builder_Module { public $slug = 'divi_booking'; public $vb_support = 'on'; private $categories = array(); private $services = array(); private $employees = array(); private $locations = array(); private $showPackages = true; public $type = array(); protected $module_credits = array( 'module_uri' => '', 'author' => '', 'author_uri' => '', ); public function init() { $this->name = esc_html__(BackendStrings::getWordPressStrings()['booking_divi'], 'divi-divi_amelia'); $this->type['0'] = BackendStrings::getWordPressStrings()['show_all']; $this->type['services'] = BackendStrings::getCommonStrings()['services']; $this->type['packages'] = BackendStrings::getCommonStrings()['packages']; if (!is_admin()) { return; } $data = GutenbergBlock::getEntitiesData()['data']; $this->showPackages = !empty($data['packages']); $this->categories['0'] = BackendStrings::getWordPressStrings()['show_all_categories']; foreach ($data['categories'] as $category) { $this->categories[$category['id']] = $category['name']. ' (id: ' . $category['id'] . ')'; } $this->services['0'] = BackendStrings::getWordPressStrings()['show_all_services']; foreach ($data['servicesList'] as $service) { if ($service) { $this->services[$service['id']] = $service['name']. ' (id: ' . $service['id'] . ')'; } } $this->employees['0'] = BackendStrings::getWordPressStrings()['show_all_employees']; foreach ($data['employees'] as $employee) { $this->employees[$employee['id']] = $employee['firstName'] . ' ' . $employee['lastName'] . ' (id: ' . $employee['id'] . ')'; } $this->locations['0'] = BackendStrings::getWordPressStrings()['show_all_locations']; foreach ($data['locations'] as $location) { $this->locations[$location['id']] = $location['name']. ' (id: ' . $location['id'] . ')'; } } /** * Advanced Fields Config * * @return array */ public function get_advanced_fields_config() { return array( 'button' => false, 'link_options' => false ); } public function get_fields() { $array = array( 'booking_params' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['filter'], 'divi-divi_amelia'), 'type' => 'yes_no_button', 'options' => array( 'on' => esc_html__(BackendStrings::getCommonStrings()['yes'], 'divi-divi_amelia'), 'off' => esc_html__(BackendStrings::getCommonStrings()['no'], 'divi-divi_amelia'), ), 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ), 'categories' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_category'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->categories, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'services' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_service'], 'divi-divi_amelia'), 'type' => 'select', 'toggle_slug' => 'main_content', 'options' => $this->services, 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'employees' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_employee'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->employees, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'locations' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_location'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->locations, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), ); if ($this->showPackages) { $array['type'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['show_all'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->type, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on' )); } $array['trigger'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['manually_loading'], 'divi-divi_amelia'), 'type' => 'text', 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'description' => BackendStrings::getWordPressStrings()['manually_loading_description'], ); return $array; } public function checkValues($val) { if ($val !== null) { return !is_numeric($val) ? (strpos($val, 'id:') ? substr(explode('id: ', $val)[1], 0, -1) : '0') : $val; } return '0'; } public function render($attrs, $content = null, $render_slug = null) { $preselect = $this->props['booking_params']; $shortcode = '[ameliabooking'; $showAll = isset($this->props['type']) ? $this->props['type'] : null; $trigger = $this->props['trigger']; if ($showAll !== null && $showAll !== '' && $showAll !== '0') { $shortcode .= ' show='.$showAll; } if ($trigger !== null && $trigger !== '') { $shortcode .= ' trigger='.$trigger; } if ($preselect === 'on') { $category = $this->checkValues($this->props['categories']); $service = $this->checkValues($this->props['services']); $employee = $this->checkValues($this->props['employees']); $location = $this->checkValues($this->props['locations']); if ($service !== '0') { $shortcode .= ' service=' . $service; } else if ($category !== '0') { $shortcode .= ' category=' . $category; } if ($employee !== '0') { $shortcode .= ' employee=' . $employee; } if ($location !== '0') { $shortcode .= ' location=' . $location; } } $shortcode .= ']'; return do_shortcode($shortcode); } } new DIVI_Booking; divi_amelia/includes/modules/Booking/style.css 0000666 00000000022 15165413061 0015527 0 ustar 00 .divi_booking { } divi_amelia/includes/modules/EventsList/EventsList.php 0000666 00000012633 15165413061 0017211 0 ustar 00 <?php use AmeliaBooking\Infrastructure\WP\GutenbergBlock\GutenbergBlock; use AmeliaBooking\Infrastructure\WP\Translations\BackendStrings; class DIVI_EventsList extends ET_Builder_Module { public $slug = 'divi_events_list_booking'; public $vb_support = 'on'; private $events = array(); private $tags = array(); protected $module_credits = array( 'module_uri' => '', 'author' => '', 'author_uri' => '', ); public function init() { $this->name = esc_html__(BackendStrings::getWordPressStrings()['events_list_booking_divi'], 'divi-divi_amelia'); if (!is_admin()) { return; } $data = GutenbergBlock::getEntitiesData()['data']; $this->events['0'] = BackendStrings::getWordPressStrings()['show_all_events']; foreach ($data['events'] as $event) { $this->events[$event['id']] = $event['name'] . ' (id: ' . $event['id'] . ') - ' . $event['formattedPeriodStart']; } $this->tags['0'] = BackendStrings::getWordPressStrings()['show_all_tags']; foreach ($data['tags'] as $tag) { $this->tags[$tag['name']] = $tag['name'] . ' (id: ' . $tag['id'] . ')'; } } /** * Advanced Fields Config * * @return array */ public function get_advanced_fields_config() { return array( 'button' => false, 'link_options' => false ); } public function get_fields() { return array( 'booking_params' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['filter'], 'divi-divi_amelia'), 'type' => 'yes_no_button', 'options' => array( 'on' => esc_html__(BackendStrings::getCommonStrings()['yes'], 'divi-divi_amelia'), 'off' => esc_html__(BackendStrings::getCommonStrings()['no'], 'divi-divi_amelia'), ), 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ), 'events' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_event'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->events, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'tags' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_tag'], 'divi-divi_amelia'), 'type' => 'select', 'toggle_slug' => 'main_content', 'options' => $this->tags, 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'recurring' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['recurring_event'], 'divi-divi_amelia'), 'type' => 'yes_no_button', 'options' => array( 'on' => esc_html__(BackendStrings::getCommonStrings()['yes'], 'divi-divi_amelia'), 'off' => esc_html__(BackendStrings::getCommonStrings()['no'], 'divi-divi_amelia'), ), 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'trigger' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['manually_loading'], 'divi-divi_amelia'), 'type' => 'text', 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'description' => BackendStrings::getWordPressStrings()['manually_loading_description'], ), ); } public function checkValues($val) { if ($val !== null) { $matches = []; $id = preg_match('/id: \d+\)/', $val, $matches); return !is_numeric($val) ? ($id && count($matches) ? substr($matches[0], 4, -1) : '0') : $val; } return '0'; } public function render($attrs, $content = null, $render_slug = null) { $preselect = $this->props['booking_params']; $shortcode = '[ameliaeventslistbooking'; $trigger = $this->props['trigger']; if ($trigger !== null && $trigger !== '') { $shortcode .= ' trigger='.$trigger; } if ($preselect === 'on') { $event = $this->checkValues($this->props['events']); $tag = $this->props['tags']; if ($event !== '0') { $shortcode .= ' event=' . $event; } if ($tag !== null && $tag !== '' && $tag !== '0') { $shortcode .= " tag='" . $tag . "'"; } $recurring = $this->props['recurring']; if ($recurring === 'on') { $shortcode .= ' recurring=1'; } } $shortcode .= ']'; return do_shortcode($shortcode); } } new DIVI_EventsList; divi_amelia/includes/modules/EventsList/style.css 0000666 00000000036 15165413061 0016244 0 ustar 00 .divi_events_list_booking { } divi_amelia/includes/modules/CatalogBooking/CatalogBooking.php 0000666 00000024401 15165413061 0020553 0 ustar 00 <?php use AmeliaBooking\Infrastructure\WP\GutenbergBlock\GutenbergBlock; use AmeliaBooking\Infrastructure\WP\Translations\BackendStrings; class DIVI_CatalogBooking extends ET_Builder_Module { public $slug = 'divi_catalog_booking'; public $vb_support = 'on'; public $type = array(); private $categories = array(); private $services = array(); private $packages = array(); private $employees = array(); private $catalog = array(); private $locations = array(); private $showPackages = true; private $trigger_types = array(); protected $module_credits = array( 'module_uri' => '', 'author' => '', 'author_uri' => '', ); public function init() { $this->name = esc_html__(BackendStrings::getWordPressStrings()['catalog_booking_divi'], 'divi-divi_amelia'); $this->type['0'] = BackendStrings::getWordPressStrings()['show_all']; $this->type['services'] = BackendStrings::getCommonStrings()['services']; $this->type['packages'] = BackendStrings::getCommonStrings()['packages']; if (!is_admin()) { return; } $this->trigger_types = [ 'id' => BackendStrings::getWordPressStrings()['trigger_type_id'], 'class' => BackendStrings::getWordPressStrings()['trigger_type_class'] ]; $data = GutenbergBlock::getEntitiesData()['data']; $this->showPackages = !empty($data['packages']); $this->catalog['0'] = BackendStrings::getWordPressStrings()['show_catalog']; $this->catalog['category'] = BackendStrings::getWordPressStrings()['show_category']; $this->catalog['service'] = BackendStrings::getWordPressStrings()['show_service']; if ($this->showPackages) { $this->catalog['package'] = BackendStrings::getWordPressStrings()['show_package']; } $this->categories['0'] = BackendStrings::getWordPressStrings()['choose_category']; foreach ($data['categories'] as $category) { $this->categories[$category['id']] = $category['name'] . ' (id: ' . $category['id'] . ')'; } $this->services['0'] = BackendStrings::getWordPressStrings()['choose_service']; foreach ($data['servicesList'] as $service) { if ($service) { $this->services[$service['id']] = $service['name']. ' (id: ' . $service['id'] . ')'; } } $this->packages['0'] = BackendStrings::getWordPressStrings()['choose_package']; foreach ($data['packages'] as $package) { $this->packages[$package['id']] = $package['name']. ' (id: ' . $package['id'] . ')'; } $this->employees['0'] = BackendStrings::getWordPressStrings()['show_all_employees']; foreach ($data['employees'] as $employee) { $this->employees[$employee['id']] = $employee['firstName'] . ' ' . $employee['lastName'] . ' (id: ' . $employee['id'] . ')'; } $this->locations['0'] = BackendStrings::getWordPressStrings()['show_all_locations']; foreach ($data['locations'] as $location) { $this->locations[$location['id']] = $location['name'] . ' (id: ' . $location['id'] . ')'; } } /** * Advanced Fields Config * * @return array */ public function get_advanced_fields_config() { return array( 'button' => false, 'link_options' => false ); } public function get_fields() { $array = array( 'catalog' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_catalog_view'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->catalog, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ), 'categories' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_category'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->categories, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'catalog' => 'category', ), ), 'services' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_service'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->services, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'catalog' => 'service', ), ), 'packages' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_package'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->packages, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'catalog' => 'package', ), ), 'booking_params' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['filter'], 'divi-divi_amelia'), 'type' => 'yes_no_button', 'options' => array( 'on' => esc_html__(BackendStrings::getCommonStrings()['yes'], 'divi-divi_amelia'), 'off' => esc_html__(BackendStrings::getCommonStrings()['no'], 'divi-divi_amelia'), ), 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ), 'employees' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_employee'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->employees, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'locations' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_location'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->locations, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), ); if ($this->showPackages) { $array['type'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['show_all'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->type, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on' )); } $array['trigger'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['manually_loading'], 'divi-divi_amelia'), 'type' => 'text', 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'description' => BackendStrings::getWordPressStrings()['manually_loading_description'], ); $array['trigger_type'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['trigger_type'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->trigger_types, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ); return $array; } public function checkValues($val) { if ($val !== null) { return !is_numeric($val) ? (strpos($val, 'id:') ? substr(explode('id: ', $val)[1], 0, -1) : '0') : $val; } return '0'; } public function render($attrs, $content = null, $render_slug = null) { $preselect = $this->props['booking_params']; $shortcode = '[ameliacatalogbooking'; $trigger = $this->props['trigger']; $trigger_type = $this->props['trigger_type']; $showAll = isset($this->props['type']) ? $this->props['type'] : null; if ($showAll !== null && $showAll !== '' && $showAll !== '0') { $shortcode .= ' show='.$showAll; } if ($trigger !== null && $trigger !== '') { $shortcode .= ' trigger='.$trigger; } if (!empty($trigger) && !empty($trigger_type)) { $shortcode .= ' trigger_type='.$trigger_type; } $catalog = $this->props['catalog']; if ($catalog !== '0') { $category = $this->checkValues($this->props['categories']); $service = $this->checkValues($this->props['services']); $package1 = $this->checkValues($this->props['packages']); if ($category !== '0' && $catalog === 'category') { $shortcode .= ' category=' . $category; } else if ($service !== '0' && $catalog === 'service') { $shortcode .= ' service=' . $service; } else if ($package1 !== '0' && $catalog === 'package') { $shortcode .= ' package=' . $package1; } } if ($preselect === 'on') { $employee = $this->checkValues($this->props['employees']); $location = $this->checkValues($this->props['locations']); if ($employee !== '0') { $shortcode .= ' employee=' . $employee; } if ($location !== '0') { $shortcode .= ' location=' . $location; } } $shortcode .= ']'; return do_shortcode($shortcode); } } new DIVI_CatalogBooking; divi_amelia/includes/modules/CatalogBooking/style.css 0000666 00000000032 15165413061 0017023 0 ustar 00 .divi_catalog_booking { } divi_amelia/includes/modules/Catalog/style.css 0000666 00000000023 15165413061 0015512 0 ustar 00 .divi_catalog { } divi_amelia/includes/modules/Catalog/Catalog.php 0000666 00000022704 15165413061 0015735 0 ustar 00 <?php use AmeliaBooking\Infrastructure\WP\GutenbergBlock\GutenbergBlock; use AmeliaBooking\Infrastructure\WP\Translations\BackendStrings; class DIVI_Catalog extends ET_Builder_Module { public $slug = 'divi_catalog'; public $vb_support = 'on'; public $type = array(); private $categories = array(); private $services = array(); private $packages = array(); private $employees = array(); private $catalog = array(); private $locations = array(); private $showPackages = true; protected $module_credits = array( 'module_uri' => '', 'author' => '', 'author_uri' => '', ); public function init() { $this->name = esc_html__(BackendStrings::getWordPressStrings()['catalog_divi'], 'divi-divi_amelia'); $this->type['0'] = BackendStrings::getWordPressStrings()['show_all']; $this->type['services'] = BackendStrings::getCommonStrings()['services']; $this->type['packages'] = BackendStrings::getCommonStrings()['packages']; if (!is_admin()) { return; } $data = GutenbergBlock::getEntitiesData()['data']; $this->showPackages = !empty($data['packages']); $this->catalog['0'] = BackendStrings::getWordPressStrings()['show_catalog']; $this->catalog['category'] = BackendStrings::getWordPressStrings()['show_category']; $this->catalog['service'] = BackendStrings::getWordPressStrings()['show_service']; if ($this->showPackages) { $this->catalog['package'] = BackendStrings::getWordPressStrings()['show_package']; } $this->categories['0'] = BackendStrings::getWordPressStrings()['select_category']; foreach ($data['categories'] as $category) { $this->categories[$category['id']] = $category['name'] . ' (id: ' . $category['id'] . ')'; } $this->services['0'] = BackendStrings::getWordPressStrings()['select_service']; foreach ($data['servicesList'] as $service) { if ($service) { $this->services[$service['id']] = $service['name']. ' (id: ' . $service['id'] . ')'; } } $this->packages['0'] = BackendStrings::getWordPressStrings()['select_package']; foreach ($data['packages'] as $package) { $this->packages[$package['id']] = $package['name']. ' (id: ' . $package['id'] . ')'; } $this->employees['0'] = BackendStrings::getWordPressStrings()['show_all_employees']; foreach ($data['employees'] as $employee) { $this->employees[$employee['id']] = $employee['firstName'] . ' ' . $employee['lastName'] . ' (id: ' . $employee['id'] . ')'; } $this->locations['0'] = BackendStrings::getWordPressStrings()['show_all_locations']; foreach ($data['locations'] as $location) { $this->locations[$location['id']] = $location['name'] . ' (id: ' . $location['id'] . ')'; } } /** * Advanced Fields Config * * @return array */ public function get_advanced_fields_config() { return array( 'button' => false, 'link_options' => false ); } public function get_fields() { $array = array( 'catalog' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_catalog_view'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->catalog, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ), 'categories' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_category'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->categories, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'catalog' => 'category', ), ), 'services' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_service'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->services, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'catalog' => 'service', ), ), 'packages' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_package'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->packages, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'catalog' => 'package', ), ), 'booking_params' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['filter'], 'divi-divi_amelia'), 'type' => 'yes_no_button', 'options' => array( 'on' => esc_html__(BackendStrings::getCommonStrings()['yes'], 'divi-divi_amelia'), 'off' => esc_html__(BackendStrings::getCommonStrings()['no'], 'divi-divi_amelia'), ), 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ), 'employees' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_employee'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->employees, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'locations' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_location'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->locations, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), ); if ($this->showPackages) { $array['type'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['show_all'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->type, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on' )); } $array['trigger'] = array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['manually_loading'], 'divi-divi_amelia'), 'type' => 'text', 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'description' => BackendStrings::getWordPressStrings()['manually_loading_description'], ); return $array; } public function checkValues($val) { if ($val !== null) { return !is_numeric($val) ? (strpos($val, 'id:') ? substr(explode('id: ', $val)[1], 0, -1) : '0') : $val; } return '0'; } public function render($attrs, $content = null, $render_slug = null) { $preselect = $this->props['booking_params']; $shortcode = '[ameliacatalog'; $trigger = $this->props['trigger']; $showAll = isset($this->props['type']) ? $this->props['type'] : null; if ($showAll !== null && $showAll !== '' && $showAll !== '0') { $shortcode .= ' show='.$showAll; } if ($trigger !== null && $trigger !== '') { $shortcode .= ' trigger='.$trigger; } $catalog = $this->props['catalog']; if ($catalog !== '0') { $category = $this->checkValues($this->props['categories']); $service = $this->checkValues($this->props['services']); $package1 = $this->checkValues($this->props['packages']); if ($category !== '0' && $catalog === 'category') { $shortcode .= ' category=' . $category; } else if ($service !== '0' && $catalog === 'service') { $shortcode .= ' service=' . $service; } else if ($package1 !== '0' && $catalog === 'package') { $shortcode .= ' package=' . $package1; } } if ($preselect === 'on') { $employee = $this->checkValues($this->props['employees']); $location = $this->checkValues($this->props['locations']); if ($employee !== '0') { $shortcode .= ' employee=' . $employee; } if ($location !== '0') { $shortcode .= ' location=' . $location; } } $shortcode .= ']'; return do_shortcode($shortcode); } } new DIVI_Catalog; divi_amelia/includes/modules/Events/Events.php 0000666 00000014340 15165413061 0015516 0 ustar 00 <?php use AmeliaBooking\Infrastructure\WP\GutenbergBlock\GutenbergBlock; use AmeliaBooking\Infrastructure\WP\Translations\BackendStrings; class DIVI_Events extends ET_Builder_Module { public $slug = 'divi_events'; public $vb_support = 'on'; public $type = array(); private $events = array(); private $tags = array(); protected $module_credits = array( 'module_uri' => '', 'author' => '', 'author_uri' => '', ); public function init() { $this->name = esc_html__(BackendStrings::getWordPressStrings()['events_divi'], 'divi-divi_amelia'); $this->type['list'] = BackendStrings::getWordPressStrings()['show_event_view_list']; if (!AMELIA_LITE_VERSION) { $this->type['calendar'] = BackendStrings::getWordPressStrings()['show_event_view_calendar']; } if (!is_admin()) { return; } $data = GutenbergBlock::getEntitiesData()['data']; $this->events['0'] = BackendStrings::getWordPressStrings()['show_all_events']; foreach ($data['events'] as $event) { $this->events[$event['id']] = $event['name'] . ' (id: ' . $event['id'] . ') - ' . $event['formattedPeriodStart']; } $this->tags['0'] = BackendStrings::getWordPressStrings()['show_all_tags']; foreach ($data['tags'] as $tag) { $this->tags[$tag['name']] = $tag['name'] . ' (id: ' . $tag['id'] . ')'; } } /** * Advanced Fields Config * * @return array */ public function get_advanced_fields_config() { return array( 'button' => false, 'link_options' => false ); } public function get_fields() { return array( 'type' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['show_event_view_type'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->type, 'default' => array_keys($this->type)[0], 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ), 'booking_params' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['filter'], 'divi-divi_amelia'), 'type' => 'yes_no_button', 'options' => array( 'on' => esc_html__(BackendStrings::getCommonStrings()['yes'], 'divi-divi_amelia'), 'off' => esc_html__(BackendStrings::getCommonStrings()['no'], 'divi-divi_amelia'), ), 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', ), 'events' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_event'], 'divi-divi_amelia'), 'type' => 'select', 'options' => $this->events, 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'tags' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['select_tag'], 'divi-divi_amelia'), 'type' => 'select', 'toggle_slug' => 'main_content', 'options' => $this->tags, 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'recurring' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['recurring_event'], 'divi-divi_amelia'), 'type' => 'yes_no_button', 'options' => array( 'on' => esc_html__(BackendStrings::getCommonStrings()['yes'], 'divi-divi_amelia'), 'off' => esc_html__(BackendStrings::getCommonStrings()['no'], 'divi-divi_amelia'), ), 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'show_if' => array( 'booking_params' => 'on', ), ), 'trigger' => array( 'label' => esc_html__(BackendStrings::getWordPressStrings()['manually_loading'], 'divi-divi_amelia'), 'type' => 'text', 'toggle_slug' => 'main_content', 'option_category' => 'basic_option', 'description' => BackendStrings::getWordPressStrings()['manually_loading_description'], ), ); } public function checkValues($val) { if ($val !== null) { $matches = []; $id = preg_match('/id: \d+\)/', $val, $matches); return !is_numeric($val) ? ($id && count($matches) ? substr($matches[0], 4, -1) : '0') : $val; } return '0'; } public function render($attrs, $content = null, $render_slug = null) { $preselect = $this->props['booking_params']; $shortcode = '[ameliaevents'; $type = $this->props['type']; $trigger = $this->props['trigger']; if ($type !== null && $type !== '' && $type !== '0') { $shortcode .= ' type='.$type; } if ($trigger !== null && $trigger !== '') { $shortcode .= ' trigger='.$trigger; } if ($preselect === 'on') { $event = $this->checkValues($this->props['events']); $tag = $this->props['tags']; if ($event !== '0') { $shortcode .= ' event=' . $event; } if ($tag !== null && $tag !== '' && $tag !== '0') { $shortcode .= ' tag="' . $tag . '"'; } $recurring = $this->props['recurring']; if ($recurring === 'on') { $shortcode .= ' recurring=1'; } } $shortcode .= ']'; return do_shortcode($shortcode); } } new DIVI_Events; divi_amelia/includes/modules/Events/style.css 0000666 00000000022 15165413061 0015403 0 ustar 00 .divi_events { } divi_amelia/includes/loader.php 0000666 00000000521 15165413061 0012600 0 ustar 00 <?php if (!class_exists('ET_Builder_Element')) { return; } $module_files = glob(__DIR__ . '/modules/*/*.php'); // Load custom Divi Builder modules foreach ((array) $module_files as $module_file) { if ($module_file && preg_match("/\/modules\/\b([^\/]+)\/\\1\.php$/", $module_file)) { require_once $module_file; } } divi_amelia/includes/fields/Input/style.css 0000666 00000001421 15165413061 0015040 0 ustar 00 input.divi-input { background: #f1f5f9; max-height: 30px; border: 0; border-radius: 3px; padding: 7px 10px; box-sizing: border-box; transition: background 200ms ease; color: #4C5866; font-family: 'Open Sans', Helvetica, Roboto, Arial, sans-serif; font-size: 13px; font-weight: 600; line-height: normal; display: block; width: 100%; } input.divi-input:focus { background: #e6ecf2; } input.divi-input::-webkit-input-placeholder { color: #98a7b8; } input.divi-input:-moz-placeholder { color: #98a7b8; } input.divi-input::-moz-placeholder { color: #98a7b8; } input.divi-input:-ms-input-placeholder { color: #98a7b8; } input.divi-input[readonly] { background: #ffffff !important; border: 1px solid #eaedf0 !important; cursor: not-allowed; } divi_amelia/includes/images/amelia-logo-admin-icon.svg 0000666 00000003766 15165413061 0017027 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <svg width="20px" height="20px" viewBox="0 0 24 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch --> <title>amelia-logo-symbol@svg</title> <desc>Created with Sketch.</desc> <defs></defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="amelia-logo-symbol" fill-rule="nonzero"> <path d="M11.4937358,10.7089033 L11.4937358,2.00347742 C11.4937358,0.463573647 9.83438046,-0.498899048 8.50694847,0.271096622 L0.995613218,4.6279253 C0.379532759,4.98520749 1.74329502e-05,5.64565414 1.74329502e-05,6.36030609 L1.74329502e-05,15.0243117 C1.74329502e-05,16.5606252 1.65222529,17.5235357 2.97965728,16.7608958 L10.4910797,12.4454874 C11.1110826,12.0891685 11.4937358,11.4265326 11.4937358,10.7089033" id="Fill-1" fill="#1A84EE"></path> <path d="M13.4849535,2.00346866 L13.4849535,10.7088945 C13.4849535,11.4265238 13.8676068,12.0891597 14.4876097,12.4453911 L21.9991193,16.7608871 C23.3265512,17.5235269 24.9787591,16.5606164 24.9787591,15.024303 L24.9787591,6.36029734 C24.9787591,5.64564538 24.5992438,4.98519874 23.9831633,4.62791654 L16.4717409,0.271000296 C15.1443089,-0.498907805 13.4849535,0.46356489 13.4849535,2.00346866" id="Fill-3" fill="#005AEE"></path> <g id="Group-7" transform="translate(2.876437, 13.843371)" fill="#3BA6FF"> <path d="M8.62445527,0.32630898 L1.0701478,4.66641195 C-0.263647222,5.43264214 -0.267569636,7.36354223 1.06300029,8.13537686 L8.61730776,12.5170752 C9.23338822,12.8744449 9.99241887,12.8744449 10.6084993,12.5170752 L18.162894,8.13537686 C19.4934639,7.36354223 19.4895415,5.43264214 18.1557465,4.66641195 L10.601439,0.32630898 C9.98893228,-0.0256314947 9.23687481,-0.0256314947 8.62445527,0.32630898" id="Fill-5"></path> </g> </g> </g> </svg>