Sydney Toolbox - Version 1.03

Version Description

  • Added Elementor blocks and support
Download this release

Release Info

Developer athemes
Plugin Icon wp plugin Sydney Toolbox
Version 1.03
Comparing to
See all releases

Code changes from version 1.01 to 1.03

README.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: athemes, vladff
3
  Tags: sydney, custom post types, custom fields
4
  Requires at least: 4.0
5
- Tested up to: 4.5
6
- Stable tag: 1.01
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -28,6 +28,12 @@ None yet.
28
 
29
  == Changelog ==
30
 
 
 
 
 
 
 
31
  = 1.01 =
32
  * Loading logic change for singles metabox
33
 
2
  Contributors: athemes, vladff
3
  Tags: sydney, custom post types, custom fields
4
  Requires at least: 4.0
5
+ Tested up to: 4.9.4
6
+ Stable tag: 1.03
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
28
 
29
  == Changelog ==
30
 
31
+ = 1.03 =
32
+ * Added Elementor blocks and support
33
+
34
+ = 1.02 =
35
+ * Updated version number
36
+
37
  = 1.01 =
38
  * Loading logic change for singles metabox
39
 
inc/elementor/block-employee-carousel.php ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ /**
9
+ * Elementor icon list widget.
10
+ *
11
+ * Elementor widget that displays a bullet list with any chosen icons and texts.
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class aThemes_Employee_Carousel extends Widget_Base {
16
+
17
+ /**
18
+ * Get widget name.
19
+ *
20
+ * Retrieve icon list widget name.
21
+ *
22
+ * @since 1.0.0
23
+ * @access public
24
+ *
25
+ * @return string Widget name.
26
+ */
27
+ public function get_name() {
28
+ return 'athemes-employee-carousel';
29
+ }
30
+
31
+ /**
32
+ * Get widget title.
33
+ *
34
+ * Retrieve icon list widget title.
35
+ *
36
+ * @since 1.0.0
37
+ * @access public
38
+ *
39
+ * @return string Widget title.
40
+ */
41
+ public function get_title() {
42
+ return __( 'aThemes: Employee carousel', 'elementor' );
43
+ }
44
+
45
+ /**
46
+ * Get widget icon.
47
+ *
48
+ * Retrieve icon list widget icon.
49
+ *
50
+ * @since 1.0.0
51
+ * @access public
52
+ *
53
+ * @return string Widget icon.
54
+ */
55
+ public function get_icon() {
56
+ return 'eicon-person';
57
+ }
58
+
59
+ /**
60
+ * Get widget categories.
61
+ *
62
+ * Retrieve the list of categories the icon list widget belongs to.
63
+ *
64
+ * Used to determine where to display the widget in the editor.
65
+ *
66
+ * @since 1.0.0
67
+ * @access public
68
+ *
69
+ * @return array Widget categories.
70
+ */
71
+ public function get_categories() {
72
+ return [ 'sydney-elements' ];
73
+ }
74
+
75
+ /**
76
+ * Register icon list widget controls.
77
+ *
78
+ * Adds different input fields to allow the user to change and customize the widget settings.
79
+ *
80
+ * @since 1.0.0
81
+ * @access protected
82
+ */
83
+ protected function _register_controls() {
84
+ $this->start_controls_section(
85
+ 'section_timeline',
86
+ [
87
+ 'label' => __( 'Employee Carousel', 'elementor' ),
88
+ ]
89
+ );
90
+
91
+ $this->add_control(
92
+ 'employee_list',
93
+ [
94
+ 'label' => __( 'Employee list', 'elementor' ),
95
+ 'type' => Controls_Manager::REPEATER,
96
+ 'default' => [
97
+ ],
98
+ 'fields' => [
99
+ [
100
+ 'name' => 'image',
101
+ 'label' => __( 'Choose Image', 'elementor' ),
102
+ 'type' => Controls_Manager::MEDIA,
103
+ ],
104
+ [
105
+ 'name' => 'person',
106
+ 'label' => __( 'Employee name', 'elementor' ),
107
+ 'type' => Controls_Manager::TEXT,
108
+ 'label_block' => true,
109
+ 'placeholder' => __( 'Employee name', 'elementor' ),
110
+ 'default' => __( 'John Doe', 'elementor' ),
111
+ ],
112
+ [
113
+ 'name' => 'position',
114
+ 'label' => __( 'Position', 'elementor' ),
115
+ 'type' => Controls_Manager::TEXT,
116
+ 'default' => __( 'General Manager', 'elementor' ),
117
+ 'placeholder' => __( 'Enter the position', 'elementor' ),
118
+ 'label_block' => true,
119
+ ],
120
+ [
121
+ 'name' => 'facebook',
122
+ 'label' => __( 'Facebook link', 'elementor' ),
123
+ 'type' => Controls_Manager::URL,
124
+ 'placeholder' => __( 'https://your-link.com', 'elementor' ),
125
+ ],
126
+ [
127
+ 'name' => 'twitter',
128
+ 'label' => __( 'Twitter link', 'elementor' ),
129
+ 'type' => Controls_Manager::URL,
130
+ 'placeholder' => __( 'https://your-link.com', 'elementor' ),
131
+ ],
132
+ [
133
+ 'name' => 'linkedin',
134
+ 'label' => __( 'Linkedin link', 'elementor' ),
135
+ 'type' => Controls_Manager::URL,
136
+ 'placeholder' => __( 'https://your-link.com', 'elementor' ),
137
+ ],
138
+ [
139
+ 'name' => 'link',
140
+ 'label' => __( 'Link (for person\'s name)', 'elementor' ),
141
+ 'type' => Controls_Manager::URL,
142
+ 'placeholder' => __( 'https://your-link.com', 'elementor' ),
143
+ ],
144
+ ],
145
+ ]
146
+ );
147
+
148
+
149
+ $this->add_control(
150
+ 'view',
151
+ [
152
+ 'label' => __( 'View', 'elementor' ),
153
+ 'type' => Controls_Manager::HIDDEN,
154
+ 'default' => 'traditional',
155
+ ]
156
+ );
157
+
158
+ $this->end_controls_section();
159
+
160
+ //General styles
161
+ $this->start_controls_section(
162
+ 'section_general_style',
163
+ [
164
+ 'label' => __( 'General', 'elementor' ),
165
+ 'tab' => Controls_Manager::TAB_STYLE,
166
+ ]
167
+ );
168
+ $this->add_control(
169
+ 'event_title_color',
170
+ [
171
+ 'label' => __( 'Color', 'elementor' ),
172
+ 'type' => Controls_Manager::COLOR,
173
+ 'default' => '',
174
+ 'selectors' => [
175
+ '{{WRAPPER}} .roll-team .team-item .team-pop, {{WRAPPER}} .owl-theme .owl-controls .owl-page.active span, {{WRAPPER}} .owl-theme .owl-controls.clickable .owl-page:hover span' => 'background-color: {{VALUE}};',
176
+ '{{WRAPPER}} .owl-theme .owl-controls .owl-page span' => 'border-color: {{VALUE}};',
177
+ ],
178
+ ]
179
+ );
180
+
181
+ $this->end_controls_section();
182
+ //End general styles
183
+
184
+ //Employee name styles
185
+ $this->start_controls_section(
186
+ 'section_employee_name_style',
187
+ [
188
+ 'label' => __( 'Employee name', 'elementor' ),
189
+ 'tab' => Controls_Manager::TAB_STYLE,
190
+ ]
191
+ );
192
+ $this->add_control(
193
+ 'employee_name_color',
194
+ [
195
+ 'label' => __( 'Color', 'elementor' ),
196
+ 'type' => Controls_Manager::COLOR,
197
+ 'default' => '',
198
+ 'selectors' => [
199
+ '{{WRAPPER}} .roll-team .team-content .name, {{WRAPPER}} .roll-team .team-content .name a' => 'color: {{VALUE}};',
200
+ ],
201
+ ]
202
+ );
203
+ $this->add_group_control(
204
+ Group_Control_Typography::get_type(),
205
+ [
206
+ 'name' => 'employee_name_typography',
207
+ 'selector' => '{{WRAPPER}} .roll-team .team-content .name',
208
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
209
+ ]
210
+ );
211
+
212
+ $this->end_controls_section();
213
+ //End event date styles
214
+
215
+
216
+ //Employee position styles
217
+ $this->start_controls_section(
218
+ 'section_employee_position_style',
219
+ [
220
+ 'label' => __( 'Employee position', 'elementor' ),
221
+ 'tab' => Controls_Manager::TAB_STYLE,
222
+ ]
223
+ );
224
+ $this->add_control(
225
+ 'employee_position_color',
226
+ [
227
+ 'label' => __( 'Color', 'elementor' ),
228
+ 'type' => Controls_Manager::COLOR,
229
+ 'default' => '',
230
+ 'selectors' => [
231
+ '{{WRAPPER}} .roll-team .team-content .pos' => 'color: {{VALUE}};',
232
+ ],
233
+ ]
234
+ );
235
+ $this->add_group_control(
236
+ Group_Control_Typography::get_type(),
237
+ [
238
+ 'name' => 'employee_position_typography',
239
+ 'selector' => '{{WRAPPER}} .roll-team .team-content .pos',
240
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
241
+ ]
242
+ );
243
+
244
+ $this->end_controls_section();
245
+ //End employee position styles
246
+ }
247
+
248
+ /**
249
+ * Render icon list widget output on the frontend.
250
+ *
251
+ * Written in PHP and used to generate the final HTML.
252
+ *
253
+ * @since 1.0.0
254
+ * @access protected
255
+ */
256
+ protected function render() {
257
+ $settings = $this->get_settings();
258
+ ?>
259
+
260
+ <div class="roll-team carousel owl-carousel" data-widgetid="employees-<?php //echo $this->get_id(); ?>">
261
+ <?php foreach ( $settings['employee_list'] as $index => $item ) : ?>
262
+ <?php //Get the custom field values
263
+ $name = $item['person'];
264
+ $position = $item['position'];
265
+ $facebook = $item['facebook']['url'];
266
+ $twitter = $item['twitter']['url'];
267
+ $linkedin = $item['linkedin']['url'];
268
+ $link = $item['link']['url'];
269
+ ?>
270
+ <div class="team-item">
271
+ <div class="team-inner">
272
+ <div class="pop-overlay">
273
+ <div class="team-pop">
274
+ <div class="team-info">
275
+ <div class="name"><?php echo esc_html( $name ); ?></div>
276
+ <div class="pos"><?php echo esc_html($position); ?></div>
277
+ <ul class="team-social">
278
+ <?php if ($facebook != '') : ?>
279
+ <li><a class="facebook" href="<?php echo esc_url($facebook); ?>" target="_blank"><i class="fa fa-facebook"></i></a></li>
280
+ <?php endif; ?>
281
+ <?php if ($twitter != '') : ?>
282
+ <li><a class="twitter" href="<?php echo esc_url($twitter); ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
283
+ <?php endif; ?>
284
+ <?php if ($linkedin != '') : ?>
285
+ <li><a class="linkedin" href="<?php echo esc_url($linkedin); ?>" target="_blank"><i class="fa fa-linkedin"></i></a></li>
286
+ <?php endif; ?>
287
+ </ul>
288
+ </div>
289
+ </div>
290
+ </div>
291
+ <?php
292
+ if ( ! empty( $item['image']['url'] ) ) { ?>
293
+ <div class="avatar">
294
+ <img src="<?php echo esc_url( $item['image']['url'] ); ?>"/>
295
+ </div>
296
+ <?php
297
+ }
298
+ ?>
299
+ </div>
300
+ <div class="team-content">
301
+ <div class="name">
302
+ <?php if ( $link == '' ) : ?>
303
+ <?php echo esc_html( $name ); ?>
304
+ <?php else : ?>
305
+ <a href="<?php echo esc_url($link); ?>"><?php echo esc_html( $name ); ?></a>
306
+ <?php endif; ?>
307
+ </div>
308
+ <div class="pos"><?php echo esc_html( $position ); ?></div>
309
+ </div>
310
+ </div><!-- /.team-item -->
311
+
312
+ <?php endforeach; ?>
313
+ </div>
314
+ <?php
315
+ }
316
+
317
+ /**
318
+ * Render icon list widget output in the editor.
319
+ *
320
+ * Written as a Backbone JavaScript template and used to generate the live preview.
321
+ *
322
+ * @since 1.0.0
323
+ * @access protected
324
+ */
325
+ protected function _content_template() {
326
+ }
327
+ }
328
+ Plugin::instance()->widgets_manager->register_widget_type( new aThemes_Employee_Carousel() );
inc/elementor/block-employee.php ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ /**
9
+ * Elementor icon list widget.
10
+ *
11
+ * Elementor widget that displays a bullet list with any chosen icons and texts.
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class aThemes_Employee extends Widget_Base {
16
+
17
+ /**
18
+ * Get widget name.
19
+ *
20
+ * Retrieve icon list widget name.
21
+ *
22
+ * @since 1.0.0
23
+ * @access public
24
+ *
25
+ * @return string Widget name.
26
+ */
27
+ public function get_name() {
28
+ return 'athemes-employee';
29
+ }
30
+
31
+ /**
32
+ * Get widget title.
33
+ *
34
+ * Retrieve icon list widget title.
35
+ *
36
+ * @since 1.0.0
37
+ * @access public
38
+ *
39
+ * @return string Widget title.
40
+ */
41
+ public function get_title() {
42
+ return __( 'aThemes: Employee', 'elementor' );
43
+ }
44
+
45
+ /**
46
+ * Get widget icon.
47
+ *
48
+ * Retrieve icon list widget icon.
49
+ *
50
+ * @since 1.0.0
51
+ * @access public
52
+ *
53
+ * @return string Widget icon.
54
+ */
55
+ public function get_icon() {
56
+ return 'eicon-person';
57
+ }
58
+
59
+ /**
60
+ * Get widget categories.
61
+ *
62
+ * Retrieve the list of categories the icon list widget belongs to.
63
+ *
64
+ * Used to determine where to display the widget in the editor.
65
+ *
66
+ * @since 1.0.0
67
+ * @access public
68
+ *
69
+ * @return array Widget categories.
70
+ */
71
+ public function get_categories() {
72
+ return [ 'sydney-elements' ];
73
+ }
74
+
75
+ /**
76
+ * Register icon list widget controls.
77
+ *
78
+ * Adds different input fields to allow the user to change and customize the widget settings.
79
+ *
80
+ * @since 1.0.0
81
+ * @access protected
82
+ */
83
+ protected function _register_controls() {
84
+ $this->start_controls_section(
85
+ 'section_timeline',
86
+ [
87
+ 'label' => __( 'Employee', 'elementor' ),
88
+ ]
89
+ );
90
+
91
+ $this->add_control(
92
+ 'style',
93
+ [
94
+ 'label' => __( 'Style', 'elementor' ),
95
+ 'type' => Controls_Manager::SELECT,
96
+ 'options' => [
97
+ 'style1' => __( 'Style 1', 'elementor' ),
98
+ 'style2' => __( 'Style 2', 'elementor' ),
99
+ ],
100
+ 'default' => 'style2',
101
+ ]
102
+ );
103
+
104
+ $this->add_control(
105
+ 'image',
106
+ [
107
+ 'label' => __( 'Choose Image', 'elementor' ),
108
+ 'type' => Controls_Manager::MEDIA,
109
+ 'default' => [
110
+ 'url' => Utils::get_placeholder_image_src(),
111
+ ],
112
+ ]
113
+ );
114
+
115
+
116
+ $this->add_control(
117
+ 'name',
118
+ [
119
+ 'label' => __( 'Employee name', 'elementor' ),
120
+ 'type' => Controls_Manager::TEXT,
121
+ 'default' => __( 'John Doe', 'elementor' ),
122
+ 'placeholder' => __( 'Enter the name', 'elementor' ),
123
+ 'label_block' => true,
124
+ ]
125
+ );
126
+
127
+ $this->add_control(
128
+ 'position',
129
+ [
130
+ 'label' => __( 'Position', 'elementor' ),
131
+ 'type' => Controls_Manager::TEXT,
132
+ 'default' => __( 'General Manager', 'elementor' ),
133
+ 'placeholder' => __( 'Enter the position', 'elementor' ),
134
+ 'label_block' => true,
135
+ ]
136
+ );
137
+
138
+ $this->add_control(
139
+ 'facebook',
140
+ [
141
+ 'label' => __( 'Facebook link', 'elementor' ),
142
+ 'type' => Controls_Manager::URL,
143
+ 'placeholder' => __( 'https://your-link.com', 'elementor' ),
144
+ 'separator' => 'before',
145
+ ]
146
+ );
147
+ $this->add_control(
148
+ 'twitter',
149
+ [
150
+ 'label' => __( 'Twitter link', 'elementor' ),
151
+ 'type' => Controls_Manager::URL,
152
+ 'placeholder' => __( 'https://your-link.com', 'elementor' ),
153
+ 'separator' => 'before',
154
+ ]
155
+ );
156
+ $this->add_control(
157
+ 'linkedin',
158
+ [
159
+ 'label' => __( 'Linkedin link', 'elementor' ),
160
+ 'type' => Controls_Manager::URL,
161
+ 'placeholder' => __( 'https://your-link.com', 'elementor' ),
162
+ 'separator' => 'before',
163
+ ]
164
+ );
165
+
166
+
167
+ $this->add_control(
168
+ 'link',
169
+ [
170
+ 'label' => __( 'Link (for person\'s name)', 'elementor' ),
171
+ 'type' => Controls_Manager::URL,
172
+ 'placeholder' => __( 'https://your-link.com', 'elementor' ),
173
+ 'separator' => 'before',
174
+ ]
175
+ );
176
+
177
+
178
+
179
+
180
+ $this->add_control(
181
+ 'view',
182
+ [
183
+ 'label' => __( 'View', 'elementor' ),
184
+ 'type' => Controls_Manager::HIDDEN,
185
+ 'default' => 'traditional',
186
+ ]
187
+ );
188
+
189
+ $this->end_controls_section();
190
+
191
+ //General styles
192
+ $this->start_controls_section(
193
+ 'section_general_style',
194
+ [
195
+ 'label' => __( 'General', 'elementor' ),
196
+ 'tab' => Controls_Manager::TAB_STYLE,
197
+ ]
198
+ );
199
+ $this->add_control(
200
+ 'event_title_color',
201
+ [
202
+ 'label' => __( 'Color', 'elementor' ),
203
+ 'type' => Controls_Manager::COLOR,
204
+ 'default' => '',
205
+ 'selectors' => [
206
+ '{{WRAPPER}} .roll-team.type-b.style2 .avatar::after,{{WRAPPER}} .roll-team.type-b.style1 .team-item .team-social li:hover a' => 'background-color: {{VALUE}};',
207
+ '{{WRAPPER}} .roll-team.type-b.style2 .team-item .team-social li:hover a,{{WRAPPER}} .roll-team.type-b.style1 .team-social li a' => 'color: {{VALUE}};',
208
+ '{{WRAPPER}} .roll-team.type-b.style1 .team-social li a' => 'border-color: {{VALUE}};',
209
+ '{{WRAPPER}} .roll-team.type-b.style1 .team-social li a:hover' => 'color: #fff;',
210
+ ],
211
+ ]
212
+ );
213
+
214
+ $this->end_controls_section();
215
+ //End general styles
216
+
217
+ //Employee name styles
218
+ $this->start_controls_section(
219
+ 'section_employee_name_style',
220
+ [
221
+ 'label' => __( 'Employee name', 'elementor' ),
222
+ 'tab' => Controls_Manager::TAB_STYLE,
223
+ ]
224
+ );
225
+ $this->add_control(
226
+ 'employee_name_color',
227
+ [
228
+ 'label' => __( 'Color', 'elementor' ),
229
+ 'type' => Controls_Manager::COLOR,
230
+ 'default' => '',
231
+ 'selectors' => [
232
+ '{{WRAPPER}} .roll-team .team-content .name, {{WRAPPER}} .roll-team .team-content .name a' => 'color: {{VALUE}};',
233
+ ],
234
+ ]
235
+ );
236
+ $this->add_group_control(
237
+ Group_Control_Typography::get_type(),
238
+ [
239
+ 'name' => 'employee_name_typography',
240
+ 'selector' => '{{WRAPPER}} .roll-team .team-content .name',
241
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
242
+ ]
243
+ );
244
+
245
+ $this->end_controls_section();
246
+ //End event date styles
247
+
248
+
249
+ //Employee position styles
250
+ $this->start_controls_section(
251
+ 'section_employee_position_style',
252
+ [
253
+ 'label' => __( 'Employee position', 'elementor' ),
254
+ 'tab' => Controls_Manager::TAB_STYLE,
255
+ ]
256
+ );
257
+ $this->add_control(
258
+ 'employee_position_color',
259
+ [
260
+ 'label' => __( 'Color', 'elementor' ),
261
+ 'type' => Controls_Manager::COLOR,
262
+ 'default' => '',
263
+ 'selectors' => [
264
+ '{{WRAPPER}} .roll-team .team-content .pos' => 'color: {{VALUE}};',
265
+ ],
266
+ ]
267
+ );
268
+ $this->add_group_control(
269
+ Group_Control_Typography::get_type(),
270
+ [
271
+ 'name' => 'employee_position_typography',
272
+ 'selector' => '{{WRAPPER}} .roll-team .team-content .pos',
273
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
274
+ ]
275
+ );
276
+
277
+ $this->end_controls_section();
278
+ //End employee position styles
279
+
280
+ }
281
+
282
+ /**
283
+ * Render icon list widget output on the frontend.
284
+ *
285
+ * Written in PHP and used to generate the final HTML.
286
+ *
287
+ * @since 1.0.0
288
+ * @access protected
289
+ */
290
+ protected function render() {
291
+ $settings = $this->get_settings();
292
+ $style = $settings['style'];
293
+ ?>
294
+
295
+ <div class="roll-team type-b <?php echo $style; ?>">
296
+ <div class="team-item">
297
+ <div class="team-inner">
298
+ <?php
299
+ if ( ! empty( $settings['image']['url'] ) ) {
300
+ $this->add_render_attribute( 'image', 'src', $settings['image']['url'] );
301
+ $this->add_render_attribute( 'image', 'alt', Control_Media::get_image_alt( $settings['image'] ) );
302
+ $this->add_render_attribute( 'image', 'title', Control_Media::get_image_title( $settings['image'] ) );
303
+ ?>
304
+ <div class="avatar">
305
+ <img <?php echo $this->get_render_attribute_string( 'image' ); ?>/>
306
+ </div>
307
+ <?php
308
+ }
309
+ ?>
310
+ </div>
311
+ <div class="team-content">
312
+ <div class="name">
313
+ <?php if ( ! empty( $settings['link']['url'] ) ) {
314
+ $this->add_render_attribute( 'link', 'href', $settings['link']['url'] );
315
+
316
+ if ( $settings['link']['is_external'] ) {
317
+ $this->add_render_attribute( 'link', 'target', '_blank' );
318
+ }
319
+
320
+ if ( ! empty( $settings['link']['nofollow'] ) ) {
321
+ $this->add_render_attribute( 'link', 'rel', 'nofollow' );
322
+ }
323
+ ?>
324
+ <a <?php echo $this->get_render_attribute_string( 'link' ); ?>><?php echo esc_html( $settings['name'] ); ?></a>
325
+ <?php
326
+ } else {
327
+ echo esc_html( $settings['name'] );
328
+ }
329
+ ?>
330
+ </div>
331
+ <div class="pos"><?php echo esc_html( $settings['position'] ); ?></div>
332
+ <ul class="team-social">
333
+ <li><a class="facebook" href="<?php echo esc_url( $settings['facebook']['url'] ); ?>" target="_blank"><i class="fa fa-facebook"></i></a></li>
334
+ <li><a class="twitter" href="<?php echo esc_url( $settings['twitter']['url'] ); ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
335
+ <li><a class="linkedin" href="<?php echo esc_url( $settings['linkedin']['url'] ); ?>" target="_blank"><i class="fa fa-linkedin"></i></a></li>
336
+ </ul>
337
+ </div>
338
+ </div><!-- /.team-item -->
339
+ </div>
340
+
341
+ <?php
342
+ }
343
+
344
+ /**
345
+ * Render icon list widget output in the editor.
346
+ *
347
+ * Written as a Backbone JavaScript template and used to generate the live preview.
348
+ *
349
+ * @since 1.0.0
350
+ * @access protected
351
+ */
352
+ protected function _content_template() {
353
+ }
354
+ }
355
+ Plugin::instance()->widgets_manager->register_widget_type( new aThemes_Employee() );
inc/elementor/block-portfolio.php ADDED
@@ -0,0 +1,363 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ /**
9
+ * Elementor icon list widget.
10
+ *
11
+ * Elementor widget that displays a bullet list with any chosen icons and texts.
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class aThemes_Portfolio extends Widget_Base {
16
+
17
+ /**
18
+ * Get widget name.
19
+ *
20
+ * Retrieve icon list widget name.
21
+ *
22
+ * @since 1.0.0
23
+ * @access public
24
+ *
25
+ * @return string Widget name.
26
+ */
27
+ public function get_name() {
28
+ return 'athemes-portfolio';
29
+ }
30
+
31
+ /**
32
+ * Get widget title.
33
+ *
34
+ * Retrieve icon list widget title.
35
+ *
36
+ * @since 1.0.0
37
+ * @access public
38
+ *
39
+ * @return string Widget title.
40
+ */
41
+ public function get_title() {
42
+ return __( 'aThemes: Portfolio', 'elementor' );
43
+ }
44
+
45
+ /**
46
+ * Get widget icon.
47
+ *
48
+ * Retrieve icon list widget icon.
49
+ *
50
+ * @since 1.0.0
51
+ * @access public
52
+ *
53
+ * @return string Widget icon.
54
+ */
55
+ public function get_icon() {
56
+ return 'eicon-gallery-grid';
57
+ }
58
+
59
+ /**
60
+ * Get widget categories.
61
+ *
62
+ * Retrieve the list of categories the icon list widget belongs to.
63
+ *
64
+ * Used to determine where to display the widget in the editor.
65
+ *
66
+ * @since 1.0.0
67
+ * @access public
68
+ *
69
+ * @return array Widget categories.
70
+ */
71
+ public function get_categories() {
72
+ return [ 'sydney-elements' ];
73
+ }
74
+
75
+ /**
76
+ * Register icon list widget controls.
77
+ *
78
+ * Adds different input fields to allow the user to change and customize the widget settings.
79
+ *
80
+ * @since 1.0.0
81
+ * @access protected
82
+ */
83
+ protected function _register_controls() {
84
+ $this->start_controls_section(
85
+ 'section_testimonials',
86
+ [
87
+ 'label' => __( 'Portfolio', 'elementor' ),
88
+ ]
89
+ );
90
+
91
+ if ( \Sydney_Toolbox::is_pro() ) {
92
+ $this->add_control(
93
+ 'style',
94
+ [
95
+ 'label' => __( 'Style', 'elementor' ),
96
+ 'type' => Controls_Manager::SELECT,
97
+ 'options' => [
98
+ 'style1' => __( 'Style 1', 'elementor' ),
99
+ 'style2' => __( 'Style 2', 'elementor' ),
100
+ ],
101
+ 'default' => 'style2',
102
+ ]
103
+ );
104
+ }
105
+
106
+ $this->add_control(
107
+ 'portfolio_list',
108
+ [
109
+ 'label' => __( 'Projects list', 'elementor' ),
110
+ 'type' => Controls_Manager::REPEATER,
111
+ 'default' => [
112
+ [
113
+ 'name' => __( 'John Doe', 'elementor' ),
114
+ 'position' => __( 'Manager', 'elementor' ),
115
+ 'testimonial' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id purus neque. Curabitur pulvinar elementum neque in dictum. Sed non lectus nec tortor iaculis tincidunt.', 'elementor' ),
116
+ ],
117
+ [
118
+ 'name' => __( 'James Stevens', 'elementor' ),
119
+ 'position' => __( 'Manager', 'elementor' ),
120
+ 'testimonial' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id purus neque. Curabitur pulvinar elementum neque in dictum. Sed non lectus nec tortor iaculis tincidunt.', 'elementor' ),
121
+ ],
122
+ ],
123
+ 'fields' => [
124
+ [
125
+ 'name' => 'image',
126
+ 'label' => __( 'Image', 'elementor' ),
127
+ 'type' => Controls_Manager::MEDIA,
128
+ 'label_block' => true,
129
+ ],
130
+ [
131
+ 'name' => 'title',
132
+ 'label' => __( 'Title', 'elementor' ),
133
+ 'type' => Controls_Manager::TEXT,
134
+ 'label_block' => true,
135
+ 'placeholder' => __( 'Title', 'elementor' ),
136
+ 'default' => __( 'Project title', 'elementor' ),
137
+ ],
138
+ [
139
+ 'name' => 'term',
140
+ 'label' => __( 'Filter term', 'elementor' ),
141
+ 'type' => Controls_Manager::TEXT,
142
+ 'label_block' => true,
143
+ 'placeholder' => __( 'Term for the filter', 'elementor' ),
144
+ 'default' => __( 'Art', 'elementor' ),
145
+ ],
146
+ [
147
+ 'name' => 'link',
148
+ 'label' => __( 'Link', 'elementor' ),
149
+ 'type' => Controls_Manager::URL,
150
+ 'label_block' => true,
151
+ 'placeholder' => __( 'Link for this project', 'elementor' ),
152
+ 'default' => '',
153
+ ],
154
+
155
+ ],
156
+ ]
157
+ );
158
+
159
+
160
+ $this->add_control(
161
+ 'view',
162
+ [
163
+ 'label' => __( 'View', 'elementor' ),
164
+ 'type' => Controls_Manager::HIDDEN,
165
+ 'default' => 'traditional',
166
+ ]
167
+ );
168
+
169
+ $this->end_controls_section();
170
+
171
+ //General styles
172
+ $this->start_controls_section(
173
+ 'section_general_style',
174
+ [
175
+ 'label' => __( 'General', 'elementor' ),
176
+ 'tab' => Controls_Manager::TAB_STYLE,
177
+ ]
178
+ );
179
+ $this->add_control(
180
+ 'general_color',
181
+ [
182
+ 'label' => __( 'Main color', 'elementor' ),
183
+ 'type' => Controls_Manager::COLOR,
184
+ 'default' => '#e64e4e',
185
+ 'selectors' => [
186
+ '{{WRAPPER}} .portfolio-section.style2 .project-filter li a.active,{{WRAPPER}} .portfolio-section.style2 .project-filter li a:hover' => 'color: {{VALUE}};',
187
+ '{{WRAPPER}} .roll-project .project-item .project-pop, {{WRAPPER}} .portfolio-section.style1 .project-filter li a.active, {{WRAPPER}} .portfolio-section.style1 .project-filter li a:hover' => 'background-color: {{VALUE}};',
188
+ ],
189
+ ]
190
+ );
191
+
192
+ $this->end_controls_section();
193
+ //End general styles
194
+
195
+ //Project title styles
196
+ $this->start_controls_section(
197
+ 'section_project_title_style',
198
+ [
199
+ 'label' => __( 'Project title', 'elementor' ),
200
+ 'tab' => Controls_Manager::TAB_STYLE,
201
+ ]
202
+ );
203
+ $this->add_control(
204
+ 'project_title_color',
205
+ [
206
+ 'label' => __( 'Color', 'elementor' ),
207
+ 'type' => Controls_Manager::COLOR,
208
+ 'selectors' => [
209
+ '{{WRAPPER}} .roll-project .project-title span' => 'color: {{VALUE}};',
210
+ ],
211
+ ]
212
+ );
213
+
214
+ $this->add_group_control(
215
+ Group_Control_Typography::get_type(),
216
+ [
217
+ 'name' => 'project_title_typography',
218
+ 'selector' => '{{WRAPPER}} .roll-project .project-title',
219
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
220
+ ]
221
+ );
222
+
223
+ $this->end_controls_section();
224
+ //End project title styles
225
+
226
+
227
+ //Filter styles
228
+ $this->start_controls_section(
229
+ 'section_filter_style',
230
+ [
231
+ 'label' => __( 'Filter', 'elementor' ),
232
+ 'tab' => Controls_Manager::TAB_STYLE,
233
+ ]
234
+ );
235
+
236
+ $this->add_group_control(
237
+ Group_Control_Typography::get_type(),
238
+ [
239
+ 'name' => 'filter_typography',
240
+ 'selector' => '{{WRAPPER}} .project-filter li a',
241
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
242
+ ]
243
+ );
244
+
245
+ $this->end_controls_section();
246
+ //End filter styles
247
+ }
248
+
249
+ /**
250
+ * Render icon list widget output on the frontend.
251
+ *
252
+ * Written in PHP and used to generate the final HTML.
253
+ *
254
+ * @since 1.0.0
255
+ * @access protected
256
+ */
257
+ protected function render() {
258
+ $settings = $this->get_settings();
259
+
260
+
261
+ if ( \Sydney_Toolbox::is_pro() ) {
262
+ $style = $settings['style'];
263
+ } else {
264
+ $style = 'style1';
265
+ }
266
+
267
+ ?>
268
+
269
+ <div class="project-wrap portfolio-section <?php echo esc_attr( $style ); ?>">
270
+
271
+ <ul class="project-filter" id="filters">
272
+ <li><a href="#" data-filter="*">Show all</a></li>
273
+
274
+ <?php $array = array(); ?>
275
+
276
+ <?php foreach ( $settings['portfolio_list'] as $index => $item ) : ?>
277
+ <?php
278
+ if ( !in_array( $item['term'], $array ) )
279
+ {
280
+ $array[] = $item['term'];
281
+ }
282
+ ?>
283
+ <?php endforeach; ?>
284
+
285
+ <?php foreach ( $array as $value ) : ?>
286
+
287
+ <li><a href='#' data-filter='.<?php echo esc_attr( $this->prepare_term( $value, '' ) ); ?>'><?php echo esc_html( $value ); ?></a></li>
288
+
289
+ <?php endforeach; ?>
290
+
291
+ </ul>
292
+
293
+ <div class="roll-project fullwidth">
294
+ <div class="isotope-container" data-portfolio-effect="fadeInUp">
295
+
296
+ <?php $c = 0; ?>
297
+ <?php foreach ( $settings['portfolio_list'] as $index => $item ) : ?>
298
+
299
+ <div class="project-item item isotope-item <?php echo esc_attr( $this->prepare_term( $item['term'] ) ); ?>">
300
+ <div class="project-inner">
301
+
302
+ <?php
303
+ if ( ! empty( $item['link']['url'] ) ) {
304
+ $this->add_render_attribute( 'button-' . $c, 'href', $item['link']['url'] );
305
+ $this->add_render_attribute( 'button-' . $c, 'class', 'project-pop-wrap' );
306
+
307
+ if ( $item['link']['is_external'] ) {
308
+ $this->add_render_attribute( 'button-' . $c, 'target', '_blank' );
309
+ }
310
+
311
+ if ( $item['link']['nofollow'] ) {
312
+ $this->add_render_attribute( 'button-' . $c, 'rel', 'nofollow' );
313
+ }
314
+ }
315
+ ?>
316
+
317
+ <a <?php echo $this->get_render_attribute_string( 'button-' . $c ); ?>>
318
+ <div class="project-pop"></div>
319
+ <div class="project-title-wrap">
320
+ <h3 class="project-title">
321
+ <span><?php echo esc_html( $item['title'] ); ?></span>
322
+ </h3>
323
+ </div>
324
+ </a>
325
+ <a href="#">
326
+ <img src="<?php echo esc_url( $item['image']['url'] ); ?>"/>
327
+ </a>
328
+ </div>
329
+ </div>
330
+
331
+ <?php $c++; ?>
332
+ <?php endforeach; ?>
333
+
334
+ </div>
335
+ </div>
336
+ </div>
337
+
338
+ <?php
339
+ }
340
+
341
+ /**
342
+ * Prepare filter terms to be inserted as classes
343
+ *
344
+ */
345
+ protected function prepare_term( $term ) {
346
+ $prepared = str_replace( ' ', '-', $term);
347
+ $prepared = strtolower( $prepared );
348
+
349
+ return $prepared;
350
+ }
351
+
352
+ /**
353
+ * Render icon list widget output in the editor.
354
+ *
355
+ * Written as a Backbone JavaScript template and used to generate the live preview.
356
+ *
357
+ * @since 1.0.0
358
+ * @access protected
359
+ */
360
+ protected function _content_template() {
361
+ }
362
+ }
363
+ Plugin::instance()->widgets_manager->register_widget_type( new aThemes_Portfolio() );
inc/elementor/block-posts.php ADDED
@@ -0,0 +1,549 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ /**
9
+ * Elementor icon list widget.
10
+ *
11
+ * Elementor widget that displays a bullet list with any chosen icons and texts.
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class aThemes_Posts extends Widget_Base {
16
+
17
+ /**
18
+ * Get widget name.
19
+ *
20
+ * Retrieve icon list widget name.
21
+ *
22
+ * @since 1.0.0
23
+ * @access public
24
+ *
25
+ * @return string Widget name.
26
+ */
27
+ public function get_name() {
28
+ return 'athemes-posts';
29
+ }
30
+
31
+ /**
32
+ * Get widget title.
33
+ *
34
+ * Retrieve icon list widget title.
35
+ *
36
+ * @since 1.0.0
37
+ * @access public
38
+ *
39
+ * @return string Widget title.
40
+ */
41
+ public function get_title() {
42
+ return __( 'aThemes: Posts', 'elementor' );
43
+ }
44
+
45
+ /**
46
+ * Get widget icon.
47
+ *
48
+ * Retrieve icon list widget icon.
49
+ *
50
+ * @since 1.0.0
51
+ * @access public
52
+ *
53
+ * @return string Widget icon.
54
+ */
55
+ public function get_icon() {
56
+ return 'eicon-posts-carousel';
57
+ }
58
+
59
+ /**
60
+ * Get widget categories.
61
+ *
62
+ * Retrieve the list of categories the icon list widget belongs to.
63
+ *
64
+ * Used to determine where to display the widget in the editor.
65
+ *
66
+ * @since 1.0.0
67
+ * @access public
68
+ *
69
+ * @return array Widget categories.
70
+ */
71
+ public function get_categories() {
72
+ return [ 'sydney-elements' ];
73
+ }
74
+
75
+ /**
76
+ * Register icon list widget controls.
77
+ *
78
+ * Adds different input fields to allow the user to change and customize the widget settings.
79
+ *
80
+ * @since 1.0.0
81
+ * @access protected
82
+ */
83
+ protected function _register_controls() {
84
+ $this->start_controls_section(
85
+ 'section_blog',
86
+ [
87
+ 'label' => __( 'Blog', 'elementor' ),
88
+ ]
89
+ );
90
+
91
+ if ( \Sydney_Toolbox::is_pro() ) {
92
+ $this->add_control(
93
+ 'style',
94
+ [
95
+ 'label' => __( 'Style', 'elementor' ),
96
+ 'type' => Controls_Manager::SELECT,
97
+ 'options' => [
98
+ 'style1' => __( 'Style 1', 'elementor' ),
99
+ 'style2' => __( 'Style 2', 'elementor' ),
100
+ ],
101
+ 'default' => 'style2',
102
+ ]
103
+ );
104
+ }
105
+
106
+ $this->add_control(
107
+ 'number',
108
+ [
109
+ 'label' => __( 'Number of posts', 'elementor' ),
110
+ 'type' => Controls_Manager::NUMBER,
111
+ 'default' => 4,
112
+ ]
113
+ );
114
+
115
+ $this->add_control(
116
+ 'category',
117
+ [
118
+ 'label' => __( 'Categories', 'elementor' ),
119
+ 'type' => Controls_Manager::SELECT,
120
+ 'options' => $this->get_cats(),
121
+ 'multiple' => true,
122
+ 'default' => 4,
123
+ ]
124
+ );
125
+
126
+ $this->add_control(
127
+ 'see_all_text',
128
+ [
129
+ 'label' => __( 'See all button text', 'elementor' ),
130
+ 'type' => Controls_Manager::TEXT,
131
+ 'default' => __( 'See all our news', 'elementor' ),
132
+ ]
133
+ );
134
+
135
+
136
+ $this->add_control(
137
+ 'view',
138
+ [
139
+ 'label' => __( 'View', 'elementor' ),
140
+ 'type' => Controls_Manager::HIDDEN,
141
+ 'default' => 'traditional',
142
+ ]
143
+ );
144
+
145
+ $this->end_controls_section();
146
+
147
+
148
+ //Post titles styles
149
+ $this->start_controls_section(
150
+ 'section_post_title_style',
151
+ [
152
+ 'label' => __( 'Post title', 'elementor' ),
153
+ 'tab' => Controls_Manager::TAB_STYLE,
154
+ ]
155
+ );
156
+ $this->add_control(
157
+ 'name_color',
158
+ [
159
+ 'label' => __( 'Color', 'elementor' ),
160
+ 'type' => Controls_Manager::COLOR,
161
+ 'selectors' => [
162
+ '{{WRAPPER}} .latest-news-wrapper.carousel h4 a' => 'color: {{VALUE}};',
163
+ '{{WRAPPER}} .latest-news-wrapper.carousel.style2 .blog-post:hover h4 a' => 'color: #fff;',
164
+ ],
165
+ ]
166
+ );
167
+
168
+ $this->add_group_control(
169
+ Group_Control_Typography::get_type(),
170
+ [
171
+ 'name' => 'post_title_typography',
172
+ 'selector' => '{{WRAPPER}} .latest-news-wrapper.carousel h4',
173
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
174
+ ]
175
+ );
176
+
177
+ $this->end_controls_section();
178
+ //End post titles styles
179
+
180
+ //Post meta styles
181
+ $this->start_controls_section(
182
+ 'section_post_meta_style',
183
+ [
184
+ 'label' => __( 'Post meta', 'elementor' ),
185
+ 'tab' => Controls_Manager::TAB_STYLE,
186
+ ]
187
+ );
188
+ $this->add_control(
189
+ 'post_meta_color',
190
+ [
191
+ 'label' => __( 'Meta text', 'elementor' ),
192
+ 'type' => Controls_Manager::COLOR,
193
+ 'selectors' => [
194
+ '{{WRAPPER}} .latest-news-wrapper.carousel.style2 .meta-post' => 'color: {{VALUE}};',
195
+ '{{WRAPPER}} .latest-news-wrapper.carousel.style2 .blog-post:hover .meta-post' => 'color: #fff;',
196
+ ],
197
+ ]
198
+ );
199
+
200
+ $this->add_control(
201
+ 'post_meta_links_color',
202
+ [
203
+ 'label' => __( 'Meta links', 'elementor' ),
204
+ 'type' => Controls_Manager::COLOR,
205
+ 'selectors' => [
206
+ '{{WRAPPER}} .latest-news-wrapper.carousel.style2 .meta-post a' => 'color: {{VALUE}};',
207
+ '{{WRAPPER}} .latest-news-wrapper.carousel.style2 .blog-post:hover .meta-post a' => 'color: {{VALUE}};',
208
+ '{{WRAPPER}} .latest-news-wrapper.carousel.style2 .meta-post a:hover' => 'color: #fff;',
209
+ ],
210
+ ]
211
+ );
212
+
213
+ $this->add_group_control(
214
+ Group_Control_Typography::get_type(),
215
+ [
216
+ 'name' => 'post_meta_typography',
217
+ 'selector' => '{{WRAPPER}} .latest-news-wrapper.carousel .meta-post',
218
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
219
+ ]
220
+ );
221
+
222
+ $this->end_controls_section();
223
+ //End post meta styles
224
+
225
+ //Content styles
226
+ $this->start_controls_section(
227
+ 'section_content_style',
228
+ [
229
+ 'label' => __( 'Post content', 'elementor' ),
230
+ 'tab' => Controls_Manager::TAB_STYLE,
231
+ ]
232
+ );
233
+ $this->add_control(
234
+ 'content_color',
235
+ [
236
+ 'label' => __( 'Color', 'elementor' ),
237
+ 'type' => Controls_Manager::COLOR,
238
+ 'selectors' => [
239
+ '{{WRAPPER}} .latest-news-wrapper.carousel .blog-post .entry-summary' => 'color: {{VALUE}};',
240
+ '{{WRAPPER}} .latest-news-wrapper.carousel.style2 .blog-post:hover .entry-summary' => 'color: #fff;',
241
+ ],
242
+ ]
243
+ );
244
+
245
+ $this->add_group_control(
246
+ Group_Control_Typography::get_type(),
247
+ [
248
+ 'name' => 'content_typography',
249
+ 'selector' => '{{WRAPPER}} .latest-news-wrapper.carousel .blog-post .entry-summary',
250
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
251
+ ]
252
+ );
253
+
254
+ $this->end_controls_section();
255
+ //End content styles
256
+
257
+ //Content styles
258
+ $this->start_controls_section(
259
+ 'section_carousel_style',
260
+ [
261
+ 'label' => __( 'Carousel dots', 'elementor' ),
262
+ 'tab' => Controls_Manager::TAB_STYLE,
263
+ ]
264
+ );
265
+ $this->add_control(
266
+ 'dots_color',
267
+ [
268
+ 'label' => __( 'Color', 'elementor' ),
269
+ 'type' => Controls_Manager::COLOR,
270
+ 'selectors' => [
271
+ '{{WRAPPER}} .owl-theme .owl-controls .owl-page.active span,{{WRAPPER}} .owl-theme .owl-controls.clickable .owl-page:hover span' => 'background-color: {{VALUE}};',
272
+ '{{WRAPPER}} .owl-theme .owl-controls .owl-page:hover span, .owl-theme .owl-controls .owl-page.active span' => 'border-color: {{VALUE}};',
273
+ ],
274
+ ]
275
+ );
276
+
277
+ $this->end_controls_section();
278
+ //End content styles
279
+
280
+ //Button styles
281
+ $this->start_controls_section(
282
+ 'section_button_style',
283
+ [
284
+ 'label' => __( 'Button', 'elementor' ),
285
+ 'tab' => Controls_Manager::TAB_STYLE,
286
+ ]
287
+ );
288
+
289
+ $this->add_group_control(
290
+ Group_Control_Typography::get_type(),
291
+ [
292
+ 'name' => 'typography',
293
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
294
+ 'selector' => '{{WRAPPER}} a.roll-button, {{WRAPPER}} .roll-button',
295
+ ]
296
+ );
297
+
298
+ $this->start_controls_tabs( 'tabs_button_style' );
299
+
300
+ $this->start_controls_tab(
301
+ 'tab_button_normal',
302
+ [
303
+ 'label' => __( 'Normal', 'elementor' ),
304
+ ]
305
+ );
306
+
307
+ $this->add_control(
308
+ 'button_text_color',
309
+ [
310
+ 'label' => __( 'Text Color', 'elementor' ),
311
+ 'type' => Controls_Manager::COLOR,
312
+ 'default' => '#fff',
313
+ 'selectors' => [
314
+ '{{WRAPPER}} a.roll-button, {{WRAPPER}} .roll-button' => 'color: {{VALUE}};',
315
+ ],
316
+ ]
317
+ );
318
+
319
+ $this->add_control(
320
+ 'background_color',
321
+ [
322
+ 'label' => __( 'Background Color', 'elementor' ),
323
+ 'type' => Controls_Manager::COLOR,
324
+ 'default' => '#e64e4e',
325
+ 'selectors' => [
326
+ '{{WRAPPER}} a.roll-button, {{WRAPPER}} .roll-button' => 'background-color: {{VALUE}};',
327
+ ],
328
+ ]
329
+ );
330
+
331
+ $this->end_controls_tab();
332
+
333
+ $this->start_controls_tab(
334
+ 'tab_button_hover',
335
+ [
336
+ 'label' => __( 'Hover', 'elementor' ),
337
+ ]
338
+ );
339
+
340
+ $this->add_control(
341
+ 'hover_color',
342
+ [
343
+ 'label' => __( 'Text Color', 'elementor' ),
344
+ 'type' => Controls_Manager::COLOR,
345
+ 'default' => '#47425d',
346
+ 'selectors' => [
347
+ '{{WRAPPER}} a.roll-button:hover, {{WRAPPER}} .roll-button:hover' => 'color: {{VALUE}};',
348
+ ],
349
+ ]
350
+ );
351
+
352
+ $this->add_control(
353
+ 'button_background_hover_color',
354
+ [
355
+ 'label' => __( 'Background Color', 'elementor' ),
356
+ 'type' => Controls_Manager::COLOR,
357
+ 'default' => 'transparent',
358
+ 'selectors' => [
359
+ '{{WRAPPER}} a.roll-button:hover, {{WRAPPER}} .roll-button:hover' => 'background-color: {{VALUE}};',
360
+ ],
361
+ ]
362
+ );
363
+
364
+ $this->add_control(
365
+ 'button_hover_border_color',
366
+ [
367
+ 'label' => __( 'Border Color', 'elementor' ),
368
+ 'type' => Controls_Manager::COLOR,
369
+ 'condition' => [
370
+ 'border_border!' => '',
371
+ ],
372
+ 'selectors' => [
373
+ '{{WRAPPER}} a.roll-button:hover, {{WRAPPER}} .roll-button:hover' => 'border-color: {{VALUE}};',
374
+ ],
375
+ ]
376
+ );
377
+
378
+ $this->add_control(
379
+ 'hover_animation',
380
+ [
381
+ 'label' => __( 'Hover Animation', 'elementor' ),
382
+ 'type' => Controls_Manager::HOVER_ANIMATION,
383
+ ]
384
+ );
385
+
386
+ $this->end_controls_tab();
387
+
388
+ $this->end_controls_tabs();
389
+
390
+ $this->add_group_control(
391
+ Group_Control_Border::get_type(),
392
+ [
393
+ 'name' => 'border',
394
+ 'placeholder' => '1px',
395
+ 'default' => '1px',
396
+ 'selector' => '{{WRAPPER}} .roll-button',
397
+ 'separator' => 'before',
398
+ ]
399
+ );
400
+
401
+ $this->add_control(
402
+ 'border_radius',
403
+ [
404
+ 'label' => __( 'Border Radius', 'elementor' ),
405
+ 'type' => Controls_Manager::DIMENSIONS,
406
+ 'size_units' => [ 'px', '%' ],
407
+ 'default' => [ 'top' => 3,
408
+ 'right' => 3,
409
+ 'bottom' => 3,
410
+ 'left' => 3,
411
+ 'unit' => 'px',
412
+ 'isLinked' => false,
413
+ ],
414
+ 'selectors' => [
415
+ '{{WRAPPER}} a.roll-button, {{WRAPPER}} .roll-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
416
+ ],
417
+ ]
418
+ );
419
+
420
+ $this->add_group_control(
421
+ Group_Control_Box_Shadow::get_type(),
422
+ [
423
+ 'name' => 'button_box_shadow',
424
+ 'selector' => '{{WRAPPER}} .roll-button',
425
+ ]
426
+ );
427
+
428
+ $this->add_control(
429
+ 'text_padding',
430
+ [
431
+ 'label' => __( 'Padding', 'elementor' ),
432
+ 'type' => Controls_Manager::DIMENSIONS,
433
+ 'size_units' => [ 'px', 'em', '%' ],
434
+ 'default' => [ 'top' => 16,
435
+ 'right' => 35,
436
+ 'bottom' => 16,
437
+ 'left' => 35,
438
+ 'unit' => 'px',
439
+ 'isLinked' => false,
440
+ ],
441
+ 'selectors' => [
442
+ '{{WRAPPER}} a.roll-button, {{WRAPPER}} .roll-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
443
+ ],
444
+ 'separator' => 'before',
445
+ ]
446
+ );
447
+
448
+ $this->end_controls_section();
449
+ //End button styles
450
+
451
+
452
+ }
453
+
454
+ protected function get_cats() {
455
+ $items = [ '' => '' ];
456
+ $terms = get_terms('category');
457
+ foreach ( $terms as $term ) {
458
+ $items[ $term->term_id ] = $term->name;
459
+ }
460
+ return $items;
461
+ }
462
+
463
+ /**
464
+ * Render icon list widget output on the frontend.
465
+ *
466
+ * Written in PHP and used to generate the final HTML.
467
+ *
468
+ * @since 1.0.0
469
+ * @access protected
470
+ */
471
+ protected function render() {
472
+ $settings = $this->get_settings();
473
+
474
+ if ( \Sydney_Toolbox::is_pro() ) {
475
+ $style = $settings['style'];
476
+ } else {
477
+ $style = 'style1';
478
+ }
479
+
480
+ $r = new \WP_Query( array(
481
+ 'no_found_rows' => true,
482
+ 'post_status' => 'publish',
483
+ 'cat' => $settings['category'],
484
+ 'posts_per_page' => $settings['number']
485
+ ) );
486
+
487
+ if ( $r->have_posts() ) :
488
+ ?>
489
+
490
+ <div class="panel-grid-cell"><?php //Keep the same selectors as SO version ?>
491
+ <div class="latest-news-wrapper carousel owl-carousel row <?php echo esc_attr( $style ); ?>">
492
+ <?php while ( $r->have_posts() ) : $r->the_post(); ?>
493
+ <div class="blog-post col-md-12">
494
+ <?php if ( has_post_thumbnail() && $style == 'style1' ) : ?>
495
+ <div class="entry-thumb">
496
+ <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
497
+ <?php the_post_thumbnail('medium-thumb'); ?>
498
+ </a>
499
+ </div>
500
+ <?php else : ?>
501
+ <?php global $post; ?>
502
+ <?php $image_id = get_post_thumbnail_id( $post->ID ); ?>
503
+ <?php $image_src = wp_get_attachment_image_src( $image_id, 'medium-thumb' ); ?>
504
+ <div class="post-background" style="background-image: url( <?php echo esc_url($image_src[0]); ?> )"></div>
505
+ <?php endif; ?>
506
+ <?php the_title( sprintf( '<h4 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h4>' ); ?>
507
+ <div class="entry-summary">
508
+ <?php
509
+ if ( $style == 'style1' ) {
510
+ the_excerpt();
511
+ } else {
512
+ echo '<div class="meta-post">';
513
+ sydney_post_date();
514
+ sydney_get_first_cat();
515
+ echo '</div>';
516
+ echo esc_html( wp_trim_words( get_the_content(), 12 ) );
517
+ }
518
+ ?></div>
519
+ </div>
520
+ <?php endwhile; ?>
521
+ </div>
522
+ </div>
523
+
524
+ <?php $cat = get_term_by('id', $settings['category'], 'category') ?>
525
+ <?php if ( $settings['category'] ) : //Link to the category page instead of blog page if a category is selected ?>
526
+ <a href="<?php echo esc_url(get_category_link(get_cat_ID($cat -> name))); ?>" class="roll-button more-button"><?php echo esc_html( $settings['see_all_text'] ); ?></a>
527
+ <?php elseif ( get_option( 'page_for_posts' ) ) : ?>
528
+ <a href="<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>" class="roll-button more-button"><?php echo esc_html( $settings['see_all_text'] ); ?></a>
529
+ <?php endif; ?>
530
+ <?php
531
+ wp_reset_postdata();
532
+ endif; //end have_posts() check
533
+ ?>
534
+
535
+ <?php
536
+ }
537
+
538
+ /**
539
+ * Render icon list widget output in the editor.
540
+ *
541
+ * Written as a Backbone JavaScript template and used to generate the live preview.
542
+ *
543
+ * @since 1.0.0
544
+ * @access protected
545
+ */
546
+ protected function _content_template() {
547
+ }
548
+ }
549
+ Plugin::instance()->widgets_manager->register_widget_type( new aThemes_Posts() );
inc/elementor/block-pricing.php ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ /**
9
+ * Elementor icon list widget.
10
+ *
11
+ * Elementor widget that displays a bullet list with any chosen icons and texts.
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class aThemes_Pricing_Table extends Widget_Base {
16
+
17
+ /**
18
+ * Get widget name.
19
+ *
20
+ * Retrieve icon list widget name.
21
+ *
22
+ * @since 1.0.0
23
+ * @access public
24
+ *
25
+ * @return string Widget name.
26
+ */
27
+ public function get_name() {
28
+ return 'athemes-pricing-table';
29
+ }
30
+
31
+ /**
32
+ * Get widget title.
33
+ *
34
+ * Retrieve icon list widget title.
35
+ *
36
+ * @since 1.0.0
37
+ * @access public
38
+ *
39
+ * @return string Widget title.
40
+ */
41
+ public function get_title() {
42
+ return __( 'aThemes: Pricing table', 'elementor' );
43
+ }
44
+
45
+ /**
46
+ * Get widget icon.
47
+ *
48
+ * Retrieve icon list widget icon.
49
+ *
50
+ * @since 1.0.0
51
+ * @access public
52
+ *
53
+ * @return string Widget icon.
54
+ */
55
+ public function get_icon() {
56
+ return 'eicon-price-table';
57
+ }
58
+
59
+ /**
60
+ * Get widget categories.
61
+ *
62
+ * Retrieve the list of categories the icon list widget belongs to.
63
+ *
64
+ * Used to determine where to display the widget in the editor.
65
+ *
66
+ * @since 1.0.0
67
+ * @access public
68
+ *
69
+ * @return array Widget categories.
70
+ */
71
+ public function get_categories() {
72
+ return [ 'sydney-elements' ];
73
+ }
74
+
75
+ /**
76
+ * Register icon list widget controls.
77
+ *
78
+ * Adds different input fields to allow the user to change and customize the widget settings.
79
+ *
80
+ * @since 1.0.0
81
+ * @access protected
82
+ */
83
+ protected function _register_controls() {
84
+ $this->start_controls_section(
85
+ 'section_icon',
86
+ [
87
+ 'label' => __( 'Icon List', 'elementor' ),
88
+ ]
89
+ );
90
+
91
+ $this->add_control(
92
+ 'currency',
93
+ [
94
+ 'label' => __( 'Currency', 'elementor' ),
95
+ 'type' => Controls_Manager::TEXT,
96
+ 'default' => '$',
97
+ 'placeholder' => '$',
98
+ ]
99
+ );
100
+
101
+ $this->add_control(
102
+ 'price',
103
+ [
104
+ 'label' => __( 'Price', 'elementor' ),
105
+ 'type' => Controls_Manager::TEXT,
106
+ 'default' => '35',
107
+ 'placeholder' => __( 'Price', 'elementor' ),
108
+ ]
109
+ );
110
+
111
+
112
+ $this->add_control(
113
+ 'period',
114
+ [
115
+ 'label' => __( 'Period', 'elementor' ),
116
+ 'type' => Controls_Manager::TEXT,
117
+ 'default' => __( 'month', 'elementor' ),
118
+ 'placeholder' => __( 'Period', 'elementor' ),
119
+ ]
120
+ );
121
+
122
+ $this->add_control(
123
+ 'name',
124
+ [
125
+ 'label' => __( 'Name', 'elementor' ),
126
+ 'type' => Controls_Manager::TEXT,
127
+ 'default' => __( 'Agency', 'elementor' ),
128
+ 'placeholder' => __( 'Plan name', 'elementor' ),
129
+ ]
130
+ );
131
+
132
+ $this->add_control(
133
+ 'features_list',
134
+ [
135
+ 'label' => __( 'Features list', 'elementor' ),
136
+ 'type' => Controls_Manager::REPEATER,
137
+ 'default' => [
138
+ [
139
+ 'text' => __( 'Just a feature', 'elementor' ),
140
+ ],
141
+ [
142
+ 'text' => __( 'Just a feature', 'elementor' ),
143
+ ],
144
+ [
145
+ 'text' => __( 'Just a feature', 'elementor' ),
146
+ ],
147
+ ],
148
+ 'fields' => [
149
+ [
150
+ 'name' => 'text',
151
+ 'label' => __( 'Feature name', 'elementor' ),
152
+ 'type' => Controls_Manager::TEXT,
153
+ 'label_block' => true,
154
+ 'placeholder' => __( 'Just a feature', 'elementor' ),
155
+ 'default' => __( 'Just a feature', 'elementor' ),
156
+ ],
157
+ ],
158
+ ]
159
+ );
160
+
161
+ $this->add_control(
162
+ 'button_url',
163
+ [
164
+ 'label' => __( 'Button URL', 'elementor' ),
165
+ 'type' => Controls_Manager::URL,
166
+ 'default' => [
167
+ 'url' => '#',
168
+ ],
169
+ 'placeholder' => __( 'http://example.org', 'elementor' ),
170
+ ]
171
+ );
172
+
173
+ $this->add_control(
174
+ 'button_text',
175
+ [
176
+ 'label' => __( 'Button text', 'elementor' ),
177
+ 'type' => Controls_Manager::TEXT,
178
+ 'default' => __( 'Click me', 'elementor' ),
179
+ 'placeholder' => __( 'Button text', 'elementor' ),
180
+ ]
181
+ );
182
+
183
+ $this->add_control(
184
+ 'view',
185
+ [
186
+ 'label' => __( 'View', 'elementor' ),
187
+ 'type' => Controls_Manager::HIDDEN,
188
+ 'default' => 'traditional',
189
+ ]
190
+ );
191
+
192
+ $this->end_controls_section();
193
+
194
+
195
+ //Currency styles
196
+ $this->start_controls_section(
197
+ 'section_currency_style',
198
+ [
199
+ 'label' => __( 'Currency', 'elementor' ),
200
+ 'tab' => Controls_Manager::TAB_STYLE,
201
+ ]
202
+ );
203
+ $this->add_control(
204
+ 'currency_color',
205
+ [
206
+ 'label' => __( 'Color', 'elementor' ),
207
+ 'type' => Controls_Manager::COLOR,
208
+ 'selectors' => [
209
+ '{{WRAPPER}} .pricing-section.style4 .plan-price span:first-of-type' => 'color: {{VALUE}};',
210
+ ],
211
+ ]
212
+ );
213
+ $this->add_responsive_control(
214
+ 'currency_size',
215
+ [
216
+ 'label' => __( 'Size', 'elementor' ),
217
+ 'type' => Controls_Manager::SLIDER,
218
+ 'range' => [
219
+ 'px' => [
220
+ 'min' => 6,
221
+ 'max' => 50,
222
+ ],
223
+ ],
224
+ 'selectors' => [
225
+ '{{WRAPPER}} .pricing-section.style4 .plan-price span:first-of-type' => 'font-size: {{SIZE}}{{UNIT}};',
226
+ ],
227
+ ]
228
+ );
229
+ $this->end_controls_section();
230
+ //End currency styles
231
+ //Price styles
232
+ $this->start_controls_section(
233
+ 'section_price_style',
234
+ [
235
+ 'label' => __( 'Price', 'elementor' ),
236
+ 'tab' => Controls_Manager::TAB_STYLE,
237
+ ]
238
+ );
239
+ $this->add_control(
240
+ 'price_color',
241
+ [
242
+ 'label' => __( 'Color', 'elementor' ),
243
+ 'type' => Controls_Manager::COLOR,
244
+ 'selectors' => [
245
+ '{{WRAPPER}} .pricing-section.style4 .plan-price' => 'color: {{VALUE}};',
246
+ ],
247
+ ]
248
+ );
249
+ $this->add_responsive_control(
250
+ 'price_size',
251
+ [
252
+ 'label' => __( 'Size', 'elementor' ),
253
+ 'type' => Controls_Manager::SLIDER,
254
+ 'range' => [
255
+ 'px' => [
256
+ 'min' => 6,
257
+ 'max' => 80,
258
+ ],
259
+ ],
260
+ 'selectors' => [
261
+ '{{WRAPPER}} .pricing-section.style4 .plan-price' => 'font-size: {{SIZE}}{{UNIT}};',
262
+ ],
263
+ ]
264
+ );
265
+ $this->end_controls_section();
266
+ //End price styles
267
+ //Period styles
268
+ $this->start_controls_section(
269
+ 'section_period_style',
270
+ [
271
+ 'label' => __( 'Period', 'elementor' ),
272
+ 'tab' => Controls_Manager::TAB_STYLE,
273
+ ]
274
+ );
275
+ $this->add_control(
276
+ 'period_color',
277
+ [
278
+ 'label' => __( 'Color', 'elementor' ),
279
+ 'type' => Controls_Manager::COLOR,
280
+ 'selectors' => [
281
+ '{{WRAPPER}} .pricing-section.style4 .plan-price span' => 'color: {{VALUE}};',
282
+ ],
283
+ ]
284
+ );
285
+ $this->add_responsive_control(
286
+ 'period_size',
287
+ [
288
+ 'label' => __( 'Size', 'elementor' ),
289
+ 'type' => Controls_Manager::SLIDER,
290
+ 'range' => [
291
+ 'px' => [
292
+ 'min' => 6,
293
+ 'max' => 50,
294
+ ],
295
+ ],
296
+ 'selectors' => [
297
+ '{{WRAPPER}} .pricing-section.style4 .plan-price span' => 'font-size: {{SIZE}}{{UNIT}};',
298
+ ],
299
+ ]
300
+ );
301
+ $this->end_controls_section();
302
+ //End period styles
303
+ //Header styles
304
+ $this->start_controls_section(
305
+ 'section_header_style',
306
+ [
307
+ 'label' => __( 'Table header', 'elementor' ),
308
+ 'tab' => Controls_Manager::TAB_STYLE,
309
+ ]
310
+ );
311
+ $this->add_control(
312
+ 'header_background_color',
313
+ [
314
+ 'label' => __( 'Background Color', 'elementor' ),
315
+ 'type' => Controls_Manager::COLOR,
316
+ 'selectors' => [
317
+ '{{WRAPPER}} .pricing-section.style4 .plan-header' => 'background-color: {{VALUE}};',
318
+ ],
319
+ ]
320
+ );
321
+
322
+ $this->add_responsive_control(
323
+ 'header_padding',
324
+ [
325
+ 'label' => __( 'Padding top/bottom', 'elementor' ),
326
+ 'type' => Controls_Manager::SLIDER,
327
+ 'selectors' => [
328
+ '{{WRAPPER}} .pricing-section.style4 .plan-header' => 'padding: {{SIZE}}{{UNIT}} 0;',
329
+ ],
330
+ 'default' => [
331
+ 'unit' => 'em',
332
+ ],
333
+ 'tablet_default' => [
334
+ 'unit' => 'em',
335
+ ],
336
+ 'mobile_default' => [
337
+ 'unit' => 'em',
338
+ ],
339
+ 'range' => [
340
+ 'em' => [
341
+ 'min' => 0,
342
+ 'max' => 90,
343
+ ],
344
+ ],
345
+ ]
346
+ );
347
+ $this->end_controls_section();
348
+ //End header styles
349
+
350
+ //Button styles
351
+ $this->start_controls_section(
352
+ 'section_button_style',
353
+ [
354
+ 'label' => __( 'Button', 'elementor' ),
355
+ 'tab' => Controls_Manager::TAB_STYLE,
356
+ ]
357
+ );
358
+
359
+ $this->add_group_control(
360
+ Group_Control_Typography::get_type(),
361
+ [
362
+ 'name' => 'typography',
363
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
364
+ 'selector' => '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button',
365
+ ]
366
+ );
367
+
368
+ $this->start_controls_tabs( 'tabs_button_style' );
369
+
370
+ $this->start_controls_tab(
371
+ 'tab_button_normal',
372
+ [
373
+ 'label' => __( 'Normal', 'elementor' ),
374
+ ]
375
+ );
376
+
377
+ $this->add_control(
378
+ 'button_text_color',
379
+ [
380
+ 'label' => __( 'Text Color', 'elementor' ),
381
+ 'type' => Controls_Manager::COLOR,
382
+ 'default' => '#fff',
383
+ 'selectors' => [
384
+ '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'color: {{VALUE}};',
385
+ ],
386
+ ]
387
+ );
388
+
389
+ $this->add_control(
390
+ 'background_color',
391
+ [
392
+ 'label' => __( 'Background Color', 'elementor' ),
393
+ 'type' => Controls_Manager::COLOR,
394
+ 'default' => '#47425d',
395
+ 'selectors' => [
396
+ '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'background-color: {{VALUE}};',
397
+ ],
398
+ ]
399
+ );
400
+
401
+ $this->end_controls_tab();
402
+
403
+ $this->start_controls_tab(
404
+ 'tab_button_hover',
405
+ [
406
+ 'label' => __( 'Hover', 'elementor' ),
407
+ ]
408
+ );
409
+
410
+ $this->add_control(
411
+ 'hover_color',
412
+ [
413
+ 'label' => __( 'Text Color', 'elementor' ),
414
+ 'type' => Controls_Manager::COLOR,
415
+ 'default' => '#47425d',
416
+ 'selectors' => [
417
+ '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover' => 'color: {{VALUE}};',
418
+ ],
419
+ ]
420
+ );
421
+
422
+ $this->add_control(
423
+ 'button_background_hover_color',
424
+ [
425
+ 'label' => __( 'Background Color', 'elementor' ),
426
+ 'type' => Controls_Manager::COLOR,
427
+ 'default' => 'transparent',
428
+ 'selectors' => [
429
+ '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover' => 'background-color: {{VALUE}};',
430
+ ],
431
+ ]
432
+ );
433
+
434
+ $this->add_control(
435
+ 'button_hover_border_color',
436
+ [
437
+ 'label' => __( 'Border Color', 'elementor' ),
438
+ 'type' => Controls_Manager::COLOR,
439
+ 'condition' => [
440
+ 'border_border!' => '',
441
+ ],
442
+ 'selectors' => [
443
+ '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover' => 'border-color: {{VALUE}};',
444
+ ],
445
+ ]
446
+ );
447
+
448
+ $this->add_control(
449
+ 'hover_animation',
450
+ [
451
+ 'label' => __( 'Hover Animation', 'elementor' ),
452
+ 'type' => Controls_Manager::HOVER_ANIMATION,
453
+ ]
454
+ );
455
+
456
+ $this->end_controls_tab();
457
+
458
+ $this->end_controls_tabs();
459
+
460
+ $this->add_group_control(
461
+ Group_Control_Border::get_type(),
462
+ [
463
+ 'name' => 'border',
464
+ 'placeholder' => '1px',
465
+ 'default' => '1px',
466
+ 'selector' => '{{WRAPPER}} .elementor-button',
467
+ 'separator' => 'before',
468
+ ]
469
+ );
470
+
471
+ $this->add_control(
472
+ 'border_radius',
473
+ [
474
+ 'label' => __( 'Border Radius', 'elementor' ),
475
+ 'type' => Controls_Manager::DIMENSIONS,
476
+ 'size_units' => [ 'px', '%' ],
477
+ 'default' => [ 'top' => 3,
478
+ 'right' => 3,
479
+ 'bottom' => 3,
480
+ 'left' => 3,
481
+ 'unit' => 'px',
482
+ 'isLinked' => false,
483
+ ],
484
+ 'selectors' => [
485
+ '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
486
+ ],
487
+ ]
488
+ );
489
+
490
+ $this->add_group_control(
491
+ Group_Control_Box_Shadow::get_type(),
492
+ [
493
+ 'name' => 'button_box_shadow',
494
+ 'selector' => '{{WRAPPER}} .elementor-button',
495
+ ]
496
+ );
497
+
498
+ $this->add_control(
499
+ 'text_padding',
500
+ [
501
+ 'label' => __( 'Padding', 'elementor' ),
502
+ 'type' => Controls_Manager::DIMENSIONS,
503
+ 'size_units' => [ 'px', 'em', '%' ],
504
+ 'default' => [ 'top' => 16,
505
+ 'right' => 35,
506
+ 'bottom' => 16,
507
+ 'left' => 35,
508
+ 'unit' => 'px',
509
+ 'isLinked' => false,
510
+ ],
511
+ 'selectors' => [
512
+ '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
513
+ ],
514
+ 'separator' => 'before',
515
+ ]
516
+ );
517
+
518
+ $this->end_controls_section();
519
+ //End button styles
520
+
521
+ }
522
+
523
+ /**
524
+ * Render icon list widget output on the frontend.
525
+ *
526
+ * Written in PHP and used to generate the final HTML.
527
+ *
528
+ * @since 1.0.0
529
+ * @access protected
530
+ */
531
+ protected function render() {
532
+ $settings = $this->get_settings();
533
+
534
+ ?>
535
+
536
+ <div class="pricing-section style4">
537
+ <div class="plan-item-inner">
538
+ <div class="plan-header">
539
+ <h4><?php echo $settings['name']; ?></h4>
540
+ <div class="plan-price">
541
+ <span><?php echo $settings['currency']; ?></span><?php echo $settings['price']; ?><span>/<?php echo $settings['period']; ?></span>
542
+ </div>
543
+ </div>
544
+
545
+ <div class="plan-text">
546
+ <?php foreach ( $settings['features_list'] as $index => $item ) :
547
+ ?>
548
+ <div class="plan-feature" >
549
+ <?php echo $item['text']; ?>
550
+ </div>
551
+ <?php
552
+ endforeach;
553
+ ?>
554
+ </div>
555
+
556
+ <?php
557
+ if ( ! empty( $settings['button_url']['url'] ) ) {
558
+ $this->add_render_attribute( 'button', 'href', $settings['button_url']['url'] );
559
+ $this->add_render_attribute( 'button', 'class', 'elementor-button' );
560
+
561
+ if ( $settings['button_url']['is_external'] ) {
562
+ $this->add_render_attribute( 'button', 'target', '_blank' );
563
+ }
564
+
565
+ if ( $settings['button_url']['nofollow'] ) {
566
+ $this->add_render_attribute( 'button', 'rel', 'nofollow' );
567
+ }
568
+ }
569
+ ?>
570
+ <div class="plan-btn">
571
+ <a <?php echo $this->get_render_attribute_string( 'button' ); ?>>
572
+ <?php echo $settings['button_text']; ?>
573
+ </a>
574
+ </div>
575
+ </div>
576
+ </div>
577
+ <?php
578
+ }
579
+
580
+ /**
581
+ * Render icon list widget output in the editor.
582
+ *
583
+ * Written as a Backbone JavaScript template and used to generate the live preview.
584
+ *
585
+ * @since 1.0.0
586
+ * @access protected
587
+ */
588
+ protected function _content_template() {
589
+ }
590
+ }
591
+ Plugin::instance()->widgets_manager->register_widget_type( new aThemes_Pricing_Table() );
inc/elementor/block-testimonials.php ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ /**
9
+ * Elementor icon list widget.
10
+ *
11
+ * Elementor widget that displays a bullet list with any chosen icons and texts.
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class aThemes_Testimonials extends Widget_Base {
16
+
17
+ /**
18
+ * Get widget name.
19
+ *
20
+ * Retrieve icon list widget name.
21
+ *
22
+ * @since 1.0.0
23
+ * @access public
24
+ *
25
+ * @return string Widget name.
26
+ */
27
+ public function get_name() {
28
+ return 'athemes-testimonials';
29
+ }
30
+
31
+ /**
32
+ * Get widget title.
33
+ *
34
+ * Retrieve icon list widget title.
35
+ *
36
+ * @since 1.0.0
37
+ * @access public
38
+ *
39
+ * @return string Widget title.
40
+ */
41
+ public function get_title() {
42
+ return __( 'aThemes: Testimonials', 'elementor' );
43
+ }
44
+
45
+ /**
46
+ * Get widget icon.
47
+ *
48
+ * Retrieve icon list widget icon.
49
+ *
50
+ * @since 1.0.0
51
+ * @access public
52
+ *
53
+ * @return string Widget icon.
54
+ */
55
+ public function get_icon() {
56
+ return 'eicon-testimonial';
57
+ }
58
+
59
+ /**
60
+ * Get widget categories.
61
+ *
62
+ * Retrieve the list of categories the icon list widget belongs to.
63
+ *
64
+ * Used to determine where to display the widget in the editor.
65
+ *
66
+ * @since 1.0.0
67
+ * @access public
68
+ *
69
+ * @return array Widget categories.
70
+ */
71
+ public function get_categories() {
72
+ return [ 'sydney-elements' ];
73
+ }
74
+
75
+ /**
76
+ * Register icon list widget controls.
77
+ *
78
+ * Adds different input fields to allow the user to change and customize the widget settings.
79
+ *
80
+ * @since 1.0.0
81
+ * @access protected
82
+ */
83
+ protected function _register_controls() {
84
+ $this->start_controls_section(
85
+ 'section_testimonials',
86
+ [
87
+ 'label' => __( 'Testimonials', 'elementor' ),
88
+ ]
89
+ );
90
+
91
+ $this->add_control(
92
+ 'testimonials_list',
93
+ [
94
+ 'label' => __( 'Features list', 'elementor' ),
95
+ 'type' => Controls_Manager::REPEATER,
96
+ 'default' => [
97
+ [
98
+ 'name' => __( 'John Doe', 'elementor' ),
99
+ 'position' => __( 'Manager', 'elementor' ),
100
+ 'testimonial' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id purus neque. Curabitur pulvinar elementum neque in dictum. Sed non lectus nec tortor iaculis tincidunt.', 'elementor' ),
101
+ ],
102
+ [
103
+ 'name' => __( 'James Stevens', 'elementor' ),
104
+ 'position' => __( 'Manager', 'elementor' ),
105
+ 'testimonial' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id purus neque. Curabitur pulvinar elementum neque in dictum. Sed non lectus nec tortor iaculis tincidunt.', 'elementor' ),
106
+ ],
107
+ ],
108
+ 'fields' => [
109
+ [
110
+ 'name' => 'image',
111
+ 'label' => __( 'Client photo', 'elementor' ),
112
+ 'type' => Controls_Manager::MEDIA,
113
+ 'label_block' => true,
114
+ 'placeholder' => __( 'Client name', 'elementor' ),
115
+ ],
116
+ [
117
+ 'name' => 'name',
118
+ 'label' => __( 'Client name', 'elementor' ),
119
+ 'type' => Controls_Manager::TEXT,
120
+ 'label_block' => true,
121
+ 'placeholder' => __( 'Client name', 'elementor' ),
122
+ 'default' => __( 'John Doe', 'elementor' ),
123
+ ],
124
+ [
125
+ 'name' => 'position',
126
+ 'label' => __( 'Client position', 'elementor' ),
127
+ 'type' => Controls_Manager::TEXT,
128
+ 'label_block' => true,
129
+ 'placeholder' => __( 'Client position', 'elementor' ),
130
+ 'default' => __( 'Manager', 'elementor' ),
131
+ ],
132
+ [
133
+ 'name' => 'testimonial',
134
+ 'label' => __( 'Testimonial', 'elementor' ),
135
+ 'type' => Controls_Manager::WYSIWYG,
136
+ 'label_block' => true,
137
+ 'placeholder' => __( 'Testimonial', 'elementor' ),
138
+ 'default' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id purus neque. Curabitur pulvinar elementum neque in dictum. Sed non lectus nec tortor iaculis tincidunt.', 'elementor' ),
139
+ ],
140
+
141
+ ],
142
+ ]
143
+ );
144
+
145
+
146
+ $this->add_control(
147
+ 'view',
148
+ [
149
+ 'label' => __( 'View', 'elementor' ),
150
+ 'type' => Controls_Manager::HIDDEN,
151
+ 'default' => 'traditional',
152
+ ]
153
+ );
154
+
155
+ $this->end_controls_section();
156
+
157
+ //General styles
158
+ $this->start_controls_section(
159
+ 'section_general_style',
160
+ [
161
+ 'label' => __( 'General', 'elementor' ),
162
+ 'tab' => Controls_Manager::TAB_STYLE,
163
+ ]
164
+ );
165
+ $this->add_control(
166
+ 'general_color',
167
+ [
168
+ 'label' => __( 'Color', 'elementor' ),
169
+ 'type' => Controls_Manager::COLOR,
170
+ 'default' => '#e64e4e',
171
+ 'selectors' => [
172
+ '{{WRAPPER}} .widget_sydney_testimonials .fa-quote-left' => 'color: {{VALUE}};',
173
+ '{{WRAPPER}} .owl-theme .owl-controls .owl-page.active span,{{WRAPPER}} .owl-theme .owl-controls.clickable .owl-page:hover span' => 'background-color: {{VALUE}};',
174
+ '{{WRAPPER}} .owl-theme .owl-controls .owl-page:hover span,{{WRAPPER}} .owl-theme .owl-controls .owl-page.active span' => 'border-color: {{VALUE}};',
175
+ ],
176
+ ]
177
+ );
178
+
179
+ $this->end_controls_section();
180
+ //End name styles
181
+
182
+ //Name styles
183
+ $this->start_controls_section(
184
+ 'section_name_style',
185
+ [
186
+ 'label' => __( 'Name', 'elementor' ),
187
+ 'tab' => Controls_Manager::TAB_STYLE,
188
+ ]
189
+ );
190
+ $this->add_control(
191
+ 'name_color',
192
+ [
193
+ 'label' => __( 'Color', 'elementor' ),
194
+ 'type' => Controls_Manager::COLOR,
195
+ 'selectors' => [
196
+ '{{WRAPPER}} .roll-testimonials .testimonial-name' => 'color: {{VALUE}};',
197
+ ],
198
+ ]
199
+ );
200
+
201
+ $this->add_group_control(
202
+ Group_Control_Typography::get_type(),
203
+ [
204
+ 'name' => 'name_typography',
205
+ 'selector' => '{{WRAPPER}} .roll-testimonials .testimonial-name',
206
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
207
+ ]
208
+ );
209
+
210
+ $this->end_controls_section();
211
+ //End name styles
212
+
213
+ //Position styles
214
+ $this->start_controls_section(
215
+ 'section_position_style',
216
+ [
217
+ 'label' => __( 'Position', 'elementor' ),
218
+ 'tab' => Controls_Manager::TAB_STYLE,
219
+ ]
220
+ );
221
+ $this->add_control(
222
+ 'position_color',
223
+ [
224
+ 'label' => __( 'Color', 'elementor' ),
225
+ 'type' => Controls_Manager::COLOR,
226
+ 'selectors' => [
227
+ '{{WRAPPER}} .roll-testimonials .testimonial-position' => 'color: {{VALUE}};',
228
+ ],
229
+ ]
230
+ );
231
+
232
+ $this->add_group_control(
233
+ Group_Control_Typography::get_type(),
234
+ [
235
+ 'name' => 'position_typography',
236
+ 'selector' => '{{WRAPPER}} .roll-testimonials .testimonial-position',
237
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
238
+ ]
239
+ );
240
+
241
+ $this->end_controls_section();
242
+ //End position styles
243
+
244
+ //Position styles
245
+ $this->start_controls_section(
246
+ 'section_testimonial_style',
247
+ [
248
+ 'label' => __( 'Testimonial', 'elementor' ),
249
+ 'tab' => Controls_Manager::TAB_STYLE,
250
+ ]
251
+ );
252
+ $this->add_control(
253
+ 'testimonial_color',
254
+ [
255
+ 'label' => __( 'Color', 'elementor' ),
256
+ 'type' => Controls_Manager::COLOR,
257
+ 'selectors' => [
258
+ '{{WRAPPER}} .roll-testimonials .whisper' => 'color: {{VALUE}};',
259
+ ],
260
+ ]
261
+ );
262
+
263
+ $this->add_group_control(
264
+ Group_Control_Typography::get_type(),
265
+ [
266
+ 'name' => 'testimonial_typography',
267
+ 'selector' => '{{WRAPPER}} .roll-testimonials .whisper',
268
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
269
+ ]
270
+ );
271
+
272
+ $this->end_controls_section();
273
+ //End position styles
274
+
275
+ }
276
+
277
+ /**
278
+ * Render icon list widget output on the frontend.
279
+ *
280
+ * Written in PHP and used to generate the final HTML.
281
+ *
282
+ * @since 1.0.0
283
+ * @access protected
284
+ */
285
+ protected function render() {
286
+ $settings = $this->get_settings();
287
+
288
+ ?>
289
+
290
+ <div class="widget_sydney_testimonials">
291
+ <i class="fa fa-quote-left"></i>
292
+ <div class="roll-testimonials" data-autoplay="5000">
293
+ <?php foreach ( $settings['testimonials_list'] as $index => $item ) : ?>
294
+ <div class="customer">
295
+ <blockquote class="whisper"><?php echo wp_kses_post( $item['testimonial'] ); ?></blockquote>
296
+ <?php if ( $item['image']['url'] ) : ?>
297
+ <div class="avatar">
298
+ <img src="<?php echo esc_url( $item['image']['url'] ); ?>"/>
299
+ </div>
300
+ <?php endif; ?>
301
+ <div class="name">
302
+ <div class="testimonial-name"><?php echo esc_html( $item['name'] ); ?></div>
303
+ <span class="testimonial-position"><?php echo esc_html( $item['position'] ); ?></span>
304
+ </div>
305
+ </div>
306
+ <?php endforeach; ?>
307
+ </div>
308
+ </div>
309
+
310
+ <?php
311
+ }
312
+
313
+ /**
314
+ * Render icon list widget output in the editor.
315
+ *
316
+ * Written as a Backbone JavaScript template and used to generate the live preview.
317
+ *
318
+ * @since 1.0.0
319
+ * @access protected
320
+ */
321
+ protected function _content_template() {
322
+ }
323
+ }
324
+ Plugin::instance()->widgets_manager->register_widget_type( new aThemes_Testimonials() );
inc/elementor/block-timeline.php ADDED
@@ -0,0 +1,364 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ /**
9
+ * Elementor icon list widget.
10
+ *
11
+ * Elementor widget that displays a bullet list with any chosen icons and texts.
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class aThemes_Timeline extends Widget_Base {
16
+
17
+ /**
18
+ * Get widget name.
19
+ *
20
+ * Retrieve icon list widget name.
21
+ *
22
+ * @since 1.0.0
23
+ * @access public
24
+ *
25
+ * @return string Widget name.
26
+ */
27
+ public function get_name() {
28
+ return 'athemes-timeline';
29
+ }
30
+
31
+ /**
32
+ * Get widget title.
33
+ *
34
+ * Retrieve icon list widget title.
35
+ *
36
+ * @since 1.0.0
37
+ * @access public
38
+ *
39
+ * @return string Widget title.
40
+ */
41
+ public function get_title() {
42
+ return __( 'aThemes: Timeline', 'elementor' );
43
+ }
44
+
45
+ /**
46
+ * Get widget icon.
47
+ *
48
+ * Retrieve icon list widget icon.
49
+ *
50
+ * @since 1.0.0
51
+ * @access public
52
+ *
53
+ * @return string Widget icon.
54
+ */
55
+ public function get_icon() {
56
+ return 'eicon-date';
57
+ }
58
+
59
+ /**
60
+ * Get widget categories.
61
+ *
62
+ * Retrieve the list of categories the icon list widget belongs to.
63
+ *
64
+ * Used to determine where to display the widget in the editor.
65
+ *
66
+ * @since 1.0.0
67
+ * @access public
68
+ *
69
+ * @return array Widget categories.
70
+ */
71
+ public function get_categories() {
72
+ return [ 'sydney-elements' ];
73
+ }
74
+
75
+ /**
76
+ * Register icon list widget controls.
77
+ *
78
+ * Adds different input fields to allow the user to change and customize the widget settings.
79
+ *
80
+ * @since 1.0.0
81
+ * @access protected
82
+ */
83
+ protected function _register_controls() {
84
+ $this->start_controls_section(
85
+ 'section_timeline',
86
+ [
87
+ 'label' => __( 'Timeline', 'elementor' ),
88
+ ]
89
+ );
90
+
91
+ $this->add_control(
92
+ 'style',
93
+ [
94
+ 'label' => __( 'Style', 'elementor' ),
95
+ 'type' => Controls_Manager::SELECT,
96
+ 'options' => [
97
+ 'style1' => __( 'Style 1', 'elementor' ),
98
+ 'style2' => __( 'Style 2', 'elementor' ),
99
+ ],
100
+ 'default' => 'style2',
101
+ ]
102
+ );
103
+
104
+ $this->add_control(
105
+ 'timeline_list',
106
+ [
107
+ 'label' => __( 'Features list', 'elementor' ),
108
+ 'type' => Controls_Manager::REPEATER,
109
+ 'default' => [
110
+ [
111
+ 'name' => __( 'Our company was founded', 'elementor' ),
112
+ 'icon' => 'fa fa-star',
113
+ 'date' => '2013-12-11',
114
+ 'text' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id purus neque. Curabitur pulvinar elementum neque in dictum. Sed non lectus nec tortor iaculis tincidunt.', 'elementor' ),
115
+ ],
116
+ [
117
+ 'name' => __( 'First contract', 'elementor' ),
118
+ 'icon' => 'fa fa-android',
119
+ 'date' => '2014-02-11',
120
+ 'text' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id purus neque. Curabitur pulvinar elementum neque in dictum. Sed non lectus nec tortor iaculis tincidunt.', 'elementor' ),
121
+ ],
122
+ ],
123
+ 'fields' => [
124
+ [
125
+ 'name' => 'name',
126
+ 'label' => __( 'Item name', 'elementor' ),
127
+ 'type' => Controls_Manager::TEXT,
128
+ 'label_block' => true,
129
+ 'placeholder' => __( 'Item name', 'elementor' ),
130
+ 'default' => __( 'Our company was founded', 'elementor' ),
131
+ ],
132
+ [
133
+ 'name' => 'icon',
134
+ 'label' => __( 'Icon', 'elementor' ),
135
+ 'type' => Controls_Manager::ICON,
136
+ 'description' => __( 'Available for Style 1', 'elementor' ),
137
+ 'label_block' => true,
138
+ 'placeholder' => '',
139
+ 'default' => 'fa fa-star',
140
+ ],
141
+ [
142
+ 'name' => 'icon_color',
143
+ 'label' => __( 'Icon color', 'elementor' ),
144
+ 'type' => Controls_Manager::COLOR,
145
+ 'description' => __( 'Available for Style 1', 'elementor' ),
146
+ 'label_block' => true,
147
+ 'placeholder' => '',
148
+ ],
149
+ [
150
+ 'name' => 'date',
151
+ 'label' => __( 'Date', 'elementor' ),
152
+ 'type' => Controls_Manager::TEXT,
153
+ 'label_block' => true,
154
+ 'placeholder' => __( 'Event date', 'elementor' ),
155
+ 'default' => '',
156
+ ],
157
+ [
158
+ 'name' => 'text',
159
+ 'label' => __( 'Event description', 'elementor' ),
160
+ 'type' => Controls_Manager::WYSIWYG,
161
+ 'label_block' => true,
162
+ 'placeholder' => __( 'Description', 'elementor' ),
163
+ 'default' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id purus neque. Curabitur pulvinar elementum neque in dictum. Sed non lectus nec tortor iaculis tincidunt.', 'elementor' ),
164
+ ],
165
+ ],
166
+ ]
167
+ );
168
+
169
+
170
+ $this->add_control(
171
+ 'view',
172
+ [
173
+ 'label' => __( 'View', 'elementor' ),
174
+ 'type' => Controls_Manager::HIDDEN,
175
+ 'default' => 'traditional',
176
+ ]
177
+ );
178
+
179
+ $this->end_controls_section();
180
+
181
+ //Event title styles
182
+ $this->start_controls_section(
183
+ 'section_event_title_style',
184
+ [
185
+ 'label' => __( 'Event title', 'elementor' ),
186
+ 'tab' => Controls_Manager::TAB_STYLE,
187
+ ]
188
+ );
189
+ $this->add_control(
190
+ 'event_title_color',
191
+ [
192
+ 'label' => __( 'Color', 'elementor' ),
193
+ 'type' => Controls_Manager::COLOR,
194
+ 'default' => '',
195
+ 'selectors' => [
196
+ '{{WRAPPER}} .timeline-section .timeline-inner h3' => 'color: {{VALUE}};',
197
+ ],
198
+ ]
199
+ );
200
+ $this->add_group_control(
201
+ Group_Control_Typography::get_type(),
202
+ [
203
+ 'name' => 'event_title_typography',
204
+ 'selector' => '{{WRAPPER}} .timeline-section .timeline-inner h3',
205
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
206
+ ]
207
+ );
208
+
209
+ $this->end_controls_section();
210
+ //End event title styles
211
+
212
+ //Event date styles
213
+ $this->start_controls_section(
214
+ 'section_event_date_style',
215
+ [
216
+ 'label' => __( 'Event date', 'elementor' ),
217
+ 'tab' => Controls_Manager::TAB_STYLE,
218
+ ]
219
+ );
220
+ $this->add_control(
221
+ 'event_date_color',
222
+ [
223
+ 'label' => __( 'Color', 'elementor' ),
224
+ 'type' => Controls_Manager::COLOR,
225
+ 'default' => '',
226
+ 'selectors' => [
227
+ '{{WRAPPER}} .timeline-date' => 'color: {{VALUE}};',
228
+ ],
229
+ ]
230
+ );
231
+ $this->add_group_control(
232
+ Group_Control_Typography::get_type(),
233
+ [
234
+ 'name' => 'event_date_typography',
235
+ 'selector' => '{{WRAPPER}} .timeline-date',
236
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
237
+ ]
238
+ );
239
+
240
+ $this->end_controls_section();
241
+ //End event date styles
242
+
243
+
244
+ //Event text styles
245
+ $this->start_controls_section(
246
+ 'section_event_text_style',
247
+ [
248
+ 'label' => __( 'Event description', 'elementor' ),
249
+ 'tab' => Controls_Manager::TAB_STYLE,
250
+ ]
251
+ );
252
+ $this->add_control(
253
+ 'event_text_color',
254
+ [
255
+ 'label' => __( 'Color', 'elementor' ),
256
+ 'type' => Controls_Manager::COLOR,
257
+ 'default' => '',
258
+ 'selectors' => [
259
+ '{{WRAPPER}} .content p' => 'color: {{VALUE}};',
260
+ ],
261
+ ]
262
+ );
263
+ $this->add_group_control(
264
+ Group_Control_Typography::get_type(),
265
+ [
266
+ 'name' => 'event_text_typography',
267
+ 'selector' => '{{WRAPPER}} .content p',
268
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
269
+ ]
270
+ );
271
+
272
+ $this->end_controls_section();
273
+ //End event text styles
274
+
275
+ }
276
+
277
+ /**
278
+ * Render icon list widget output on the frontend.
279
+ *
280
+ * Written in PHP and used to generate the final HTML.
281
+ *
282
+ * @since 1.0.0
283
+ * @access protected
284
+ */
285
+ protected function render() {
286
+ $settings = $this->get_settings();
287
+ $style = $settings['style'];
288
+ ?>
289
+
290
+ <div class="timeline-section <?php echo esc_attr( $style ); ?>">
291
+ <?php foreach ( $settings['timeline_list'] as $index => $item ) : ?>
292
+ <?php $date = $item['date']; ?>
293
+ <?php $icon = $item['icon']; ?>
294
+ <?php $title = $item['name']; ?>
295
+ <?php $text = $item['text']; ?>
296
+ <?php $icon_color = $item['icon_color']; ?>
297
+ <?php $link = ''; ?>
298
+ <?php if ( $index % 2 != 0 ) : ?>
299
+ <div class="timeline timeline-even clearfix">
300
+ <div class="timeline-inner clearfix">
301
+ <div class="content">
302
+ <?php if ( $style == 'style1' ) : ?>
303
+ <h3><?php echo esc_html( $title ); ?></h3>
304
+ <?php if ($date) : ?>
305
+ <span class="timeline-date"><?php echo $date; ?></span>
306
+ <?php endif; ?>
307
+ <?php else : ?>
308
+ <?php if ($date) : ?>
309
+ <span class="timeline-date"><?php echo $date; ?></span>
310
+ <?php endif; ?>
311
+ <h3><?php echo esc_html( $title ); ?></h3>
312
+ <?php endif; ?>
313
+ <?php echo wp_kses_post( $text ); ?>
314
+ </div><!--.info-->
315
+ <?php if ( $icon ) : ?>
316
+ <div class="icon" style="background-color: <?php echo esc_attr($icon_color); ?>;">
317
+ <?php echo '<i class="' . esc_html( $icon ) . '"></i>'; ?>
318
+ </div>
319
+ <?php endif; ?>
320
+ </div>
321
+ </div>
322
+ <?php else : ?>
323
+ <div class="timeline timeline-odd clearfix">
324
+ <div class="timeline-inner clearfix">
325
+ <?php if ( $icon ) : ?>
326
+ <div class="icon" style="background-color: <?php echo esc_attr( $icon_color ); ?>;">
327
+ <?php echo '<i class="' . esc_html($icon) . '"></i>'; ?>
328
+ </div>
329
+ <?php endif; ?>
330
+ <div class="content">
331
+ <?php if ( $style == 'style1' ) : ?>
332
+ <h3><?php echo esc_html( $title ); ?></h3>
333
+ <?php if ( $date ) : ?>
334
+ <span class="timeline-date"><?php echo $date; ?></span>
335
+ <?php endif; ?>
336
+ <?php else : ?>
337
+ <?php if ( $date ) : ?>
338
+ <span class="timeline-date"><?php echo $date; ?></span>
339
+ <?php endif; ?>
340
+ <h3><?php echo esc_html( $title ); ?></h3>
341
+ <?php endif; ?>
342
+ <?php echo wp_kses_post( $text ); ?>
343
+ </div><!--.info-->
344
+ </div>
345
+ </div>
346
+ <?php endif; ?>
347
+ <?php endforeach; ?>
348
+ </div>
349
+
350
+ <?php
351
+ }
352
+
353
+ /**
354
+ * Render icon list widget output in the editor.
355
+ *
356
+ * Written as a Backbone JavaScript template and used to generate the live preview.
357
+ *
358
+ * @since 1.0.0
359
+ * @access protected
360
+ */
361
+ protected function _content_template() {
362
+ }
363
+ }
364
+ Plugin::instance()->widgets_manager->register_widget_type( new aThemes_Timeline() );
js/main.js ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ (function ($) {
4
+
5
+ var aThemesTestimonialsCarouselrun = function ($scope, $) {
6
+
7
+ if ( $().owlCarousel ) {
8
+ $('.roll-testimonials').not('.owl-carousel').owlCarousel({
9
+ navigation : false,
10
+ pagination: true,
11
+ responsive: true,
12
+ items: 1,
13
+ itemsDesktop: [3000,1],
14
+ itemsDesktopSmall: [1400,1],
15
+ itemsTablet:[970,1],
16
+ itemsTabletSmall: [600,1],
17
+ itemsMobile: [360,1],
18
+ touchDrag: true,
19
+ mouseDrag: true,
20
+ autoHeight: true,
21
+ autoPlay: $('.roll-testimonials').data('autoplay')
22
+ });
23
+ }
24
+
25
+ };
26
+
27
+ var aThemesNewsCarouselrun = function ($scope, $) {
28
+
29
+ if ( $().owlCarousel ) {
30
+ $(".panel-grid-cell .latest-news-wrapper").owlCarousel({
31
+ navigation : false,
32
+ pagination: true,
33
+ responsive: true,
34
+ items: 3,
35
+ itemsDesktopSmall: [1400,3],
36
+ itemsTablet:[970,2],
37
+ itemsTabletSmall: [600,1],
38
+ itemsMobile: [360,1],
39
+ touchDrag: true,
40
+ mouseDrag: true,
41
+ autoHeight: false,
42
+ autoPlay: false
43
+ }); // end owlCarousel
44
+
45
+ } // end if
46
+
47
+ };
48
+
49
+ var aThemesIsotoperun = function ($scope, $) {
50
+ if ( $('.project-wrap').length ) {
51
+
52
+ $('.project-wrap').each(function() {
53
+
54
+ var self = $(this);
55
+ var filterNav = self.find('.project-filter').find('a');
56
+
57
+ var projectIsotope = function($selector){
58
+
59
+ $selector.isotope({
60
+ filter: '*',
61
+ itemSelector: '.project-item',
62
+ percentPosition: true,
63
+ animationOptions: {
64
+ duration: 750,
65
+ easing: 'liniar',
66
+ queue: false,
67
+ }
68
+ });
69
+
70
+ }
71
+
72
+ self.children().find('.isotope-container').imagesLoaded( function() {
73
+ projectIsotope(self.children().find('.isotope-container'));
74
+ });
75
+
76
+ $(window).load(function(){
77
+ projectIsotope(self.children().find('.isotope-container'));
78
+ });
79
+
80
+ filterNav.click(function(){
81
+ var selector = $(this).attr('data-filter');
82
+ filterNav.removeClass('active');
83
+ $(this).addClass('active');
84
+
85
+ self.find('.isotope-container').isotope({
86
+ filter: selector,
87
+ animationOptions: {
88
+ duration: 750,
89
+ easing: 'liniar',
90
+ queue: false,
91
+ }
92
+ });
93
+
94
+ return false;
95
+
96
+ });
97
+
98
+ });
99
+
100
+ }
101
+ };
102
+
103
+ var aThemesTeamSocial = function ($scope, $) {
104
+ //Moves social bar inside image for aThemes: Employee - style 2
105
+ $( '.roll-team.type-b.style2').find( '.team-item' ).each( function() {
106
+ var socials = $(this).find( '.team-social' );
107
+ socials.appendTo( $(this).find( '.team-inner') );
108
+ });
109
+ };
110
+
111
+
112
+ $(window).on('elementor/frontend/init', function () {
113
+ elementorFrontend.hooks.addAction('frontend/element_ready/athemes-testimonials.default', aThemesTestimonialsCarouselrun);
114
+ elementorFrontend.hooks.addAction('frontend/element_ready/athemes-posts.default', aThemesNewsCarouselrun);
115
+ elementorFrontend.hooks.addAction('frontend/element_ready/athemes-portfolio.default', aThemesIsotoperun);
116
+ elementorFrontend.hooks.addAction('frontend/element_ready/athemes-employee.default', aThemesTeamSocial);
117
+ });
118
+
119
+ })(jQuery);
sydney-toolbox.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: Sydney Toolbox
11
  * Plugin URI: http://athemes.com/plugins/sydney-toolbox
