PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 4.0.5
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v4.0.5
4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / EmbedPress / Includes / Traits / Branding.php
embedpress / EmbedPress / Includes / Traits Last commit date
Branding.php 2 years ago Shared.php 2 years ago
Branding.php
198 lines
1 <?php
2 namespace EmbedPress\Includes\Traits;
3 if ( !defined( 'ABSPATH' ) ) {
4 exit;
5 } // Exit if accessed directly
6 use Elementor\Controls_Manager as Controls_Manager;
7 use Elementor\Group_Control_Image_Size;
8
9 Trait Branding {
10 /**
11 * @param string $provider_name
12 */
13 public function init_branding_controls( $provider_name='' ) {
14 if ( !isset( $this->pro_class) ) {
15 $this->pro_class = '';
16 }
17 if ( !isset( $this->pro_text) ) {
18 $this->pro_text = '';
19 }
20 $logo_condition = [
21 "embedpress_pro_{$provider_name}_logo[url]!" =>''
22 ];
23 $condition = [];
24 if ( $provider_name !== 'document' ) {
25 $logo_condition["embedpress_pro_embeded_source"] = $provider_name;
26 $condition["embedpress_pro_embeded_source"] = $provider_name;
27 }
28 $this->add_control(
29 "{$provider_name}_custom_logo_cta_heading",
30 [
31 'label' => __( 'Custom Branding', 'embedpress' ),
32 'type' => Controls_Manager::HEADING,
33 'separator' => 'before',
34 'condition' => $condition,
35 ]
36 );
37 $this->add_control(
38 "embedpress_pro_{$provider_name}_logo",
39 [
40 'label' => sprintf(__( 'Custom Logo %s', 'embedpress' ), $this->pro_text ),
41 'description' => __( 'Leave it empty to hide it', 'embedpress' ),
42 'type' => Controls_Manager::MEDIA,
43 'dynamic' => [
44 'active' => true,
45 ],
46 'classes' => $this->pro_class,
47 'condition' => $condition,
48 ]
49 );
50 $this->add_group_control(
51 Group_Control_Image_Size::get_type(),
52 [
53 'name' => "embedpress_pro_{$provider_name}_logo",
54 'default' => 'full',
55 'condition' => $logo_condition,
56 'classes' => $this->pro_class,
57 ]
58 );
59 $this->add_responsive_control(
60 "embedpress_pro_{$provider_name}_logo_xpos",
61 [
62 'label' => sprintf( __( 'Logo X Position %s', 'embedpress' ), $this->pro_text),
63 'description' => __( 'Change this number to move your logo in horizontal direction.', 'embedpress' ),
64 'type' => Controls_Manager::SLIDER,
65 'size_units' => [ 'px', '%' ],
66 'range' => [
67 'px' => [
68 'min' => 0,
69 'max' => 1000,
70 'step' => 5,
71 ],
72 '%' => [
73 'min' => 0,
74 'max' => 100,
75 ],
76 ],
77 'default' => [
78 'unit' => '%',
79 'size' => 10,
80 ],
81 'selectors' => [
82 "{{WRAPPER}} .ose-{$provider_name} .watermark, {{WRAPPER}} .ep-embed-content-wraper .watermark" => 'right: {{SIZE}}{{UNIT}};',
83 ],
84 'condition' => $logo_condition,
85 'classes' => $this->pro_class,
86 ]
87 );
88 $this->add_responsive_control(
89 "embedpress_pro_{$provider_name}_logo_ypos",
90 [
91 'label' => sprintf( __( 'Logo Y Position %s', 'embedpress' ), $this->pro_text),
92 'description' => __( 'Change this number to move your logo in vertical direction.', 'embedpress' ),
93 'type' => Controls_Manager::SLIDER,
94 'size_units' => [ 'px', '%' ],
95 'range' => [
96 'px' => [
97 'min' => 0,
98 'max' => 1000,
99 'step' => 5,
100 ],
101 '%' => [
102 'min' => 0,
103 'max' => 100,
104 ],
105 ],
106 'default' => [
107 'unit' => '%',
108 'size' => 10,
109 ],
110 'selectors' => [
111 "{{WRAPPER}} .ose-{$provider_name} .watermark, {{WRAPPER}} .ep-embed-content-wraper .watermark" => 'bottom: {{SIZE}}{{UNIT}};',
112 ],
113 'condition' => $logo_condition,
114 'classes' => $this->pro_class,
115
116 ]
117 );
118 $this->start_controls_tabs(
119 "ep_{$provider_name}_cta_style_tabs",
120 [
121 'condition' => $logo_condition,
122 ]
123 );
124 $this->start_controls_tab( "ep_{$provider_name}_cta_normal_tab",
125 [
126 'label' => __( 'Normal', 'embedpress' ),
127 ]
128 );
129 $this->add_control(
130 "embedpress_pro_{$provider_name}_logo_opacity",
131 [
132 'label' => sprintf( __( 'Logo Opacity %s', 'embedpress' ), $this->pro_text),
133 'type' => Controls_Manager::SLIDER,
134 'default' => [
135 'size' => .5,
136 ],
137 'range' => [
138 'px' => [
139 'max' => 1,
140 'step' => 0.01,
141 ],
142 ],
143 'selectors' => [
144 "{{WRAPPER}} .ose-{$provider_name} .watermark, {{WRAPPER}} .ep-embed-content-wraper .watermark" => 'opacity: {{SIZE}}!important;',
145 ],
146 'condition' => $logo_condition,
147 'classes' => $this->pro_class,
148
149 ]
150 );
151 $this->end_controls_tab();
152 $this->start_controls_tab( "ep_{$provider_name}_cta_hover__tab",
153 [
154 'label' => __( 'Hover', 'embedpress' ),
155 ]
156 );
157 $this->add_control(
158 "embedpress_pro_{$provider_name}_logo_opacity_hover",
159 [
160 'label' => sprintf( __( 'Logo Opacity %s', 'embedpress' ), $this->pro_text),
161 'type' => Controls_Manager::SLIDER,
162 'size_units' => [ '%'],
163 'default' => [
164 'size' => 1,
165 ],
166 'range' => [
167 'px' => [
168 'max' => 1,
169 'step' => 0.01,
170 ],
171 ],
172 'selectors' => [
173 "{{WRAPPER}} .ose-{$provider_name} .watermark:hover, {{WRAPPER}} .ep-embed-content-wraper .watermark:hover" => 'opacity: {{SIZE}};',
174 ],
175 'condition' => $logo_condition,
176 'classes' => $this->pro_class,
177
178 ]
179 );
180 $this->end_controls_tab();
181 $this->end_controls_tabs();
182 $this->add_control(
183 "embedpress_pro_{$provider_name}_cta",
184 [
185 'label' => sprintf( __( 'CTA link for Logo %s', 'embedpress' ), $this->pro_text),
186 'description' => __( 'You can show the logo inside a link. Leave it empty to hide it', 'embedpress' ),
187 'type' => Controls_Manager::URL,
188 'dynamic' => [
189 'active' => true,
190 ],
191 'placeholder' => __( 'https://your-link.com', 'embedpress' ),
192 'condition' => $logo_condition,
193 'classes' => $this->pro_class,
194 'separator' => 'before',
195 ]
196 );
197 }
198 }