← All changes
|
app/Services/Integrations/Elementor/Widgets/FcalCalendar.php
+22
-23
1.7.0
→
2.5.0
View file →
| @@ -4,9 +4,8 @@ | ||
| 4 | 4 | |
| 5 | 5 | use FluentBooking\App\Models\Calendar; |
| 6 | 6 | use FluentBooking\App\Hooks\Handlers\BlockEditorHandler; |
| 7 | 7 | use FluentBooking\App\Models\CalendarSlot; |
| 8 | -use FluentBooking\App\Services\Helper; | |
| 9 | 8 | |
| 10 | 9 | class FcalCalendar extends \Elementor\Widget_Base |
| 11 | 10 | { |
| 12 | 11 | |
| @@ -26,9 +25,9 @@ | ||
| 26 | 25 | * @return string Widget title. |
| 27 | 26 | */ |
| 28 | 27 | public function get_title() |
| 29 | 28 | { |
| 30 | - return esc_html__('Calendar', 'fluent-booking-pro'); | |
| 29 | + return esc_html__('Calendar', 'fluent-booking'); | |
| 31 | 30 | } |
| 32 | 31 | |
| 33 | 32 | /** |
| 34 | 33 | * Get widget icon. |
| @@ -70,9 +69,9 @@ | ||
| 70 | 69 | |
| 71 | 70 | $this->start_controls_section( |
| 72 | 71 | 'content_section', |
| 73 | 72 | [ |
| 74 | - 'label' => esc_html__('Content', 'fluent-booking-pro'), | |
| 73 | + 'label' => esc_html__('Content', 'fluent-booking'), | |
| 75 | 74 | 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, |
| 76 | 75 | ] |
| 77 | 76 | ); |
| 78 | 77 | $this->add_control( |
| @@ -77,26 +76,26 @@ | ||
| 77 | 76 | ); |
| 78 | 77 | $this->add_control( |
| 79 | 78 | 'title', |
| 80 | 79 | [ |
| 81 | - 'label' => esc_html__('Title', 'fluent-booking-pro'), | |
| 80 | + 'label' => esc_html__('Title', 'fluent-booking'), | |
| 82 | 81 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 83 | - 'placeholder' => esc_html__('Enter title here', 'fluent-booking-pro'), | |
| 82 | + 'placeholder' => esc_html__('Enter title here', 'fluent-booking'), | |
| 84 | 83 | ] |
| 85 | 84 | ); |
| 86 | 85 | $this->add_control( |
| 87 | 86 | 'description', |
| 88 | 87 | [ |
| 89 | - 'label' => esc_html__('Description', 'fluent-booking-pro'), | |
| 88 | + 'label' => esc_html__('Description', 'fluent-booking'), | |
| 90 | 89 | 'type' => \Elementor\Controls_Manager::TEXTAREA, |
| 91 | 90 | 'rows' => 4, |
| 92 | - 'placeholder' => esc_html__('Enter description here', 'fluent-booking-pro'), | |
| 91 | + 'placeholder' => esc_html__('Enter description here', 'fluent-booking'), | |
| 93 | 92 | ] |
| 94 | 93 | ); |
| 95 | 94 | $this->add_control( |
| 96 | 95 | 'header_image', |
| 97 | 96 | [ |
| 98 | - 'label' => esc_html__('Choose Header Image', 'fluent-booking-pro'), | |
| 97 | + 'label' => esc_html__('Choose Header Image', 'fluent-booking'), | |
| 99 | 98 | 'type' => \Elementor\Controls_Manager::MEDIA |
| 100 | 99 | ] |
| 101 | 100 | ); |
| 102 | 101 | $this->add_control( |
| @@ -101,12 +100,12 @@ | ||
| 101 | 100 | ); |
| 102 | 101 | $this->add_control( |
| 103 | 102 | 'show_host_info', |
| 104 | 103 | [ |
| 105 | - 'label' => esc_html__('Host Info', 'fluent-booking-pro'), | |
| 104 | + 'label' => esc_html__('Host Info', 'fluent-booking'), | |
| 106 | 105 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 107 | - 'label_on' => esc_html__('Show', 'fluent-booking-pro'), | |
| 108 | - 'label_off' => esc_html__('Hide', 'fluent-booking-pro'), | |
| 106 | + 'label_on' => esc_html__('Show', 'fluent-booking'), | |
| 107 | + 'label_off' => esc_html__('Hide', 'fluent-booking'), | |
| 109 | 108 | 'return_value' => 'yes', |
| 110 | 109 | 'default' => 'yes', |
| 111 | 110 | ] |
| 112 | 111 | ); |
| @@ -113,9 +112,9 @@ | ||
| 113 | 112 | |
| 114 | 113 | $this->add_control( |
| 115 | 114 | 'selected_cal_id', |
| 116 | 115 | [ |
| 117 | - 'label' => esc_html__('Select Calendar', 'fluent-booking-pro'), | |
| 116 | + 'label' => esc_html__('Select Calendar', 'fluent-booking'), | |
| 118 | 117 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 119 | 118 | 'label_block' => true, |
| 120 | 119 | 'options' => $this->getCalendars() |
| 121 | 120 | ] |
| @@ -123,9 +122,9 @@ | ||
| 123 | 122 | |
| 124 | 123 | $this->add_control( |
| 125 | 124 | 'selected_event_ids', |
| 126 | 125 | [ |
| 127 | - 'label' => esc_html__('Select Events', 'fluent-booking-pro'), | |
| 126 | + 'label' => esc_html__('Select Events', 'fluent-booking'), | |
| 128 | 127 | 'type' => \Elementor\Controls_Manager::SELECT2, |
| 129 | 128 | 'label_block' => true, |
| 130 | 129 | 'multiple' => true, |
| 131 | 130 | 'options' => [] |
| @@ -141,15 +140,15 @@ | ||
| 141 | 140 | { |
| 142 | 141 | $this->start_controls_section( |
| 143 | 142 | 'content_style', |
| 144 | 143 | [ |
| 145 | - 'label' => esc_html__('Style', 'fluent-booking-pro'), | |
| 144 | + 'label' => esc_html__('Style', 'fluent-booking'), | |
| 146 | 145 | 'tab' => \Elementor\Controls_Manager::TAB_STYLE, |
| 147 | 146 | ] |
| 148 | 147 | ); |
| 149 | 148 | $this->add_control('fcal_primary_color', |
| 150 | 149 | [ |
| 151 | - 'label' => esc_html__('Primary Color', 'fluent-booking-pro'), | |
| 150 | + 'label' => esc_html__('Primary Color', 'fluent-booking'), | |
| 152 | 151 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 153 | 152 | 'selectors' => [ |
| 154 | 153 | '{{WRAPPER}} .fcal_calendar_inner .fcal_date_wrapper .calendar .day .is-today, |
| 155 | 154 | {{WRAPPER}} .fcal_slot_picker .fcal_spot_lists .fcal_spot.fcal_spot_selected .fcal_spot_name' => 'color: {{VALUE}}', |
| @@ -186,9 +185,9 @@ | ||
| 186 | 185 | ] |
| 187 | 186 | ); |
| 188 | 187 | $this->add_control('fcal_border_color', |
| 189 | 188 | [ |
| 190 | - 'label' => esc_html__('Border Color', 'fluent-booking-pro'), | |
| 189 | + 'label' => esc_html__('Border Color', 'fluent-booking'), | |
| 191 | 190 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 192 | 191 | 'selectors' => [ |
| 193 | 192 | '{{WRAPPER}} .fcal_calendar_inner .fcal_side' => 'border-right-color: {{VALUE}}', |
| 194 | 193 | '{{WRAPPER}} .fcal_calendar_inner .fcal_date_wrapper .fcal_date_event_details .fcal_date_event_details_header' => 'border-bottom-color: {{VALUE}}', |
| @@ -212,9 +211,9 @@ | ||
| 212 | 211 | ); |
| 213 | 212 | $this->add_control( |
| 214 | 213 | 'avatar-radius', |
| 215 | 214 | [ |
| 216 | - 'label' => esc_html__('Avatar Radius', 'fluent-booking-pro'), | |
| 215 | + 'label' => esc_html__('Avatar Radius', 'fluent-booking'), | |
| 217 | 216 | 'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 218 | 217 | 'size_units' => ['px', '%', 'em', 'rem', 'custom'], |
| 219 | 218 | 'default' => [ |
| 220 | 219 | 'top' => 8, |
| @@ -237,9 +236,9 @@ | ||
| 237 | 236 | |
| 238 | 237 | $this->add_control( |
| 239 | 238 | 'date-radius', |
| 240 | 239 | [ |
| 241 | - 'label' => esc_html__('Date Radius', 'fluent-booking-pro'), | |
| 240 | + 'label' => esc_html__('Date Radius', 'fluent-booking'), | |
| 242 | 241 | 'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 243 | 242 | 'size_units' => ['px', '%', 'em', 'rem', 'custom'], |
| 244 | 243 | 'default' => [ |
| 245 | 244 | 'top' => 4, |
| @@ -256,9 +255,9 @@ | ||
| 256 | 255 | ); |
| 257 | 256 | |
| 258 | 257 | $this->add_control('enabled_date_background', |
| 259 | 258 | [ |
| 260 | - 'label' => esc_html__('Enabled Date Background', 'fluent-booking-pro'), | |
| 259 | + 'label' => esc_html__('Enabled Date Background', 'fluent-booking'), | |
| 261 | 260 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 262 | 261 | 'selectors' => [ |
| 263 | 262 | '{{WRAPPER}} .fcal_payment_items table thead th' => 'background-color: {{VALUE}}', |
| 264 | 263 | '{{WRAPPER}} .fcal_calendar_inner .fcal_date_wrapper .calendar .day.day-enabled span' => 'background-color: {{VALUE}}', |
| @@ -267,9 +266,9 @@ | ||
| 267 | 266 | ] |
| 268 | 267 | ); |
| 269 | 268 | $this->add_control('enabled_date_color', |
| 270 | 269 | [ |
| 271 | - 'label' => esc_html__('Enabled Date Color', 'fluent-booking-pro'), | |
| 270 | + 'label' => esc_html__('Enabled Date Color', 'fluent-booking'), | |
| 272 | 271 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 273 | 272 | 'selectors' => [ |
| 274 | 273 | '{{WRAPPER}} .fcal_calendar_inner .fcal_date_wrapper .calendar .day.day-enabled span' => 'color: {{VALUE}}', |
| 275 | 274 | ], |
| @@ -276,9 +275,9 @@ | ||
| 276 | 275 | ] |
| 277 | 276 | ); |
| 278 | 277 | $this->add_control('disabled_date_color', |
| 279 | 278 | [ |
| 280 | - 'label' => esc_html__('Disabled Date Color', 'fluent-booking-pro'), | |
| 279 | + 'label' => esc_html__('Disabled Date Color', 'fluent-booking'), | |
| 281 | 280 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 282 | 281 | 'selectors' => [ |
| 283 | 282 | '{{WRAPPER}} .fcal_calendar_inner .fcal_date_wrapper .calendar .day.day-disabled' => 'color: {{VALUE}}', |
| 284 | 283 | ], |
| @@ -586,14 +585,14 @@ | ||
| 586 | 585 | </div> |
| 587 | 586 | </div> |
| 588 | 587 | </div> |
| 589 | 588 | <?php else : ?> |
| 590 | - <div class="fcal_empty"><?php esc_html_e('Please Select the Event(s)', 'fluent-booking-pro'); ?></div> | |
| 589 | + <div class="fcal_empty"><?php esc_html_e('Please Select the Event(s)', 'fluent-booking'); ?></div> | |
| 591 | 590 | <?php endif; ?> |
| 592 | 591 | </div> |
| 593 | 592 | <?php else : |
| 594 | 593 | // Output for frontend |
| 595 | - echo $blockEditor->fcalRenderCalendarManagementBlock($attributes); | |
| 594 | + echo $blockEditor->fcalRenderCalendarManagementBlock($attributes); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 596 | 595 | endif; |
| 597 | 596 | ?> |
| 598 | 597 | <?php |
| 599 | 598 | |