12
  * Description: Registers custom post types and custom fields for the Sydney theme
13
- * Version: 1.01
14
  * Author: aThemes
15
  * Author URI: http://athemes.com
16
  * License: GPL-2.0+
@@ -40,6 +40,12 @@ class Sydney_Toolbox {
40
  add_action( 'plugins_loaded', array( $this, 'i18n' ), 3 );
41
  add_action( 'plugins_loaded', array( $this, 'includes' ), 4 );
42
  add_action( 'admin_notices', array( $this, 'admin_notice' ), 4 );
 
 
 
 
 
 
43
  }
44
 
45
  /**
@@ -56,23 +62,50 @@ class Sydney_Toolbox {
56
  */
57
  function includes() {
58
 
59
- //Post types
60
- require_once( ST_DIR . 'inc/post-type-services.php' );
61
- require_once( ST_DIR . 'inc/post-type-employees.php' );
62
- require_once( ST_DIR . 'inc/post-type-testimonials.php' );
63
- require_once( ST_DIR . 'inc/post-type-clients.php' );
64
- require_once( ST_DIR . 'inc/post-type-projects.php' );
65
- require_once( ST_DIR . 'inc/post-type-timeline.php' );
66
- //Metaboxes
67
- require_once( ST_DIR . 'inc/metaboxes/services-metabox.php' );
68
- require_once( ST_DIR . 'inc/metaboxes/employees-metabox.php' );
69
- require_once( ST_DIR . 'inc/metaboxes/testimonials-metabox.php' );
70
- require_once( ST_DIR . 'inc/metaboxes/clients-metabox.php' );
71
- require_once( ST_DIR . 'inc/metaboxes/projects-metabox.php' );
72
- require_once( ST_DIR . 'inc/metaboxes/timeline-metabox.php' );
73
- require_once( ST_DIR . 'inc/metaboxes/singles-metabox.php' );
 
 
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  /**
77
  * Translations
78
  */
@@ -93,6 +126,27 @@ class Sydney_Toolbox {
93
  }
94
  }
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  /**
97
  * Returns the instance.
98
  */
