| 1 |
<?php |
| 2 |
/** |
| 3 |
* Main ProductDescription class. |
| 4 |
* |
| 5 |
* @package RadiusTheme\SB |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace RadiusTheme\SB\Elementor\Widgets\Controls; |
| 9 |
|
| 10 |
use RadiusTheme\SB\Helpers\Fns; |
| 11 |
|
| 12 |
// Do not allow directly accessing this file. |
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit( 'This script cannot be accessed directly.' ); |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* Product Description class |
| 19 |
*/ |
| 20 |
class ActionsBtnSettings { |
| 21 |
/** |
| 22 |
* Widget Field |
| 23 |
* |
| 24 |
* @return array |
| 25 |
*/ |
| 26 |
public static function widget_fields( $widget ) { |
| 27 |
return self::general_section() + |
| 28 |
self::module_icons() + |
| 29 |
self::module_button( $widget ); |
| 30 |
} |
| 31 |
/** |
| 32 |
* Widget Field |
| 33 |
* |
| 34 |
* @return array |
| 35 |
*/ |
| 36 |
public static function general_section() { |
| 37 |
$fields = [ |
| 38 |
'sec_general' => [ |
| 39 |
'mode' => 'section_start', |
| 40 |
'label' => esc_html__( 'General', 'shopbuilder' ), |
| 41 |
], |
| 42 |
'general_style_end' => [ |
| 43 |
'mode' => 'section_end', |
| 44 |
], |
| 45 |
]; |
| 46 |
$module_switch = ModuleBtnControls::module_switch(); |
| 47 |
unset( $module_switch['quick_view_button'] ); |
| 48 |
$module_switch['wishlist_button']['separator'] = 'default'; |
| 49 |
$fields = Fns::insert_controls( 'sec_general', $fields, $module_switch, true ); |
| 50 |
return $fields; |
| 51 |
} |
| 52 |
/** |
| 53 |
* Widget Field |
| 54 |
* |
| 55 |
* @return array |
| 56 |
*/ |
| 57 |
public static function module_button( $widget ) { |
| 58 |
$fields = ModuleBtnControls::module_button_style( $widget ); |
| 59 |
if( ! empty( $fields )) { |
| 60 |
$fields['module_section']['label'] = esc_html__('Wishlist & Compare', 'shopbuilder'); |
| 61 |
$fields['module_section']['conditions']['terms'] = [ |
| 62 |
[ |
| 63 |
'name' => 'wishlist_button', |
| 64 |
'operator' => '===', |
| 65 |
'value' => 'yes', |
| 66 |
], |
| 67 |
[ |
| 68 |
'name' => 'comparison_button', |
| 69 |
'operator' => '===', |
| 70 |
'value' => 'yes', |
| 71 |
], |
| 72 |
]; |
| 73 |
} |
| 74 |
return $fields; |
| 75 |
} |
| 76 |
/** |
| 77 |
* Widget Field |
| 78 |
* |
| 79 |
* @return array |
| 80 |
*/ |
| 81 |
public static function module_icons() { |
| 82 |
|
| 83 |
$fields['module_icon_style_section'] = [ |
| 84 |
'mode' => 'section_start', |
| 85 |
'label' => esc_html__( 'Icons', 'shopbuilder' ), |
| 86 |
'conditions' => [ |
| 87 |
'terms' => [ |
| 88 |
[ |
| 89 |
'name' => 'wishlist_button', |
| 90 |
'operator' => '===', |
| 91 |
'value' => 'yes', |
| 92 |
], |
| 93 |
[ |
| 94 |
'name' => 'comparison_button', |
| 95 |
'operator' => '===', |
| 96 |
'value' => 'yes', |
| 97 |
], |
| 98 |
], |
| 99 |
], |
| 100 |
]; |
| 101 |
|
| 102 |
$fields = $fields + ModuleBtnControls::module_icons(); |
| 103 |
|
| 104 |
unset( $fields['quick_view_icon'] ); |
| 105 |
|
| 106 |
$fields['module_icon_style_section_end'] = [ |
| 107 |
'mode' => 'section_end', |
| 108 |
]; |
| 109 |
|
| 110 |
return $fields; |
| 111 |
} |
| 112 |
|
| 113 |
} |
| 114 |
|