From: soufiane Date: Wed, 10 May 2023 14:45:51 +0000 (+0200) Subject: wip #5874 @5:00 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dc78b37c87450b822e1304e11d0e1cbe8509706e;p=sycomore-fondation.git wip #5874 @5:00 --- diff --git a/wp-content/mu-plugins/cube/Init.php b/wp-content/mu-plugins/cube/Init.php index 05b0489..5b7a177 100644 --- a/wp-content/mu-plugins/cube/Init.php +++ b/wp-content/mu-plugins/cube/Init.php @@ -34,6 +34,7 @@ class Setup { $widgets_manager->register(new Widgets\BlockOrganisation()); $widgets_manager->register(new Widgets\CarouselHome()); $widgets_manager->register(new Widgets\StickyNav()); + $widgets_manager->register(new Widgets\CarouselSelection()); } public function register_widgets_category($elements_manager) { diff --git a/wp-content/mu-plugins/cube/Widgets/CarouselSelection.php b/wp-content/mu-plugins/cube/Widgets/CarouselSelection.php index bde9573..cab467f 100644 --- a/wp-content/mu-plugins/cube/Widgets/CarouselSelection.php +++ b/wp-content/mu-plugins/cube/Widgets/CarouselSelection.php @@ -31,6 +31,58 @@ class CarouselSelection extends _Base 'tab' => Controls_Manager::TAB_CONTENT, ] ); + + $this->add_control( + 'title', + [ + 'label' => __( 'Title', 'elementor' ), + 'type' => Controls_Manager::TEXTAREA, + 'placeholder' => __( 'Enter your title', 'elementor' ), + 'default' => 'Lorem ipsum dolor', + ] + ); + + $repeater = new \Elementor\Repeater(); + + $repeater->add_control( + 'text', + [ + 'label' => esc_html__( 'Text content', 'cube' ), + 'type' => Controls_Manager::TEXTAREA, + 'placeholder' => esc_html__( 'Your text content', 'cube' ), + 'default' => esc_html__( 'Lorem ipsum dolor', 'cube' ), + 'label_block' => true, + 'dynamic' => [ + 'active' => true, + ], + ] + ); + + $repeater->add_control( + 'icon', + [ + 'label' => esc_html__( 'Icon', 'cube' ), + 'type' => Controls_Manager::MEDIA + ] + ); + + /* End repeater */ + $this->add_control( + 'slides', + [ + 'label' => esc_html__( 'Slides', 'cube' ), + 'type' => Controls_Manager::REPEATER, + 'fields' => $repeater->get_controls(), /* Use our repeater */ + 'default' => [], + 'title_field' => '{{{ text }}}', + ] + ); + + $this->end_controls_section(); } + public function render() { + $settings = $this->get_settings_for_display(); + echo view('widgets/carousel-selection', compact('settings')); + } } \ No newline at end of file diff --git a/wp-content/mu-plugins/cube/Widgets/StickyNav.php b/wp-content/mu-plugins/cube/Widgets/StickyNav.php index cfb768c..8c85a53 100644 --- a/wp-content/mu-plugins/cube/Widgets/StickyNav.php +++ b/wp-content/mu-plugins/cube/Widgets/StickyNav.php @@ -28,9 +28,13 @@ class StickyNav extends CarouselHome if ( $settings['slides'] ) { echo '