@@ -106,7 +160,6 @@ class Sydney_Toolbox {
106
  }
107
 
108
  function sydney_toolbox_plugin() {
109
- if ( !function_exists('wpcf_init') ) //Make sure the Types plugin isn't active
110
  return Sydney_Toolbox::get_instance();
111
  }
112
  add_action('plugins_loaded', 'sydney_toolbox_plugin', 1);
10
  * Plugin Name: Sydney Toolbox
11
  * Plugin URI: http://athemes.com/plugins/sydney-toolbox
12
  * Description: Registers custom post types and custom fields for the Sydney theme
13
+ * Version: 1.03
14
  * Author: aThemes
15
  * Author URI: http://athemes.com
16
  * License: GPL-2.0+
40
  add_action( 'plugins_loaded', array( $this, 'i18n' ), 3 );
41
  add_action( 'plugins_loaded', array( $this, 'includes' ), 4 );
42
  add_action( 'admin_notices', array( $this, 'admin_notice' ), 4 );
43
+
44
+ //Elementor actions
45
+ add_action( 'elementor/widgets/widgets_registered', array( $this, 'elementor_includes' ), 4 );
46
+ add_action( 'elementor/init', array( $this, 'elementor_category' ), 4 );
47
+ add_action( 'elementor/frontend/after_register_scripts', array( $this, 'scripts' ), 4 );
48
+
49
  }
