From: soufiane Date: Mon, 15 May 2023 16:34:30 +0000 (+0200) Subject: wip #5812 @6:30 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=21b91bdb35f6b9f7c5af654f8e1efc8b1cc2fc2f;p=sycomore-fondation.git wip #5812 @6:30 --- diff --git a/wp-content/mu-plugins/cube/Widgets/AssociationSectionImage.php b/wp-content/mu-plugins/cube/Widgets/AssociationSectionImage.php index b201435..7d7cacd 100644 --- a/wp-content/mu-plugins/cube/Widgets/AssociationSectionImage.php +++ b/wp-content/mu-plugins/cube/Widgets/AssociationSectionImage.php @@ -208,59 +208,7 @@ class AssociationSectionImage extends _Base { ?> Tout afficher "; echo ""; } - - protected function content_template() { - ?> - <# - html_tag = { - 'ordered': 'ol', - 'unordered': 'ul', - 'other': 'ul', - }; - view.addRenderAttribute( 'list', 'class', 'assoc-list' ); - - view.addRenderAttribute( 'title', 'class', ['font-bold text-lg text-center relative']); - - view.addInlineEditingAttributes( 'title', 'none' ); - - #> - -
- <# if ('' !== settings.title) { #> -
- <{{{ settings.title_tag }}} {{{ view.getRenderAttributeString( 'title' ) }}}> - {{{ settings.title }}} - - -
- <# } #> - - <{{{ html_tag[ settings.marker_type ] }}} {{{ view.getRenderAttributeString( 'list' ) }}}> - <# _.each( settings.list_items, function( item, index ) { - var repeater_setting_key = view.getRepeaterSettingKey( 'text', 'list_items', index ); - view.addRenderAttribute( repeater_setting_key, 'class', 'elementor-list-widget-text' ); - view.addInlineEditingAttributes( repeater_setting_key ); - #> -
  • - <# var title = item.text; #> - <# if ( item.link ) { #> - <# view.addRenderAttribute( `link_${index}`, item.link ); #> - - {{{title}}} - - <# } else { #> - {{{title}}} - <# } #> -
  • - <# } ); #> - -
    - end_controls_section(); + + $this->start_controls_section( + 'section_gallery', + [ + 'label' => esc_html__( 'Image Gallery', 'elementor' ), + ] + ); + + $this->add_control( + 'wp_gallery', + [ + 'label' => esc_html__( 'Add Images', 'elementor' ), + 'type' => Controls_Manager::GALLERY, + 'show_label' => false, + 'dynamic' => [ + 'active' => true, + ], + ] + ); + + $this->add_group_control( + Group_Control_Image_Size::get_type(), + [ + 'name' => 'thumbnail', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`. + 'exclude' => [ 'custom' ], + 'separator' => 'none', + ] + ); + + $gallery_columns = range( 1, 10 ); + $gallery_columns = array_combine( $gallery_columns, $gallery_columns ); + + $this->add_control( + 'gallery_columns', + [ + 'label' => esc_html__( 'Columns', 'elementor' ), + 'type' => Controls_Manager::SELECT, + 'default' => 4, + 'options' => $gallery_columns, + ] + ); + + $this->add_control( + 'gallery_position', + [ + 'label' => esc_html__( 'Position', 'elementor' ), + 'type' => Controls_Manager::SELECT, + 'default' => 'gallery-right', + 'options' => [ + 'gallery-right' => 'right', + 'gallery-left' => 'left', + ], + ] + ); + + $this->end_controls_section(); + $this->start_controls_section( 'style_section', [ @@ -120,6 +179,16 @@ class TextWithBtn extends _Base { 'tab' => Controls_Manager::TAB, ] ); + $this->add_control( + 'text_color', + [ + 'label' => esc_html__( 'Text Color', 'cube' ), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .highlight' => 'color: {{VALUE}}', + ], + ] + ); $this->add_control( 'color', [ @@ -143,12 +212,6 @@ class TextWithBtn extends _Base { */ protected function render() { - $abovetitle = $this->get_settings('above_title'); - $title = $this->get_settings('title'); - $title_tag = $this->get_settings('title_tag'); - $body = $this->parse_text_editor($this->get_settings('body')); - $cta_text = $this->get_settings('cta_text'); - $cta_link = $this->get_settings('cta_link'); $cta_class = $this->get_settings('cta_class') ? $this->get_settings('cta_class') : ''; if ( ! empty( $cta_link['url'] ) ) { @@ -167,63 +230,11 @@ class TextWithBtn extends _Base { $this->add_render_attribute('body', 'class', ['text-blockbtn-body font-semibold']); $this->add_render_attribute('cta_text', 'class', ["text-blockbtn-cta btn font-semibold $cta_class"]); + $settings = $this->get_settings_for_display(); + $attributes = $this->get_render_attributes(); + + echo view('widgets/text-image-with-btn')->with('settings',$settings)->with('attributes',$attributes); // Rendered content - echo '
    '; - if (!empty($abovetitle)) echo "

    get_render_attribute_string('above_title')}>$abovetitle

    "; - if (!empty($title)) echo "<{$title_tag} {$this->get_render_attribute_string('title')}>$title"; - if (!empty($body)) echo "
    get_render_attribute_string('body')}>$body
    "; - if (!empty($cta_text)) { - echo '
    get_render_attribute_string('cta_text') .'>'; - echo $cta_text; - echo '
    '; - } - echo '
    '; } - /** - * Render text editor widget output in the editor. - * - * Written as a Backbone JavaScript template and used to generate the live preview. - * - * @since 1.0.0 - * @access protected - */ - protected function content_template() { - ?> - <# - div_tag = "div"; - view.addRenderAttribute( 'above_title', 'class', ['text-block-above-title font-semibold']); - view.addRenderAttribute( 'title', 'class', ['text-block-title font-bold text-xl']); - view.addRenderAttribute( 'body', 'class', ['text-block-body font-semibold']); - view.addRenderAttribute( 'cta_text', 'class', ['text-block-cta btn font-semibold']); - - view.addInlineEditingAttributes( 'above_title', 'none' ); - view.addInlineEditingAttributes( 'title', 'none' ); - view.addInlineEditingAttributes( 'body', 'none' ); - view.addInlineEditingAttributes( 'cta_text', 'none' ); - #> - <{{{ div_tag }}} class="text-blockbtn"> - <# if ('' !== settings.above_title) { #> -

    {{{ settings.above_title }}}

    - <# } #> - - <# if ('' !== settings.title) { #> - <{{{ settings.title_tag }}} {{{ view.getRenderAttributeString( 'title' ) }}}>{{{ settings.title }}} - <# } #> - - <# if ('' !== settings.body) { #> -
    {{{ settings.body }}}
    - <# } #> - - <# if ('' !== settings.cta_text) { #> -
    - - {{{ settings.cta_text }}} - -
    - <# } #> - - - +

    + {{ $settings['above_title'] }} + +

    + <{{$settings['title_tag']}} class="{{implode(' ',$attributes['title']['class'])}}"> + {!! $settings['title'] !!} + + + + +
    {!! $settings['body'] !!}
    +
    + + {!! $settings['cta_text'] !!} + +
    +