wpcap_content_layout_options(); $this->wpcap_design_options(); $this->wpcap_filter_options(); } /** * Content Layout Options. */ private function wpcap_content_layout_options() { $this->start_controls_section( 'section_layout', [ 'label' => esc_html__('Layout', 'fieldday'), ] ); /* $this->add_control( 'activity_layout', [ 'label' => __('View', 'fieldday'), 'type' => Controls_Manager::SELECT, 'options' => [ '1' => __('1 Column view', 'fieldday'), '2' => __('2 Columns view', 'fieldday'), '3' => __('3 Colums view', 'fieldday'), '4' => __('4 Columns view', 'fieldday'), '5' => __('5 Columns view', 'fieldday'), '6' => __('6 Columns view', 'fieldday') ], 'default' => '3' ] ); $this->add_control( 'activity_style', [ 'label' => __('Style', 'fieldday'), 'type' => Controls_Manager::SELECT, 'options' => [ 'alternate' => __('Alternate', 'fieldday'), 'simple' => __('Simple', 'fieldday') ], 'default' => '3' ] ); */ $this->add_control( 'show_image', [ 'label' => __('Image', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_title', [ 'label' => __('Title', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_bringing', [ 'label' => __('Bringing', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_prerequisite', [ 'label' => __('Prerequisites', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_additionalCharges', [ 'label' => __('Additional Charges', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_importantdates', [ 'label' => __('Important Dates', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_dailyRoutineS', [ 'label' => __('Typical Day At Camp', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_extendedcareoptions', [ 'label' => __('Extended Care Options', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_otheroptions', [ 'label' => __('Other Options', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_reviews', [ 'label' => __('Show Reviews', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_pickuplocation', [ 'label' => __('Pick-up & Drop Off Location', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'show_cancellationPolicy', [ 'label' => __('Cancellation Policy', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Show', 'fieldday'), 'label_off' => __('Hide', 'fieldday'), 'default' => 'yes', 'separator' => 'before', ] ); /* $this->add_control( 'title_tag', [ 'label' => __('Title HTML Tag', 'fieldday'), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', 'p' => 'p', ], 'default' => 'h3', 'condition' => [ 'show_title' => 'yes', ], ] ); */ $this->end_controls_section(); } private function wpcap_image_options() { $this->start_controls_section( 'section_image_design_options', [ 'label' => __('Image Options', 'fieldday'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'activity_image_effect', [ 'label' => esc_html__('Hover Effect', 'fieldday'), 'type' => Controls_Manager::SELECT, 'options' => [ 'none' => esc_html__('None', 'fieldday'), 'km_zoom-in' => esc_html__('Zoom In', 'fieldday'), 'km_zoom-out' => esc_html__('Zoom Out', 'fieldday'), 'km_blur' => esc_html__('Blur', 'fieldday'), 'km_slide' => esc_html__('Slide', 'fieldday'), 'km_rotate' => esc_html__('Rotate', 'fieldday'), 'km_flashing' => esc_html__('Flashing', 'fieldday'), 'km_shine' => esc_html__('Shine', 'fieldday'), 'km_circle' => esc_html__('Circle', 'fieldday') ], 'default' => 'km_blur', ] ); $this->add_control( 'activity_image_overlay', [ 'label' => __('Image Overlay', 'elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .km_single_featured_activity .km_featured_session_img::after' => 'background: {{VALUE}};', ] ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'img_border', 'label' => __('Border', 'plugin-domain'), 'selector' => '{{WRAPPER}} .km_single_featured_activity .km_featured_session_img', ] ); $this->add_control( 'image_border_radious', [ 'label' => __('Border Radius', 'post-grid-elementor-addon'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .km_single_featured_activity .km_featured_session_img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'image_dimension', [ 'label' => __( 'Image Dimension', 'plugin-domain' ), 'type' => \Elementor\Controls_Manager::IMAGE_DIMENSIONS, 'description' => __( 'Crop the original image size to any custom size. Set custom width or height to keep the original size ratio.', 'plugin-name' ), 'default' => [ 'width' => '', 'height' => '', ], ] ); $this->add_control( 'default_image', [ 'label' => __('Default Image', 'fieldday'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], ] ); $this->end_controls_section(); } private function boxDesignOptions() { $this->start_controls_section( 'section_box_design_options', [ 'label' => __('Box Options', 'fieldday'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'entrance_animation', [ 'label' => __('Entrance Animation', 'fieldday'), 'type' => \Elementor\Controls_Manager::ANIMATION, 'prefix_class' => 'animated ', ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'background', 'label' => __( 'Background', 'plugin-domain' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .km_single_featured_activity', ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'border', 'label' => __('Border', 'plugin-domain'), 'selector' => '{{WRAPPER}} .km_single_featured_activity', ] ); $this->add_control( 'box-radious', [ 'label' => __('Border Radius', 'post-grid-elementor-addon'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .km_single_featured_activity' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'box-padding', [ 'label' => __('Box Padding', 'post-grid-elementor-addon'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .km_single_featured_activity' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'box-margin', [ 'label' => __('Box margin', 'post-grid-elementor-addon'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .km_single_featured_activity' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => ['5px'], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'label' => __('Box Shadow', 'plugin-domain'), 'selector' => '{{WRAPPER}} .km_single_featured_activity', ] ); $this->end_controls_section(); } private function titleDesginOptions() { $this->start_controls_section( 'section_design_options', [ 'label' => __('Title', 'elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => __('Color', 'elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .km_featured_activity_title' => 'color: {{VALUE}};', ] ] ); $this->add_control( 'title-margin', [ 'label' => __('margin', 'post-grid-elementor-addon'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .km_featured_activity_title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => ['5px'], ] ); $this->add_control( 'title-padding', [ 'label' => __('Padding', 'post-grid-elementor-addon'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .km_featured_activity_title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => __('Typography', 'fieldday'), //'scheme' => Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .km_featured_activity_title', ] ); $this->add_responsive_control( 'align', [ 'label' => esc_html__( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => esc_html__( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .km_featured_activity_title' => 'text-align: {{VALUE}};', ], ] ); $this->end_controls_section(); } private function contentDesignOptions() { $this->start_controls_section( 'section_design_options_description', [ 'label' => __('Content', 'elementor'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'heading_color', [ 'label' => __('Heading Color', 'elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .km_act_heading' => 'color: {{VALUE}} !important;', ] ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'heading_typography', 'label' => __('Heading Typography', 'fieldday'), //'scheme' => Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .km_act_heading', ] ); $this->add_responsive_control( 'heading_align', [ 'label' => esc_html__( 'Heading Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => esc_html__( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .km_act_heading' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'text_color', [ 'label' => __('Text Color', 'elementor'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .km_activity_text , {{WRAPPER}} .km_elem_marker' => 'color: {{VALUE}} !important;', ] ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'text_typography', 'label' => __('Text Typography', 'fieldday'), //'scheme' => Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .km_activity_text', ] ); $this->add_responsive_control( 'text_align', [ 'label' => esc_html__( 'Text Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => esc_html__( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .km_activity_text' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'discount-padding', [ 'label' => __('Padding', 'post-grid-elementor-addon'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .km_activity_discounts, {{WRAPPER}} .km_activity_agegroup, {{WRAPPER}} .km_activity_available_dates, {{WRAPPER}} .km_activity_description, {{WRAPPER}} .km_activity_bringing_needs, {{WRAPPER}} .km_activity_daily_routine' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'show_discount' => 'yes', ], ] ); $this->add_control( 'discount-margin', [ 'label' => __('margin', 'post-grid-elementor-addon'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .km_activity_discounts, {{WRAPPER}} .km_activity_agegroup, {{WRAPPER}} .km_activity_available_dates, {{WRAPPER}} .km_activity_description, {{WRAPPER}} .km_activity_bringing_needs, {{WRAPPER}} .km_activity_daily_routine' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => ['5px'], 'condition' => [ 'show_discount' => 'yes', ], ] ); $this->end_controls_section(); } /** * design controls */ private function wpcap_design_options() { $this->titleDesginOptions(); $this->contentDesignOptions(); $this->wpcap_image_options(); $this->boxDesignOptions(); } /** * filter controls for sessions */ private function wpcap_filter_options() { $this->start_controls_section( 'section_filter_options', [ 'label' => __('Filter Options', 'elementor'), ] ); $this->add_control( 'session_filters', [ 'label' => __('Enable Filters', 'fieldday'), 'type' => Controls_Manager::SWITCHER, 'label_on' => __('Yes', 'fieldday'), 'label_off' => __('No', 'fieldday'), 'default' => 'no', 'separator' => 'before', ] ); $this->add_control( 'activity_ids', [ 'label' => esc_html__('Select Activity', 'fieldday'), 'type' => Controls_Manager::SELECT, 'options' =>$this->ActivitiesList(), /* 'default' => 'all', */ 'condition' => [ 'session_filters' => 'yes', ], ] ); /* $this->add_control( 'sessions_ids', [ 'label' => esc_html__( 'Select Sessions', 'plugin-name' ), 'type' => Controls_Manager::SELECT2, 'multiple' => true, 'options' => $this->SessionsList($control), 'default' => [], 'dynamic' => [ 'active' => true, ], 'condition' => [ 'session_filters' => 'yes', ], ] ); */ $this->end_controls_section(); } /** * get the list of sessions * @return array list of all sessions */ private function SessionsList( $control ) { $tagsOptions = ['all' => 'all']; $filters =[]; $activity_id=[]; $control = (array) $this; foreach($control as $cont){ if(is_array($cont)){ $activity_id[] = $cont['settings']['activity_ids']; } } $trimmed_array = array_map('trim', array_filter($activity_id)); foreach($trimmed_array as $trimmed_arr){ if($trimmed_arr!=''){ $filter_value = $trimmed_arr; } } $filters['filters']['activityId'] = $filter_value; $ProviderSessions = fieldday()->api->GetProviderSessionsNew($filters); $sessions_data = $this->getSessionsList($ProviderSessions); foreach ($sessions_data as $key => $session) { if($filter_value!=""){ $tagsOptions[$key] = $session; } } return $tagsOptions; } private function getSessionsList($sessions, $key = false) { $activitys = $sessions->data->sessions; $searchactivitys = []; if($activitys){ //foreach ($activitys as $activity => $singlesessions) //{ foreach ($activitys as $singleactivitys => $singleactivity) { $searchactivitys[$singleactivity->_id] = wp_sprintf('%s', $singleactivity->name); } //} } return $searchactivitys; } /** * get the list of activities * @return array list of activities */ private function ActivitiesList() { /* $activityOptions = ['all' => 'all']; */ $activities = fieldday()->api->getFeaturedActivities(); foreach ($activities->data as $key => $activity) { $activityOptions[$activity->_id] = $activity->title; } return $activityOptions; } private function displaySessionList($SessionsOnly) { $this->settings = $this->get_active_settings(); $filters = []; $layoutColumns = $this->settings['activity_layout']; $style = fieldday()->engine->getValue('activity_style', $this->settings, false); $styleClass = "km_activity_simple"; if($style == 'alternate') { $styleClass = "km_activity_alternate"; } $layoutclass = ["layout_{$layoutColumns}_columns", $this->settings['activity_image_effect']]; if ($this->settings['activity_ids'] !== 'all') { $filters['filters']['activityId'] = $this->settings['activity_ids']; } $let_selected_activity_key = $this->get_active_settings()['activity_ids']; $let_selected_activity_key_data = $this->ActivitiesList(); print "