50
 
51
  /**
62
  */
63
  function includes() {
64
 
65
+ if ( defined( 'SITEORIGIN_PANELS_VERSION' ) ) {
66
+ //Post types
67
+ require_once( ST_DIR . 'inc/post-type-services.php' );
68
+ require_once( ST_DIR . 'inc/post-type-employees.php' );
69
+ require_once( ST_DIR . 'inc/post-type-testimonials.php' );
70
+ require_once( ST_DIR . 'inc/post-type-clients.php' );
71
+ require_once( ST_DIR . 'inc/post-type-projects.php' );
72
+ require_once( ST_DIR . 'inc/post-type-timeline.php' );
73
+ //Metaboxes
74
+ require_once( ST_DIR . 'inc/metaboxes/services-metabox.php' );
75
+ require_once( ST_DIR . 'inc/metaboxes/employees-metabox.php' );
76
+ require_once( ST_DIR . 'inc/metaboxes/testimonials-metabox.php' );
77
+ require_once( ST_DIR . 'inc/metaboxes/clients-metabox.php' );
78
+ require_once( ST_DIR . 'inc/metaboxes/projects-metabox.php' );
79
+ require_once( ST_DIR . 'inc/metaboxes/timeline-metabox.php' );
80
+ require_once( ST_DIR . 'inc/metaboxes/singles-metabox.php' );
81
+ }
82
  }
