PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.0.0
ShopBuilder – WooCommerce Builder For Elementor v2.0.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Modules/QuickView/QuickView.php +11 -83 2.1.122.0.0 View file →
@@ -6,106 +6,34 @@
6 6 if ( ! defined( 'ABSPATH' ) ) {
7 7 exit( 'This script cannot be accessed directly.' );
8 8 }
9 9
10 -use RadiusTheme\SB\Helpers\Fns;
11 10 use RadiusTheme\SB\Modules\Compare\CompareInstaller;
12 11 use RadiusTheme\SB\Traits\SingletonTrait;
13 -use RadiusTheme\SBPRO\Modules\Badges\BadgesFns;
14 12
15 13 final class QuickView {
16 - /**
17 - * @var array
18 - */
19 - private $cache = [];
20 14
21 15 /**
22 16 * @var array
23 17 */
24 18 public $settings = [];
25 - /**
26 - * @var array|mixed
27 - */
28 - private array $options;
29 - /**
30 - * Options
31 - */
19 +
20 + //protected $module_id = 'quick_view';
21 +
32 22 use SingletonTrait;
33 23
34 - private function __construct() {
24 + function __construct() {
25 +
35 26 QuickViewFrontEnd::instance();
36 - $this->options = Fns::get_options( 'modules', 'quick_view' );
37 - add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_public_scripts' ], 99 );
27 +
38 28 do_action( 'rtsb/module/quick_view/loaded' );
39 29 }
40 30
41 31 /**
32 + * Do stuff upon plugin activation
33 + *
42 34 * @return void
43 35 */
44 - public function enqueue_public_scripts() {
45 - $cache_key = 'quick_view_style_cache';
46 - $width = ! empty( $this->options['modal_width'] ) ? $this->options['modal_width'] : '950';
47 - wp_localize_script(
48 - 'rtsb-public',
49 - 'QvModalParams',
50 - [
51 - 'modal_width' => absint( $width ),
52 - ]
53 - );
54 -
55 - if ( isset( $this->cache[ $cache_key ] ) && ! empty( $this->cache[ $cache_key ] ) ) {
56 - wp_add_inline_style( 'rtsb-frontend', $this->cache[ $cache_key ] );
57 - return;
58 - }
59 -
60 - $height = $this->options['modal_height'] ?? false;
61 - $wrapper_padding = $this->options['modal_wrapper_padding'] ?? '0';
62 - $bg_color = $this->options['modal_bg_color'] ?? false;
63 - $box_shadow = $this->options['modal_box_shadow_color'] ?? false;
64 - $overly_color = $this->options['modal_overly_color'] ?? false;
65 -
66 - ob_start();
67 -
68 - if ( $height ) { ?>
69 - .rtsb-ui-modal .rtsb-modal-content{
70 - height: <?php echo esc_attr( $height ); ?>;
71 - }
72 - <?php
73 - }
74 -
75 - if ( '' !== $wrapper_padding ) {
76 - ?>
77 - .rtsb-ui-modal .rtsb-modal-wrapper.quick-view-modal .rtsb-modal-content .rtsb-modal-body{
78 - padding: <?php echo esc_attr( $wrapper_padding ); ?>;
79 - }
80 - <?php
81 - }
82 - if ( $bg_color ) {
83 - ?>
84 - .rtsb-ui-modal .rtsb-modal-wrapper .rtsb-modal-content{
85 - background-color: <?php echo esc_attr( $bg_color ); ?>;
86 - }
87 - <?php
88 - }
89 - if ( $box_shadow ) {
90 - ?>
91 - .rtsb-ui-modal .rtsb-modal-content{
92 - box-shadow: 0 0 10px <?php echo esc_attr( $box_shadow ); ?>;
93 - }
94 - <?php
95 - }
96 -
97 - if ( $overly_color ) {
98 - ?>
99 - .rtsb-ui-modal .rtsb-mask-wrapper{
100 - background-color: <?php echo esc_attr( $overly_color ); ?>;
101 - }
102 - <?php
103 - }
104 -
105 - $dynamic_css = ob_get_clean();
106 - $this->cache[ $cache_key ] = $dynamic_css;
107 - if ( ! empty( $dynamic_css ) ) {
108 - wp_add_inline_style( 'rtsb-frontend', $dynamic_css );
109 - }
36 + public function activate() {
37 + ( new CompareInstaller() )->run();
110 38 }
111 -}
39 +}