← All changes
|
app/Elementor/Widgets/Controls/InfoboxSettings.php
+110
-169
2.1.11
→
1.1.4
View file →
| @@ -1,169 +1,110 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Main ProductDescription class. | |
| 4 | - * | |
| 5 | - * @package RadiusTheme\SB | |
| 6 | - */ | |
| 7 | - | |
| 8 | -namespace RadiusTheme\SB\Elementor\Widgets\Controls; | |
| 9 | - | |
| 10 | -// Do not allow directly accessing this file. | |
| 11 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | - exit( 'This script cannot be accessed directly.' ); | |
| 13 | -} | |
| 14 | - | |
| 15 | -/** | |
| 16 | - * Product Description class | |
| 17 | - */ | |
| 18 | -class InfoboxSettings { | |
| 19 | - | |
| 20 | - /** | |
| 21 | - * Widget Field | |
| 22 | - * | |
| 23 | - * @return array | |
| 24 | - */ | |
| 25 | - public static function style_settings( $widget ) { | |
| 26 | - $fields = [ | |
| 27 | - 'infobox_style' => [ | |
| 28 | - 'mode' => 'section_start', | |
| 29 | - 'tab' => 'style', | |
| 30 | - 'label' => esc_html__( 'Infobox style', 'shopbuilder' ), | |
| 31 | - ], | |
| 32 | - 'notice_infobox' => [ | |
| 33 | - 'type' => 'html', | |
| 34 | - 'raw' => sprintf( | |
| 35 | - '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 36 | - esc_html__( 'Infobox', 'shopbuilder' ) | |
| 37 | - ), | |
| 38 | - 'content_classes' => 'elementor-panel-heading-title', | |
| 39 | - ], | |
| 40 | - | |
| 41 | - 'infobox_typography' => [ | |
| 42 | - 'mode' => 'group', | |
| 43 | - 'type' => 'typography', | |
| 44 | - 'label' => esc_html__( 'Typography', 'shopbuilder' ), | |
| 45 | - 'selector' => $widget->selectors['infobox_typography'], | |
| 46 | - ], | |
| 47 | - 'infobox_bg_color' => [ | |
| 48 | - 'label' => esc_html__( 'Background Color', 'shopbuilder' ), | |
| 49 | - 'type' => 'color', | |
| 50 | - | |
| 51 | - 'selectors' => [ | |
| 52 | - $widget->selectors['infobox_bg_color'] => 'background-color: {{VALUE}};', | |
| 53 | - ], | |
| 54 | - ], | |
| 55 | - 'infobox_text_color' => [ | |
| 56 | - 'label' => esc_html__( 'Color', 'shopbuilder' ), | |
| 57 | - 'type' => 'color', | |
| 58 | - | |
| 59 | - 'selectors' => [ | |
| 60 | - $widget->selectors['infobox_text_color'] => 'color: {{VALUE}};', | |
| 61 | - ], | |
| 62 | - ], | |
| 63 | - 'infobox_text_link_color' => [ | |
| 64 | - 'label' => esc_html__( 'Link Color', 'shopbuilder' ), | |
| 65 | - 'type' => 'color', | |
| 66 | - | |
| 67 | - 'selectors' => [ | |
| 68 | - $widget->selectors['infobox_text_link_color'] => 'color: {{VALUE}};', | |
| 69 | - ], | |
| 70 | - ], | |
| 71 | - 'infobox_border_color' => [ | |
| 72 | - 'label' => esc_html__( 'Infobox Border', 'shopbuilder' ), | |
| 73 | - 'mode' => 'group', | |
| 74 | - 'type' => 'border', | |
| 75 | - 'fields_options' => [ | |
| 76 | - 'border' => [ | |
| 77 | - 'label' => esc_html__( 'Infobox Border', 'shopbuilder' ), | |
| 78 | - ], | |
| 79 | - 'color' => [ | |
| 80 | - 'label' => esc_html__( 'Border Color', 'shopbuilder' ), | |
| 81 | - ], | |
| 82 | - ], | |
| 83 | - 'selector' => $widget->selectors['infobox_border_color'], | |
| 84 | - ], | |
| 85 | - | |
| 86 | - 'infobox_border_radius' => [ | |
| 87 | - 'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ), | |
| 88 | - 'type' => 'dimensions', | |
| 89 | - 'mode' => 'responsive', | |
| 90 | - 'size_units' => [ 'px' ], | |
| 91 | - 'selectors' => [ | |
| 92 | - $widget->selectors['infobox_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 93 | - ], | |
| 94 | - ], | |
| 95 | - 'infobox_padding' => [ | |
| 96 | - 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), | |
| 97 | - 'type' => 'dimensions', | |
| 98 | - 'mode' => 'responsive', | |
| 99 | - 'size_units' => [ 'px' ], | |
| 100 | - 'selectors' => [ | |
| 101 | - $widget->selectors['infobox_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 102 | - ], | |
| 103 | - 'separator' => 'before', | |
| 104 | - ], | |
| 105 | - 'infobox_wrapper_border' => [ | |
| 106 | - 'label' => esc_html__( 'Infobox Wrapper Border', 'shopbuilder' ), | |
| 107 | - 'mode' => 'group', | |
| 108 | - 'type' => 'border', | |
| 109 | - 'fields_options' => [ | |
| 110 | - 'border' => [ | |
| 111 | - 'label' => esc_html__( 'Infobox Wrapper Border', 'shopbuilder' ), | |
| 112 | - ], | |
| 113 | - 'color' => [ | |
| 114 | - 'label' => esc_html__( 'Border Color', 'shopbuilder' ), | |
| 115 | - ], | |
| 116 | - ], | |
| 117 | - 'selector' => $widget->selectors['infobox_wrapper_border'], | |
| 118 | - ], | |
| 119 | - | |
| 120 | - 'notice_icon_box' => [ | |
| 121 | - 'type' => 'html', | |
| 122 | - 'raw' => sprintf( | |
| 123 | - '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 124 | - esc_html__( 'Icon Box', 'shopbuilder' ) | |
| 125 | - ), | |
| 126 | - 'content_classes' => 'elementor-panel-heading-title', | |
| 127 | - ], | |
| 128 | - 'infobox_icon_size' => [ | |
| 129 | - 'label' => esc_html__( 'Icon Size', 'shopbuilder' ), | |
| 130 | - 'type' => 'slider', | |
| 131 | - 'range' => [ | |
| 132 | - 'px' => [ | |
| 133 | - 'min' => 10, | |
| 134 | - 'max' => 100, | |
| 135 | - ], | |
| 136 | - ], | |
| 137 | - 'selectors' => [ | |
| 138 | - $widget->selectors['infobox_icon_size']['icon'] => 'font-size: {{SIZE}}{{UNIT}};', | |
| 139 | - $widget->selectors['infobox_icon_size']['svg'] => 'width: {{SIZE}}{{UNIT}};', | |
| 140 | - ], | |
| 141 | - ], | |
| 142 | - 'infobox_icon_margin' => [ | |
| 143 | - 'label' => esc_html__( 'Icon Margin (px)', 'shopbuilder' ), | |
| 144 | - 'type' => 'dimensions', | |
| 145 | - 'mode' => 'responsive', | |
| 146 | - 'size_units' => [ 'px' ], | |
| 147 | - 'selectors' => [ | |
| 148 | - $widget->selectors['infobox_icon_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 149 | - ], | |
| 150 | - ], | |
| 151 | - 'infobox_icon_color' => [ | |
| 152 | - 'label' => esc_html__( 'Icon Color', 'shopbuilder' ), | |
| 153 | - 'type' => 'color', | |
| 154 | - 'selectors' => [ | |
| 155 | - $widget->selectors['infobox_icon_color'] => 'color: {{VALUE}};', | |
| 156 | - ], | |
| 157 | - 'condition' => [ | |
| 158 | - 'show_info_icon' => [ 'yes' ], | |
| 159 | - ], | |
| 160 | - ], | |
| 161 | - | |
| 162 | - 'infobox_style_end' => [ | |
| 163 | - 'mode' => 'section_end', | |
| 164 | - ], | |
| 165 | - ]; | |
| 166 | - | |
| 167 | - return $fields; | |
| 168 | - } | |
| 169 | -} | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Main ProductDescription class. | |
| 4 | + * | |
| 5 | + * @package RadiusTheme\SB | |
| 6 | + */ | |
| 7 | + | |
| 8 | +namespace RadiusTheme\SB\Elementor\Widgets\Controls; | |
| 9 | + | |
| 10 | +// Do not allow directly accessing this file. | |
| 11 | +if (!defined('ABSPATH')) { | |
| 12 | + exit('This script cannot be accessed directly.'); | |
| 13 | +} | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * Product Description class | |
| 17 | + */ | |
| 18 | +class InfoboxSettings | |
| 19 | +{ | |
| 20 | + /** | |
| 21 | + * Widget Field | |
| 22 | + * | |
| 23 | + * @return array | |
| 24 | + */ | |
| 25 | + public static function style_settings($widget) | |
| 26 | + { | |
| 27 | + $fields = [ | |
| 28 | + 'infobox_style' => [ | |
| 29 | + 'mode' => 'section_start', | |
| 30 | + 'tab' => 'style', | |
| 31 | + 'label' => esc_html__('Infobox style', 'shopbuilder'), | |
| 32 | + ], | |
| 33 | + | |
| 34 | + 'infobox_typography' => [ | |
| 35 | + 'mode' => 'group', | |
| 36 | + 'type' => 'typography', | |
| 37 | + 'label' => esc_html__('Typography', 'shopbuilder'), | |
| 38 | + 'selector' => $widget->selectors['infobox_typography'], | |
| 39 | + ], | |
| 40 | + 'infobox_bg_color' => [ | |
| 41 | + 'label' => esc_html__('Background Color', 'shopbuilder'), | |
| 42 | + 'type' => 'color', | |
| 43 | + | |
| 44 | + 'selectors' => [ | |
| 45 | + $widget->selectors['infobox_bg_color'] => 'background-color: {{VALUE}};', | |
| 46 | + ], | |
| 47 | + ], | |
| 48 | + 'infobox_text_color' => [ | |
| 49 | + 'label' => esc_html__('Color', 'shopbuilder'), | |
| 50 | + 'type' => 'color', | |
| 51 | + | |
| 52 | + 'selectors' => [ | |
| 53 | + $widget->selectors['infobox_text_color'] => 'color: {{VALUE}};', | |
| 54 | + ], | |
| 55 | + ], | |
| 56 | + 'infobox_text_link_color' => [ | |
| 57 | + 'label' => esc_html__('Link Color', 'shopbuilder'), | |
| 58 | + 'type' => 'color', | |
| 59 | + | |
| 60 | + 'selectors' => [ | |
| 61 | + $widget->selectors['infobox_text_link_color'] => 'color: {{VALUE}};', | |
| 62 | + ], | |
| 63 | + ], | |
| 64 | + 'infobox_border_color' => [ | |
| 65 | + 'label' => esc_html__('Border Color', 'shopbuilder'), | |
| 66 | + 'type' => 'color', | |
| 67 | + | |
| 68 | + 'selectors' => [ | |
| 69 | + $widget->selectors['infobox_border_color'] => 'border-color: {{VALUE}};', | |
| 70 | + ], | |
| 71 | + ], | |
| 72 | + 'infobox_icon_size' => [ | |
| 73 | + 'label' => esc_html__('Icon Size', 'shopbuilder'), | |
| 74 | + 'type' => 'slider', | |
| 75 | + 'range' => [ | |
| 76 | + 'px' => [ | |
| 77 | + 'min' => 10, | |
| 78 | + 'max' => 100, | |
| 79 | + ], | |
| 80 | + ], | |
| 81 | + 'selectors' => [ | |
| 82 | + $widget->selectors['infobox_icon_size'] => 'font-size: {{SIZE}}{{UNIT}};', | |
| 83 | + ], | |
| 84 | + ], | |
| 85 | + 'infobox_icon_color' => [ | |
| 86 | + 'label' => esc_html__('Icon Color', 'shopbuilder'), | |
| 87 | + 'type' => 'color', | |
| 88 | + | |
| 89 | + 'selectors' => [ | |
| 90 | + $widget->selectors['infobox_icon_color'] => 'color: {{VALUE}};', | |
| 91 | + ], | |
| 92 | + ], | |
| 93 | + 'infobox_padding' => [ | |
| 94 | + 'label' => esc_html__('Padding (px)', 'shopbuilder'), | |
| 95 | + 'type' => 'dimensions', | |
| 96 | + 'mode' => 'responsive', | |
| 97 | + 'size_units' => ['px'], | |
| 98 | + 'selectors' => [ | |
| 99 | + $widget->selectors['infobox_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 100 | + ], | |
| 101 | + 'separator' => 'before', | |
| 102 | + ], | |
| 103 | + | |
| 104 | + 'infobox_style_end' => [ | |
| 105 | + 'mode' => 'section_end', | |
| 106 | + ], | |
| 107 | + ]; | |
| 108 | + return $fields; | |
| 109 | + } | |
| 110 | +} | |