83
 
84
+ function elementor_includes() {
85
+ require_once( ST_DIR . 'inc/elementor/block-testimonials.php' );
86
+ require_once( ST_DIR . 'inc/elementor/block-posts.php' );
87
+ require_once( ST_DIR . 'inc/elementor/block-portfolio.php' );
88
+ require_once( ST_DIR . 'inc/elementor/block-employee-carousel.php' );
89
+
90
+ if ( $this->is_pro() ) {
91
+ require_once( ST_DIR . 'inc/elementor/block-employee.php' );
92
+ require_once( ST_DIR . 'inc/elementor/block-pricing.php' );
93
+ require_once( ST_DIR . 'inc/elementor/block-timeline.php' );
94
+ }
95
+ }
96
+
97
+ function elementor_category() {
98
+ \Elementor\Plugin::$instance->elements_manager->add_category(
99
+ 'sydney-elements',
100
+ [
101
+ 'title' => __( 'Sydney Elements', 'sydney-toolbox' ),
102
+ 'icon' => 'fa fa-plug', //default icon
103
+ ],
104
+ 2 // position
105
+ );
106
+ }
107
+
108
+
109
  /**
110
  * Translations
111
  */
126
  }
127
  }
128
 
129
+ /**
130
+ * Scripts
131
+ */
132
+ function scripts() {
133
+ wp_enqueue_script( 'st-carousel', ST_URI . 'js/main.js', array(), '20180228', true );
134
+
135
+ }
136
+
137
+ /**
138
+ * Get current theme
139
+ */
140
+ function is_pro() {
141
+ $theme = wp_get_theme();
142
+ $parent = wp_get_theme()->parent();
143
+ if ( ( $theme != 'Sydney Pro' ) && ( $parent != 'Sydney Pro') ) {
144
+ return false;
145
+ } else {
146
+ return true;
147
+ }
148
+ }
149
+
150
  /**
151
  * Returns the instance.
152
  */
160
  }
161
 
162
  function sydney_toolbox_plugin() {
 
163
  return Sydney_Toolbox::get_instance();
164
  }
165
  add_action('plugins_loaded', 'sydney_toolbox_plugin', 1);