| 1 |
<?php |
| 2 |
/** |
| 3 |
* Controls class. |
| 4 |
* |
| 5 |
* @package RadiusTheme\SB |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace RadiusTheme\SB\Elementor\Widgets\General\Testimonial; |
| 9 |
|
| 10 |
use Elementor\Utils; |
| 11 |
use RadiusTheme\SB\Helpers\Fns; |
| 12 |
use RadiusTheme\SB\Elementor\Helper\ControlHelper; |
| 13 |
use RadiusTheme\SB\Elementor\Widgets\Controls\SettingsFields; |
| 14 |
use RadiusTheme\SB\Elementor\Widgets\Controls\StyleFields as StyleFieldsFree; |
| 15 |
|
| 16 |
// Do not allow directly accessing this file. |
| 17 |
if ( ! defined( 'ABSPATH' ) ) { |
| 18 |
exit( 'This script cannot be accessed directly.' ); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Settings class. |
| 23 |
* |
| 24 |
* @package RadiusTheme\SB |
| 25 |
*/ |
| 26 |
class Controls { |
| 27 |
/** |
| 28 |
* Content section |
| 29 |
* |
| 30 |
* @param object $obj Reference object. |
| 31 |
* |
| 32 |
* @return array |
| 33 |
*/ |
| 34 |
public static function content( $obj ) { |
| 35 |
return array_merge( |
| 36 |
self::preset( $obj ), |
| 37 |
self::general_settings( $obj ), |
| 38 |
self::slider_settings( $obj ), |
| 39 |
self::testimonial_items( $obj ), |
| 40 |
); |
| 41 |
} |
| 42 |
|
| 43 |
/** |
| 44 |
* Style section |
| 45 |
* |
| 46 |
* @param object $obj Reference object. |
| 47 |
* |
| 48 |
* @return array |
| 49 |
*/ |
| 50 |
public static function style( $obj ) { |
| 51 |
return array_merge( |
| 52 |
self::testimonial_item_style( $obj ), |
| 53 |
self::image_styles( $obj ), |
| 54 |
self::title_style( $obj ), |
| 55 |
self::rating_style( $obj ), |
| 56 |
self::content_style( $obj ), |
| 57 |
self::designation_style( $obj ), |
| 58 |
self::logo_slider_buttons( $obj ), |
| 59 |
); |
| 60 |
} |
| 61 |
|
| 62 |
/** |
| 63 |
* Preset section |
| 64 |
* |
| 65 |
* @param object $obj Reference object. |
| 66 |
* |
| 67 |
* @return array |
| 68 |
*/ |
| 69 |
private static function preset( $obj ) { |
| 70 |
$status = ! rtsb()->has_pro(); |
| 71 |
$fields['sb_testimonial_preset'] = $obj->start_section( |
| 72 |
esc_html__( 'Layout', 'shopbuilder' ), |
| 73 |
'content' |
| 74 |
); |
| 75 |
$fields['layout_note'] = $obj->el_heading( esc_html__( 'Predefined Layouts', 'shopbuilder' ) ); |
| 76 |
$fields['layout_style'] = [ |
| 77 |
'type' => 'rtsb-image-selector', |
| 78 |
'options' => ControlHelper::general_widgets_testimonial(), |
| 79 |
'default' => 'rtsb-testimonial-layout1', |
| 80 |
]; |
| 81 |
$fields['cols'] = [ |
| 82 |
'type' => 'select2', |
| 83 |
'mode' => 'responsive', |
| 84 |
'label' => esc_html__( 'Number of Columns', 'shopbuilder' ), |
| 85 |
'description' => esc_html__( 'Please select the number of columns to show per row.', 'shopbuilder' ), |
| 86 |
'options' => ControlHelper::layout_columns(), |
| 87 |
'label_block' => true, |
| 88 |
'default' => '0', |
| 89 |
'tablet_default' => '3', |
| 90 |
'mobile_default' => '2', |
| 91 |
'required' => true, |
| 92 |
'render_type' => 'template', |
| 93 |
'selectors' => [ |
| 94 |
$obj->selectors['columns']['cols'] => 'grid-template-columns: repeat({{VALUE}}, minmax(0, 1fr));', |
| 95 |
], |
| 96 |
'separator' => 'before', |
| 97 |
]; |
| 98 |
$fields['rows'] = [ |
| 99 |
'type' => 'select2', |
| 100 |
'label' => esc_html__( 'Number of Product Rows', 'shopbuilder' ), |
| 101 |
'description' => esc_html__( 'Please select the number of slide rows. Slide Rows represents how many rows of slides will be displayed at once.', 'shopbuilder' ), |
| 102 |
'options' => [ |
| 103 |
1 => esc_html__( 'Layout Default (1 Row)', 'shopbuilder' ), |
| 104 |
2 => esc_html__( '2 Rows', 'shopbuilder' ), |
| 105 |
3 => esc_html__( '3 Rows', 'shopbuilder' ), |
| 106 |
4 => esc_html__( '4 Rows', 'shopbuilder' ), |
| 107 |
5 => esc_html__( '5 Rows', 'shopbuilder' ), |
| 108 |
], |
| 109 |
'label_block' => true, |
| 110 |
'default' => '1', |
| 111 |
'tablet_default' => '1', |
| 112 |
'mobile_default' => '1', |
| 113 |
'required' => true, |
| 114 |
'classes' => $obj->pro_class(), |
| 115 |
'is_pro' => $status, |
| 116 |
'condition' => [ 'activate_slider_item' => 'yes' ], |
| 117 |
]; |
| 118 |
|
| 119 |
$fields['cols_group'] = [ |
| 120 |
'type' => 'select2', |
| 121 |
'mode' => 'responsive', |
| 122 |
'label' => esc_html__( 'Number of Slides Per Group', 'shopbuilder' ), |
| 123 |
'description' => esc_html__( 'Please select the number of slides to show per group. Slides Per Group indicates how many slides will be transitioned at a time.', 'shopbuilder' ), |
| 124 |
'options' => ControlHelper::layout_columns(), |
| 125 |
'label_block' => true, |
| 126 |
'default' => '0', |
| 127 |
'tablet_default' => '2', |
| 128 |
'mobile_default' => '1', |
| 129 |
'required' => true, |
| 130 |
'condition' => [ 'activate_slider_item' => 'yes' ], |
| 131 |
]; |
| 132 |
$fields['element_height'] = [ |
| 133 |
'type' => 'slider', |
| 134 |
'mode' => 'responsive', |
| 135 |
'label' => esc_html__( 'Element Height', 'shopbuilder' ), |
| 136 |
'size_units' => [ 'px', '%' ], |
| 137 |
'range' => [ |
| 138 |
'px' => [ |
| 139 |
'min' => 0, |
| 140 |
'max' => 1000, |
| 141 |
], |
| 142 |
'%' => [ |
| 143 |
'min' => 0, |
| 144 |
'max' => 100, |
| 145 |
], |
| 146 |
], |
| 147 |
'description' => esc_html__( 'Please select the element height.', 'shopbuilder' ), |
| 148 |
'selectors' => [ |
| 149 |
$obj->selectors['element']['element_height'] => 'height: {{SIZE}}{{UNIT}};', |
| 150 |
], |
| 151 |
]; |
| 152 |
$fields['grid_gap'] = [ |
| 153 |
'type' => 'slider', |
| 154 |
'mode' => 'responsive', |
| 155 |
'label' => esc_html__( 'Grid Gap / Spacing (px)', 'shopbuilder' ), |
| 156 |
'size_units' => [ 'px' ], |
| 157 |
'range' => [ |
| 158 |
'px' => [ |
| 159 |
'min' => 0, |
| 160 |
'max' => 100, |
| 161 |
'step' => 1, |
| 162 |
], |
| 163 |
], |
| 164 |
'default' => [ |
| 165 |
'unit' => 'px', |
| 166 |
'size' => 30, |
| 167 |
], |
| 168 |
'description' => esc_html__( 'Please select the grid gap in px.', 'shopbuilder' ), |
| 169 |
'selectors' => [ |
| 170 |
$obj->selectors['columns']['grid_gap']['padding'] => 'padding-left: calc({{SIZE}}{{UNIT}} / 2); padding-right: calc({{SIZE}}{{UNIT}} / 2);', |
| 171 |
$obj->selectors['columns']['grid_gap']['margin'] => 'margin-left: calc(-{{SIZE}}{{UNIT}} / 2); margin-right: calc(-{{SIZE}}{{UNIT}} / 2);', |
| 172 |
$obj->selectors['columns']['grid_gap']['slider_layout'] => ' --rtsb-testimonial-slider-spacing: {{SIZE}}{{UNIT}};', |
| 173 |
$obj->selectors['columns']['grid_gap']['bottom'] => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 174 |
], |
| 175 |
]; |
| 176 |
$fields['sb_testimonial_preset_end'] = $obj->end_section(); |
| 177 |
return $fields; |
| 178 |
} |
| 179 |
|
| 180 |
|
| 181 |
/** |
| 182 |
* General section |
| 183 |
* |
| 184 |
* @param object $obj Reference object. |
| 185 |
* |
| 186 |
* @return array |
| 187 |
*/ |
| 188 |
private static function general_settings( $obj ) { |
| 189 |
$fields['general_settings_sec_start'] = $obj->start_section( |
| 190 |
esc_html__( 'General Settings', 'shopbuilder' ), |
| 191 |
'content', |
| 192 |
[], |
| 193 |
); |
| 194 |
$fields['general_settings_note'] = $obj->el_heading( esc_html__( 'Testimonial Settings', 'shopbuilder' ) ); |
| 195 |
$fields['author_name_html_tag'] = [ |
| 196 |
'label' => esc_html__( 'Author Name Tag', 'shopbuilder' ), |
| 197 |
'description' => esc_html__( 'Please select the name HTML tag.', 'shopbuilder' ), |
| 198 |
'type' => 'select', |
| 199 |
'options' => ControlHelper::heading_tags(), |
| 200 |
'default' => 'h2', |
| 201 |
'label_block' => true, |
| 202 |
]; |
| 203 |
$fields['display_quote_icon'] = [ |
| 204 |
'label' => esc_html__( 'Show Quote Icon?', 'shopbuilder' ), |
| 205 |
'description' => esc_html__( 'Switch on to display quote icon.', 'shopbuilder' ), |
| 206 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 207 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 208 |
'type' => 'switch', |
| 209 |
'separator' => 'before', |
| 210 |
'condition' => [ |
| 211 |
'layout_style!' => [ 'rtsb-testimonial-layout4' ], |
| 212 |
], |
| 213 |
]; |
| 214 |
$fields['display_author_image'] = [ |
| 215 |
'label' => esc_html__( 'Show Author Image?', 'shopbuilder' ), |
| 216 |
'description' => esc_html__( 'Switch on to show author image.', 'shopbuilder' ), |
| 217 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 218 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 219 |
'type' => 'switch', |
| 220 |
'default' => 'yes', |
| 221 |
]; |
| 222 |
$fields['display_author_designation'] = [ |
| 223 |
'label' => esc_html__( 'Show Author Designation?', 'shopbuilder' ), |
| 224 |
'description' => esc_html__( 'Switch on to show author designation.', 'shopbuilder' ), |
| 225 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 226 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 227 |
'type' => 'switch', |
| 228 |
'default' => 'yes', |
| 229 |
]; |
| 230 |
$fields['display_author_rating'] = [ |
| 231 |
'label' => esc_html__( 'Show Author Rating?', 'shopbuilder' ), |
| 232 |
'description' => esc_html__( 'Switch on to show author rating.', 'shopbuilder' ), |
| 233 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 234 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 235 |
'type' => 'switch', |
| 236 |
'default' => 'yes', |
| 237 |
]; |
| 238 |
$fields['activate_slider_item'] = [ |
| 239 |
'label' => esc_html__( 'Activate Testimonial Slider', 'shopbuilder' ), |
| 240 |
'description' => esc_html__( 'Switch on to activate testimonial slider.', 'shopbuilder' ), |
| 241 |
'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 242 |
'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 243 |
'type' => 'switch', |
| 244 |
]; |
| 245 |
$fields['author_image_size_dimension_note'] = $obj->el_heading( esc_html__( 'Image Settings', 'shopbuilder' ), 'before' ); |
| 246 |
$fields['author_image_size'] = [ |
| 247 |
'type' => 'select2', |
| 248 |
'label' => esc_html__( 'Select Image Size', 'shopbuilder' ), |
| 249 |
'description' => esc_html__( 'Please select the image size.', 'shopbuilder' ), |
| 250 |
'options' => Fns::get_image_sizes(), |
| 251 |
'default' => 'full', |
| 252 |
'label_block' => true, |
| 253 |
'content_classes' => 'elementor-descriptor', |
| 254 |
]; |
| 255 |
$fields['author_img_dimension'] = [ |
| 256 |
'type' => 'image-dimensions', |
| 257 |
'label' => esc_html__( 'Enter Custom Image Size', 'shopbuilder' ), |
| 258 |
'label_block' => true, |
| 259 |
'default' => [ |
| 260 |
'width' => 400, |
| 261 |
'height' => 400, |
| 262 |
], |
| 263 |
'condition' => [ |
| 264 |
'author_image_size' => 'rtsb_custom', |
| 265 |
], |
| 266 |
]; |
| 267 |
$fields['author_img_crop'] = [ |
| 268 |
'type' => 'select2', |
| 269 |
'label' => esc_html__( 'Image Crop', 'shopbuilder' ), |
| 270 |
'description' => esc_html__( 'Please click on "Apply" to update the image.', 'shopbuilder' ), |
| 271 |
'options' => [ |
| 272 |
'soft' => esc_html__( 'Soft Crop', 'shopbuilder' ), |
| 273 |
'hard' => esc_html__( 'Hard Crop', 'shopbuilder' ), |
| 274 |
], |
| 275 |
'default' => 'hard', |
| 276 |
'condition' => [ |
| 277 |
'author_image_size' => 'rtsb_custom', |
| 278 |
], |
| 279 |
]; |
| 280 |
$fields['author_img_custom_dimension_note'] = [ |
| 281 |
'type' => 'html', |
| 282 |
'raw' => sprintf( |
| 283 |
'<span style="display: block; background: #fffbf1; padding: 10px; font-weight: 500; line-height: 1.4; color: #bd3a3a;border: 1px solid #bd3a3a;">%s</span>', |
| 284 |
esc_html__( 'Please note that, if you enter image size larger than the actual image itself, the image sizes will fallback to the full image dimension.', 'shopbuilder' ) |
| 285 |
), |
| 286 |
'condition' => [ |
| 287 |
'author_image_size' => 'rtsb_custom', |
| 288 |
], |
| 289 |
|
| 290 |
]; |
| 291 |
$fields['general_settings_sec_end'] = $obj->end_section(); |
| 292 |
|
| 293 |
return $fields; |
| 294 |
} |
| 295 |
/** |
| 296 |
* Testimonial items |
| 297 |
* |
| 298 |
* @param object $obj Reference object. |
| 299 |
* |
| 300 |
* @return array |
| 301 |
*/ |
| 302 |
public static function testimonial_items( $obj ) { |
| 303 |
$fields['testimonial_items_settings_sec_start'] = $obj->start_section( |
| 304 |
esc_html__( 'Testimonial Items', 'shopbuilder' ), |
| 305 |
'content', |
| 306 |
[], |
| 307 |
); |
| 308 |
$fields['testimonial_items'] = [ |
| 309 |
'type' => 'repeater', |
| 310 |
'label' => esc_html__( 'Add Testimonial Items', 'shopbuilder' ), |
| 311 |
'mode' => 'repeater', |
| 312 |
'title_field' => '{{{ author_name }}}', |
| 313 |
'fields' => [ |
| 314 |
'author_image' => [ |
| 315 |
'type' => 'media', |
| 316 |
'label' => esc_html__( 'Upload Author Image', 'shopbuilder' ), |
| 317 |
'default' => [ |
| 318 |
'url' => Utils::get_placeholder_image_src(), |
| 319 |
], |
| 320 |
], |
| 321 |
'author_name' => [ |
| 322 |
'label' => esc_html__( 'Author Name', 'shopbuilder' ), |
| 323 |
'type' => 'text', |
| 324 |
'label_block' => true, |
| 325 |
'default' => esc_html__( 'Kristin Watson', 'shopbuilder' ), |
| 326 |
'separator' => 'before-short', |
| 327 |
], |
| 328 |
'author_designation' => [ |
| 329 |
'label' => esc_html__( 'Author Designation', 'shopbuilder' ), |
| 330 |
'type' => 'text', |
| 331 |
'label_block' => true, |
| 332 |
'default' => esc_html__( 'Plugin Developer', 'shopbuilder' ), |
| 333 |
], |
| 334 |
'author_rating' => [ |
| 335 |
'label' => esc_html__( 'Author Rating', 'shopbuilder' ), |
| 336 |
'type' => 'select', |
| 337 |
'options' => [ |
| 338 |
'1' => esc_html__( 'Rating 1', 'shopbuilder' ), |
| 339 |
'2' => esc_html__( 'Rating 2', 'shopbuilder' ), |
| 340 |
'3' => esc_html__( 'Rating 3', 'shopbuilder' ), |
| 341 |
'4' => esc_html__( 'Rating 4', 'shopbuilder' ), |
| 342 |
'5' => esc_html__( 'Rating 5', 'shopbuilder' ), |
| 343 |
], |
| 344 |
'default' => '5', |
| 345 |
], |
| 346 |
'author_description' => [ |
| 347 |
'label' => esc_html__( 'Author Description', 'shopbuilder' ), |
| 348 |
'type' => 'wysiwyg', |
| 349 |
'label_block' => true, |
| 350 |
'default' => esc_html__( 'Theme is nice, i almost finished integrating it in our nft guild website, need to dev one custom plugin then some adjustment and i’m done.', 'shopbuilder' ), |
| 351 |
'separator' => 'before-short', |
| 352 |
], |
| 353 |
], |
| 354 |
'default' => [ |
| 355 |
[ |
| 356 |
'author_name' => esc_html__( 'Kristin Watson', 'shopbuilder' ), |
| 357 |
'author_designation' => __( 'Senior Artist', 'shopbuilder' ), |
| 358 |
'author_description' => __( 'I love how they keep updating it. even though i am not using the website, i can say after buying many themes, this one was best.', 'shopbuilder' ), |
| 359 |
|
| 360 |
], |
| 361 |
[ |
| 362 |
'author_name' => esc_html__( 'Leslie Alexander', 'shopbuilder' ), |
| 363 |
'author_designation' => __( 'Software Developer', 'shopbuilder' ), |
| 364 |
'author_description' => __( 'Theme is nice, i almost finished integrating it in our nft guild website, need to dev one custom plugin then some adjustment and i’m done.', 'shopbuilder' ), |
| 365 |
|
| 366 |
], |
| 367 |
[ |
| 368 |
'author_name' => esc_html__( 'Darrell Steward', 'shopbuilder' ), |
| 369 |
'author_designation' => __( 'Software Developer', 'shopbuilder' ), |
| 370 |
'author_description' => __( 'Theme is nice, i almost finished integrating it in our nft guild website, need to dev one custom plugin then some adjustment and i’m done.', 'shopbuilder' ), |
| 371 |
|
| 372 |
], |
| 373 |
[ |
| 374 |
'author_name' => esc_html__( 'John Doe', 'shopbuilder' ), |
| 375 |
'author_designation' => __( 'Software Developer', 'shopbuilder' ), |
| 376 |
'author_description' => __( 'Theme is nice, i almost finished integrating it in our nft guild website, need to dev one custom plugin then some adjustment and i’m done.', 'shopbuilder' ), |
| 377 |
], |
| 378 |
|
| 379 |
], |
| 380 |
]; |
| 381 |
$fields['testimonial_items_settings_sec_end'] = $obj->end_section(); |
| 382 |
|
| 383 |
return $fields; |
| 384 |
} |
| 385 |
|
| 386 |
/** |
| 387 |
* Slider section |
| 388 |
* |
| 389 |
* @param object $obj Reference object. |
| 390 |
* |
| 391 |
* @return array |
| 392 |
*/ |
| 393 |
public static function slider_settings( $obj ) { |
| 394 |
$fields = SettingsFields::slider_settings( $obj ); |
| 395 |
unset( $fields['slider_nav_position'] ); |
| 396 |
$fields['slider_control_section']['condition'] = [ |
| 397 |
'activate_slider_item' => 'yes', |
| 398 |
]; |
| 399 |
$fields['slider_control_section']['tab'] = 'content'; |
| 400 |
return $fields; |
| 401 |
} |
| 402 |
|
| 403 |
/** |
| 404 |
* Content Box style section |
| 405 |
* |
| 406 |
* @param object $obj Reference object. |
| 407 |
* |
| 408 |
* @return array |
| 409 |
*/ |
| 410 |
private static function testimonial_item_style( $obj ) { |
| 411 |
|
| 412 |
$css_selectors = $obj->selectors['testimonial_item_style']; |
| 413 |
$title = esc_html__( 'Testimonial Item', 'shopbuilder' ); |
| 414 |
$selectors = [ |
| 415 |
'box_shadow' => $css_selectors['box_shadow'], |
| 416 |
'border' => $css_selectors['border'], |
| 417 |
'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ], |
| 418 |
'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 419 |
'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], |
| 420 |
]; |
| 421 |
|
| 422 |
$fields = ControlHelper::general_elementor_style( 'testimonial_item_style', $title, $obj, [], $selectors ); |
| 423 |
|
| 424 |
unset( |
| 425 |
$fields['testimonial_item_style_typo_note'], |
| 426 |
$fields['rtsb_el_testimonial_item_style_typography'], |
| 427 |
$fields['testimonial_item_style_color'], |
| 428 |
$fields['testimonial_item_style_alignment'], |
| 429 |
$fields['testimonial_item_style_color_tabs'], |
| 430 |
$fields['testimonial_item_style_color_tab'], |
| 431 |
$fields['testimonial_item_style_color_tab_end'], |
| 432 |
$fields['testimonial_item_style_hover_color_tab'], |
| 433 |
$fields['testimonial_item_style_hover_color'], |
| 434 |
$fields['testimonial_item_style_hover_bg_color'], |
| 435 |
$fields['testimonial_item_style_hover_color_tab_end'], |
| 436 |
$fields['testimonial_item_style_color_tabs_end'], |
| 437 |
$fields['testimonial_item_style_border_hover_color'], |
| 438 |
$fields['testimonial_item_style_margin'] |
| 439 |
); |
| 440 |
$fields['testimonial_item_style_border_note']['separator'] = 'default'; |
| 441 |
$fields['testimonial_item_style_color_note']['separator'] = 'default'; |
| 442 |
$extra_controls['testimonial_item_style_border_radius'] = [ |
| 443 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 444 |
'type' => 'dimensions', |
| 445 |
'mode' => 'responsive', |
| 446 |
'size_units' => [ 'px' ], |
| 447 |
'selectors' => $selectors['border_radius'], |
| 448 |
]; |
| 449 |
$fields = Fns::insert_controls( 'testimonial_item_style_spacing_note', $fields, $extra_controls ); |
| 450 |
|
| 451 |
$extra_controls2['rtsb_testimonial_item_style_box_shadow'] = [ |
| 452 |
'type' => 'box-shadow', |
| 453 |
'mode' => 'group', |
| 454 |
'label' => esc_html__( 'Box Shadow', 'shopbuilder' ), |
| 455 |
'selector' => $selectors['box_shadow'], |
| 456 |
]; |
| 457 |
$fields = Fns::insert_controls( 'testimonial_item_style_border_note', $fields, $extra_controls2 ); |
| 458 |
return $fields; |
| 459 |
} |
| 460 |
/** |
| 461 |
* Title style section |
| 462 |
* |
| 463 |
* @param object $obj Reference object. |
| 464 |
* |
| 465 |
* @return array |
| 466 |
*/ |
| 467 |
private static function title_style( $obj ) { |
| 468 |
$css_selectors = $obj->selectors['title_style']; |
| 469 |
$title = esc_html__( 'Title', 'shopbuilder' ); |
| 470 |
$selectors = [ |
| 471 |
'typography' => $css_selectors['typography'], |
| 472 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 473 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ], |
| 474 |
]; |
| 475 |
|
| 476 |
$fields = ControlHelper::general_elementor_style( 'title_style', $title, $obj, [], $selectors ); |
| 477 |
unset( |
| 478 |
$fields['title_style_alignment'], |
| 479 |
$fields['rtsb_el_title_style_border'], |
| 480 |
$fields['title_style_border_note'], |
| 481 |
$fields['title_style_color_tabs'], |
| 482 |
$fields['title_style_color_tab'], |
| 483 |
$fields['title_style_color_tab_end'], |
| 484 |
$fields['title_style_hover_color_tab'], |
| 485 |
$fields['title_style_bg_color'], |
| 486 |
$fields['title_style_hover_color'], |
| 487 |
$fields['title_style_hover_bg_color'], |
| 488 |
$fields['title_style_border_hover_color'], |
| 489 |
$fields['title_style_padding'], |
| 490 |
$fields['title_style_hover_color_tab_end'], |
| 491 |
$fields['title_style_color_tabs_end'], |
| 492 |
); |
| 493 |
return $fields; |
| 494 |
} |
| 495 |
/** |
| 496 |
* Rating style section |
| 497 |
* |
| 498 |
* @param object $obj Reference object. |
| 499 |
* |
| 500 |
* @return array |
| 501 |
*/ |
| 502 |
private static function rating_style( $obj ) { |
| 503 |
$css_selectors = $obj->selectors['rating_style']; |
| 504 |
$title = esc_html__( 'Rating', 'shopbuilder' ); |
| 505 |
$selectors = [ |
| 506 |
'typography' => $css_selectors['typography'], |
| 507 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 508 |
'empty_rating_color' => [ $css_selectors['empty_rating_color'] => 'color: {{VALUE}};' ], |
| 509 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ], |
| 510 |
]; |
| 511 |
|
| 512 |
$fields = ControlHelper::general_elementor_style( 'rating_style', $title, $obj, [], $selectors ); |
| 513 |
unset( |
| 514 |
$fields['rating_style_alignment'], |
| 515 |
$fields['rtsb_el_rating_style_border'], |
| 516 |
$fields['rating_style_border_note'], |
| 517 |
$fields['rating_style_color_tabs'], |
| 518 |
$fields['rating_style_color_tab'], |
| 519 |
$fields['rating_style_color_tab_end'], |
| 520 |
$fields['rating_style_hover_color_tab'], |
| 521 |
$fields['rating_style_bg_color'], |
| 522 |
$fields['rating_style_hover_color'], |
| 523 |
$fields['rating_style_hover_bg_color'], |
| 524 |
$fields['rating_style_border_hover_color'], |
| 525 |
$fields['rating_style_padding'], |
| 526 |
$fields['rating_style_hover_color_tab_end'], |
| 527 |
$fields['rating_style_color_tabs_end'], |
| 528 |
); |
| 529 |
$fields['rtsb_el_rating_style_typography']['exclude'] = [ 'font_family','font_weight','text_transform', 'text_decoration', 'font_style', 'word_spacing' ]; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude |
| 530 |
$extra_controls['rating_empty_color'] = [ |
| 531 |
'label' => __( 'Empty Rating Color', 'shopbuilder' ), |
| 532 |
'type' => 'color', |
| 533 |
'selectors' => $selectors['empty_rating_color'], |
| 534 |
]; |
| 535 |
$fields = Fns::insert_controls( 'rating_style_color', $fields, $extra_controls, true ); |
| 536 |
return $fields; |
| 537 |
} |
| 538 |
/** |
| 539 |
* Content style section |
| 540 |
* |
| 541 |
* @param object $obj Reference object. |
| 542 |
* |
| 543 |
* @return array |
| 544 |
*/ |
| 545 |
private static function content_style( $obj ) { |
| 546 |
$css_selectors = $obj->selectors['content_style']; |
| 547 |
$title = esc_html__( 'Content', 'shopbuilder' ); |
| 548 |
$selectors = [ |
| 549 |
'typography' => $css_selectors['typography'], |
| 550 |
'quote_icon_size' => [ $css_selectors['quote_icon_size'] => 'font-size:{{SIZE}}{{UNIT}}' ], |
| 551 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 552 |
'quote_icon_bg' => [ $css_selectors['quote_icon_bg'] => 'background-color: {{VALUE}};' ], |
| 553 |
'quote_icon_color' => [ $css_selectors['quote_icon_color'] => 'color: {{VALUE}};' ], |
| 554 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ], |
| 555 |
]; |
| 556 |
|
| 557 |
$fields = ControlHelper::general_elementor_style( 'content_style', $title, $obj, [], $selectors ); |
| 558 |
unset( |
| 559 |
$fields['content_style_alignment'], |
| 560 |
$fields['rtsb_el_content_style_border'], |
| 561 |
$fields['content_style_border_note'], |
| 562 |
$fields['content_style_color_tabs'], |
| 563 |
$fields['content_style_color_tab'], |
| 564 |
$fields['content_style_color_tab_end'], |
| 565 |
$fields['content_style_hover_color_tab'], |
| 566 |
$fields['content_style_bg_color'], |
| 567 |
$fields['content_style_hover_color'], |
| 568 |
$fields['content_style_hover_bg_color'], |
| 569 |
$fields['content_style_border_hover_color'], |
| 570 |
$fields['content_style_padding'], |
| 571 |
$fields['content_style_hover_color_tab_end'], |
| 572 |
$fields['content_style_color_tabs_end'], |
| 573 |
); |
| 574 |
$extra_controls['content_style_quote_icon_size'] = [ |
| 575 |
'type' => 'slider', |
| 576 |
'mode' => 'responsive', |
| 577 |
'label' => esc_html__( 'Quote Icon Size', 'shopbuilder' ), |
| 578 |
'size_units' => [ 'px' ], |
| 579 |
'range' => [ |
| 580 |
'px' => [ |
| 581 |
'min' => 0, |
| 582 |
'max' => 150, |
| 583 |
], |
| 584 |
], |
| 585 |
'selectors' => $selectors['quote_icon_size'], |
| 586 |
]; |
| 587 |
$fields = Fns::insert_controls( 'content_style_color_note', $fields, $extra_controls ); |
| 588 |
$extra_controls['content_style_quote_icon_size'] = [ |
| 589 |
'type' => 'slider', |
| 590 |
'mode' => 'responsive', |
| 591 |
'label' => esc_html__( 'Quote Icon Size', 'shopbuilder' ), |
| 592 |
'size_units' => [ 'px' ], |
| 593 |
'range' => [ |
| 594 |
'px' => [ |
| 595 |
'min' => 0, |
| 596 |
'max' => 150, |
| 597 |
], |
| 598 |
], |
| 599 |
'selectors' => $selectors['quote_icon_size'], |
| 600 |
'condition' => [ |
| 601 |
'layout_style!' => [ 'rtsb-testimonial-layout4' ], |
| 602 |
], |
| 603 |
]; |
| 604 |
$fields = Fns::insert_controls( 'content_style_color_note', $fields, $extra_controls ); |
| 605 |
$extra_controls['content_style_quote_icon_color'] = [ |
| 606 |
'type' => 'color', |
| 607 |
'label' => esc_html__( 'Quote Icon Color', 'shopbuilder' ), |
| 608 |
'selectors' => $selectors['quote_icon_color'], |
| 609 |
'condition' => [ |
| 610 |
'layout_style!' => [ 'rtsb-testimonial-layout4' ], |
| 611 |
], |
| 612 |
]; |
| 613 |
$extra_controls['content_style_quote_icon_bg_color'] = [ |
| 614 |
'type' => 'color', |
| 615 |
'label' => esc_html__( 'Quote Icon Background', 'shopbuilder' ), |
| 616 |
'selectors' => $selectors['quote_icon_bg'], |
| 617 |
'condition' => [ |
| 618 |
'layout_style' => [ 'rtsb-testimonial-layout5' ], |
| 619 |
], |
| 620 |
]; |
| 621 |
$fields = Fns::insert_controls( 'content_style_color', $fields, $extra_controls, true ); |
| 622 |
return $fields; |
| 623 |
} |
| 624 |
/** |
| 625 |
* Designation style section |
| 626 |
* |
| 627 |
* @param object $obj Reference object. |
| 628 |
* |
| 629 |
* @return array |
| 630 |
*/ |
| 631 |
private static function designation_style( $obj ) { |
| 632 |
$css_selectors = $obj->selectors['designation_style']; |
| 633 |
$title = esc_html__( 'Designation', 'shopbuilder' ); |
| 634 |
$selectors = [ |
| 635 |
'typography' => $css_selectors['typography'], |
| 636 |
'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ], |
| 637 |
'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ], |
| 638 |
]; |
| 639 |
|
| 640 |
$fields = ControlHelper::general_elementor_style( 'designation_style', $title, $obj, [], $selectors ); |
| 641 |
unset( |
| 642 |
$fields['designation_style_alignment'], |
| 643 |
$fields['rtsb_el_designation_style_border'], |
| 644 |
$fields['designation_style_border_note'], |
| 645 |
$fields['designation_style_color_tabs'], |
| 646 |
$fields['designation_style_color_tab'], |
| 647 |
$fields['designation_style_color_tab_end'], |
| 648 |
$fields['designation_style_hover_color_tab'], |
| 649 |
$fields['designation_style_bg_color'], |
| 650 |
$fields['designation_style_hover_color'], |
| 651 |
$fields['designation_style_hover_bg_color'], |
| 652 |
$fields['designation_style_border_hover_color'], |
| 653 |
$fields['designation_style_padding'], |
| 654 |
$fields['designation_style_hover_color_tab_end'], |
| 655 |
$fields['designation_style_color_tabs_end'], |
| 656 |
); |
| 657 |
return $fields; |
| 658 |
} |
| 659 |
/** |
| 660 |
* Slider Button section |
| 661 |
* |
| 662 |
* @param object $obj Reference object. |
| 663 |
* |
| 664 |
* @return array |
| 665 |
*/ |
| 666 |
public static function logo_slider_buttons( $obj ) { |
| 667 |
$slider_btn_settings = StyleFieldsFree::slider_buttons( $obj ); |
| 668 |
$slider_btn_settings['slider_buttons_style_section']['condition'] = [ |
| 669 |
'activate_slider_item' => 'yes', |
| 670 |
]; |
| 671 |
return $slider_btn_settings; |
| 672 |
} |
| 673 |
/** |
| 674 |
* Image style section |
| 675 |
* |
| 676 |
* @param object $obj Reference object. |
| 677 |
* |
| 678 |
* @return array |
| 679 |
*/ |
| 680 |
public static function image_styles( $obj ) { |
| 681 |
$fields['image_style_sec_start'] = $obj->start_section( |
| 682 |
esc_html__( 'Image', 'shopbuilder' ), |
| 683 |
'style', |
| 684 |
[], |
| 685 |
); |
| 686 |
$fields['image_styles_dimension_note'] = $obj->el_heading( esc_html__( 'Dimension', 'shopbuilder' ) ); |
| 687 |
|
| 688 |
$fields['image_styles_width'] = [ |
| 689 |
'type' => 'slider', |
| 690 |
'label' => esc_html__( 'Image Width', 'shopbuilder' ), |
| 691 |
'size_units' => [ '%', 'px' ], |
| 692 |
'range' => [ |
| 693 |
'%' => [ |
| 694 |
'min' => 0, |
| 695 |
'max' => 100, |
| 696 |
'step' => 1, |
| 697 |
], |
| 698 |
'px' => [ |
| 699 |
'min' => 0, |
| 700 |
'max' => 500, |
| 701 |
'step' => 1, |
| 702 |
], |
| 703 |
], |
| 704 |
'selectors' => [ |
| 705 |
$obj->selectors['image_style']['width'] => 'width: {{SIZE}}{{UNIT}};', |
| 706 |
], |
| 707 |
]; |
| 708 |
$fields['image_styles_max_width'] = [ |
| 709 |
'type' => 'slider', |
| 710 |
'label' => esc_html__( 'Image Max-Width', 'shopbuilder' ), |
| 711 |
'size_units' => [ '%', 'px' ], |
| 712 |
'range' => [ |
| 713 |
'%' => [ |
| 714 |
'min' => 0, |
| 715 |
'max' => 100, |
| 716 |
'step' => 1, |
| 717 |
], |
| 718 |
'px' => [ |
| 719 |
'min' => 0, |
| 720 |
'max' => 500, |
| 721 |
'step' => 1, |
| 722 |
], |
| 723 |
|
| 724 |
], |
| 725 |
'selectors' => [ |
| 726 |
$obj->selectors['image_style']['max_width'] => 'max-width: {{SIZE}}{{UNIT}};', |
| 727 |
], |
| 728 |
]; |
| 729 |
$fields['image_border_note'] = $obj->el_heading( esc_html__( 'Border', 'shopbuilder' ), 'before' ); |
| 730 |
$fields['image_border'] = [ |
| 731 |
'mode' => 'group', |
| 732 |
'type' => 'border', |
| 733 |
'label' => esc_html__( 'Border', 'shopbuilder' ), |
| 734 |
'selector' => $obj->selectors['image_style']['border'], |
| 735 |
'fields_options' => [ |
| 736 |
'color' => [ |
| 737 |
'label' => esc_html__( 'Border Color', 'shopbuilder' ), |
| 738 |
], |
| 739 |
], |
| 740 |
'separator' => 'default', |
| 741 |
]; |
| 742 |
$fields['image_styles_radius'] = [ |
| 743 |
'mode' => 'responsive', |
| 744 |
'type' => 'dimensions', |
| 745 |
'label' => esc_html__( 'Border Radius', 'shopbuilder' ), |
| 746 |
'size_units' => [ 'px', '%', 'em' ], |
| 747 |
'selectors' => [ |
| 748 |
$obj->selectors['image_style']['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 749 |
], |
| 750 |
]; |
| 751 |
$fields['image_sec_end'] = $obj->end_section(); |
| 752 |
|
| 753 |
return $fields; |
| 754 |
} |
| 755 |
} |
| 756 |
|