elementor_widget_book_button.php
1 year ago
elementor_widget_book_form.php
1 year ago
elementor_widget_calendar.php
1 year ago
elementor_widget_customer_dashboard.php
1 year ago
elementor_widget_customer_login.php
1 year ago
elementor_widget_list_of_resources.php
1 year ago
elementor_widget_customer_dashboard.php
86 lines
| 1 | <?php |
| 2 | |
| 3 | class Latepoint_Elementor_Widget_Customer_Dashboard extends \Elementor\Widget_Base { |
| 4 | |
| 5 | protected $widget_data; |
| 6 | /** |
| 7 | * Widget base constructor |
| 8 | */ |
| 9 | public function __construct( $data = [], $args = null ) { |
| 10 | $this->widget_data = $args; |
| 11 | parent::__construct( $data, $args ); |
| 12 | } |
| 13 | |
| 14 | |
| 15 | /** |
| 16 | * Get widget name |
| 17 | */ |
| 18 | public function get_name(): string { |
| 19 | return 'latepoint_customer_dashboard'; |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Get widget title |
| 24 | */ |
| 25 | public function get_title(): string { |
| 26 | return esc_html__( 'Customer Dashboard', 'latepoint' ); |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Get widget icon |
| 31 | */ |
| 32 | public function get_icon(): string { |
| 33 | return 'eicon-archive'; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Get widget categories |
| 38 | */ |
| 39 | public function get_categories(): array { |
| 40 | return [ OsElementorHelper::$category ]; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Register widget controls |
| 45 | */ |
| 46 | protected function register_controls(): void { |
| 47 | |
| 48 | # Booking Form Settings Section |
| 49 | $this->start_controls_section( |
| 50 | 'content_section_booking_form_settings', |
| 51 | [ |
| 52 | 'label' => esc_html__( 'Content', 'latepoint' ), |
| 53 | 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, |
| 54 | ] |
| 55 | ); |
| 56 | |
| 57 | $this->add_control( |
| 58 | 'hide_new_appointment_ui', |
| 59 | [ |
| 60 | 'label' => esc_html__( 'Hide New Appointment UI', 'latepoint' ), |
| 61 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 62 | 'label_on' => esc_html__( 'Yes', 'latepoint' ), |
| 63 | 'label_off' => esc_html__( 'No', 'latepoint' ), |
| 64 | 'return_value' => 'yes', |
| 65 | 'default' => 'no', |
| 66 | ] |
| 67 | ); |
| 68 | |
| 69 | $this->end_controls_section(); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Render widget output on the frontend |
| 74 | */ |
| 75 | protected function render(): void { |
| 76 | $settings = $this->get_settings_for_display(); |
| 77 | |
| 78 | $allowed_params = [ |
| 79 | 'hide_new_appointment_ui' |
| 80 | ]; |
| 81 | |
| 82 | $params = OsBlockHelper::attributes_to_data_params($settings, $allowed_params); |
| 83 | echo do_shortcode('[latepoint_customer_dashboard ' . $params . ']'); |
| 84 | } |
| 85 | |
| 86 | } |