PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 2.4.20
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v2.4.20
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / admin / views / configs / generator / class-sps-carousel.php

class-sps-carousel.php in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 2.4.20, at admin/views/configs/generator/class-sps-carousel.php

307 lines 10.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The Carousel section Meta-box configurations.
4 *
5 * @package Smart_Post_Show
6 * @subpackage Smart_Post_Show/admin
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 die;
11 } // Cannot access pages directly.
12
13 /**
14 * The Carousel building class.
15 */
16 class SPS_Carousel {
17
18 /**
19 * Carousel section metabox.
20 *
21 * @param string $prefix The metabox key.
22 * @return void
23 */
24 public static function section( $prefix ) {
25 SP_PC::createSection(
26 $prefix,
27 array(
28 'title' => __( 'Carousel Controls', 'post-carousel' ),
29 'icon' => 'fa fa-sliders',
30 'fields' => array(
31 array(
32 'id' => 'pcp_carousel_mode',
33 'type' => 'button_set',
34 'title' => __( 'Carousel Mode', 'post-carousel' ),
35 'subtitle' => __( 'Choose a mode for the carousel.', 'post-carousel' ),
36 'options' => array(
37 'standard' => __( 'Standard', 'post-carousel' ),
38 'center' => array(
39 'text' => __( 'Center', 'post-carousel' ),
40 'pro_only' => true,
41 ),
42 'ticker' => array(
43 'text' => __( 'Ticker', 'post-carousel' ),
44 'pro_only' => true,
45 ),
46 ),
47 'default' => 'standard',
48 ),
49 array(
50 'id' => 'pcp_carousel_speed',
51 'type' => 'spinner',
52 'title' => __( 'Carousel Speed', 'post-carousel' ),
53 'subtitle' => __( 'Set carousel speed in millisecond.', 'post-carousel' ),
54 'default' => '600',
55 'min' => 0,
56 'max' => 20000,
57 'step' => 100,
58 'unit' => 'ms',
59 ),
60 array(
61 'id' => 'pcp_autoplay',
62 'type' => 'switcher',
63 'title' => __( 'AutoPlay', 'post-carousel' ),
64 'subtitle' => __( 'Enable/Disable carousel autoplay.', 'post-carousel' ),
65 'default' => true,
66 'text_on' => __( 'Enabled', 'post-carousel' ),
67 'text_off' => __( 'Disabled', 'post-carousel' ),
68 'text_width' => 94,
69 ),
70 array(
71 'id' => 'pcp_autoplay_speed',
72 'type' => 'spinner',
73 'title' => __( 'AutoPlay Speed', 'post-carousel' ),
74 'subtitle' => __( 'Set autoplay speed in millisecond.', 'post-carousel' ),
75 'default' => '2000',
76 'min' => 0,
77 'max' => 10000,
78 'step' => 100,
79 'unit' => 'ms',
80 'dependency' => array( 'pcp_autoplay', '==', true ),
81 ),
82 array(
83 'id' => 'pcp_pause_hover',
84 'type' => 'switcher',
85 'title' => __( 'Pause on Hover', 'post-carousel' ),
86 'subtitle' => __( 'Enable/Disable carousel stop on hover.', 'post-carousel' ),
87 'default' => true,
88 'text_on' => __( 'Enabled', 'post-carousel' ),
89 'text_off' => __( 'Disabled', 'post-carousel' ),
90 'text_width' => 94,
91 'dependency' => array( 'pcp_autoplay', '==', true ),
92
93 ),
94 array(
95 'id' => 'pcp_infinite_loop',
96 'type' => 'switcher',
97 'title' => __( 'Infinite Loop', 'post-carousel' ),
98 'subtitle' => __( 'Enable/Disable carousel infinite loop.', 'post-carousel' ),
99 'text_on' => __( 'Enabled', 'post-carousel' ),
100 'text_off' => __( 'Disabled', 'post-carousel' ),
101 'text_width' => 94,
102 'default' => true,
103 ),
104 array(
105 'id' => 'pcp_lazy_load',
106 'type' => 'switcher',
107 'title' => __( 'Lazy Load', 'post-carousel' ),
108 'subtitle' => __( 'Enable/Disable lazy load.', 'post-carousel' ),
109 'text_on' => __( 'Enabled', 'post-carousel' ),
110 'text_off' => __( 'Disabled', 'post-carousel' ),
111 'text_width' => 94,
112 'default' => true,
113 ),
114 array(
115 'id' => 'pcp_carousel_direction',
116 'type' => 'button_set',
117 'title' => __( 'Carousel Direction', 'post-carousel' ),
118 'subtitle' => __( 'Choose a carousel direction.', 'post-carousel' ),
119 'options' => array(
120 'ltr' => __( 'Right to Left', 'post-carousel' ),
121 'rtl' => __( 'Left to Right', 'post-carousel' ),
122 ),
123 'default' => 'ltr',
124 ),
125 array(
126 'id' => 'pcp_slide_effect',
127 'type' => 'select',
128 'title' => __( 'Transition Effect', 'post-carousel' ),
129 'subtitle' => __( 'Select a slide transition effect.', 'post-carousel' ),
130 'help' => __( 'Fade, cube, and flip transition effects work only for the single column view.', 'post-carousel' ),
131 'options' => array(
132 'slide' => __( 'Slide', 'post-carousel' ),
133 'fade' => __( 'Fade (Pro)', 'post-carousel' ),
134 'coverflow' => __( 'Coverflow (Pro)', 'post-carousel' ),
135 'cube' => __( 'Cube (Pro)', 'post-carousel' ),
136 'flip' => __( 'Flip (Pro)', 'post-carousel' ),
137 ),
138 'default' => 'slide',
139 ),
140 array(
141 'id' => 'pcp_number_of_row',
142 'type' => 'column',
143 'class' => 'pcp_only_pro',
144 'title' => __( 'Row', 'post-carousel' ),
145 'subtitle' => __( 'Set number of row in different devices for responsive view.', 'post-carousel' ),
146 'default' => array(
147 'lg_desktop' => '1',
148 'desktop' => '1',
149 'tablet' => '1',
150 'mobile_landscape' => '1',
151 'mobile' => '1',
152 ),
153 'min' => '1',
154 ),
155 array(
156 'type' => 'subheading',
157 'content' => __( 'Navigation', 'post-carousel' ),
158 ),
159
160 // Navigation Settings.
161 array(
162 'id' => 'pcp_navigation',
163 'type' => 'button_set',
164 'title' => __( 'Navigation', 'post-carousel' ),
165 'subtitle' => __( 'Show/Hide carousel navigation.', 'post-carousel' ),
166 'options' => array(
167 'show' => __( 'Show', 'post-carousel' ),
168 'hide' => __( 'Hide', 'post-carousel' ),
169 'hide_on_mobile' => __( 'Hide on Mobile', 'post-carousel' ),
170 ),
171 'default' => 'show',
172 ),
173 array(
174 'id' => 'pcp_nav_colors',
175 'type' => 'color_group',
176 'title' => __( 'Navigation Color', 'post-carousel' ),
177 'subtitle' => __( 'Set color for the carousel navigation.', 'post-carousel' ),
178 'options' => array(
179 'color' => __( 'Color', 'post-carousel' ),
180 'hover-color' => __( 'Hover Color', 'post-carousel' ),
181 'bg' => __( 'Background', 'post-carousel' ),
182 'hover-bg' => __( 'Hover Background', 'post-carousel' ),
183 'border-color' => __( 'Border', 'post-carousel' ),
184 'hover-border-color' => __( 'Hover Border', 'post-carousel' ),
185 ),
186 'default' => array(
187 'color' => '#aaa',
188 'hover-color' => '#fff',
189 'bg' => '#fff',
190 'hover-bg' => '#D64224',
191 'border-color' => '#aaa',
192 'hover-border-color' => '#D64224',
193 ),
194 'dependency' => array( 'pcp_navigation', '!=', 'hide' ),
195 ),
196
197 // Pagination Settings.
198 array(
199 'type' => 'subheading',
200 'content' => __( 'Pagination', 'post-carousel' ),
201 ),
202 array(
203 'id' => 'pcp_pagination',
204 'type' => 'button_set',
205 'title' => __( 'Pagination', 'post-carousel' ),
206 'subtitle' => __( 'Show/Hide carousel pagination.', 'post-carousel' ),
207 'options' => array(
208 'show' => __( 'Show', 'post-carousel' ),
209 'hide' => __( 'Hide', 'post-carousel' ),
210 'hide_on_mobile' => __( 'Hide on Mobile', 'post-carousel' ),
211 ),
212 'default' => 'show',
213 ),
214 array(
215 'id' => 'pcp_pagination_color_set',
216 'type' => 'fieldset',
217 'class' => 'pcp-pagination-color-set',
218 'title' => __( 'Pagination Color', 'post-carousel' ),
219 'subtitle' => __( 'Set color for the carousel pagination.', 'post-carousel' ),
220 'fields' => array(
221 array(
222 'id' => 'pcp_pagination_color',
223 'type' => 'color_group',
224 'options' => array(
225 'color' => __( 'Color', 'post-carousel' ),
226 'active-color' => __( 'Active Color', 'post-carousel' ),
227 ),
228 'default' => array(
229 'color' => '#cccccc',
230 'active-color' => '#D64224',
231 ),
232 ),
233 ),
234 'dependency' => array( 'pcp_pagination', '!=', 'hide' ),
235 ),
236
237 // Miscellaneous Settings.
238 array(
239 'type' => 'subheading',
240 'content' => __( 'Miscellaneous', 'post-carousel' ),
241 ),
242 array(
243 'id' => 'pcp_adaptive_height',
244 'type' => 'switcher',
245 'title' => __( 'Adaptive Carousel Height', 'post-carousel' ),
246 'subtitle' => __( 'Dynamically adjust post carousel height based on each slide\'s height.', 'post-carousel' ),
247 'default' => false,
248 'text_on' => __( 'Enabled', 'post-carousel' ),
249 'text_off' => __( 'Disabled', 'post-carousel' ),
250 'text_width' => 94,
251 ),
252 array(
253 'id' => 'pcp_accessibility',
254 'type' => 'switcher',
255 'title' => __( 'Tab and Key Navigation', 'post-carousel' ),
256 'subtitle' => __( 'Enable/Disable carousel scroll with tab and keyboard.', 'post-carousel' ),
257 'default' => true,
258 'text_on' => __( 'Enabled', 'post-carousel' ),
259 'text_off' => __( 'Disabled', 'post-carousel' ),
260 'text_width' => 94,
261 ),
262 array(
263 'id' => 'touch_swipe',
264 'type' => 'switcher',
265 'title' => __( 'Touch Swipe', 'post-carousel' ),
266 'subtitle' => __( 'Enable/Disable touch swipe mode.', 'post-carousel' ),
267 'text_on' => __( 'Enabled', 'post-carousel' ),
268 'text_off' => __( 'Disabled', 'post-carousel' ),
269 'text_width' => 94,
270 'default' => true,
271 ),
272 array(
273 'id' => 'slider_draggable',
274 'type' => 'switcher',
275 'title' => __( 'Mouse Draggable', 'post-carousel' ),
276 'subtitle' => __( 'Enable/Disable mouse draggable mode.', 'post-carousel' ),
277 'text_on' => __( 'Enabled', 'post-carousel' ),
278 'text_off' => __( 'Disabled', 'post-carousel' ),
279 'text_width' => 94,
280 'default' => true,
281 ),
282 array(
283 'id' => 'free_mode',
284 'type' => 'switcher',
285 'title' => __( 'Free Mode', 'post-carousel' ),
286 'subtitle' => __( 'Enable/Disable free mode.', 'post-carousel' ),
287 'text_on' => __( 'Enabled', 'post-carousel' ),
288 'text_off' => __( 'Disabled', 'post-carousel' ),
289 'text_width' => 94,
290 'default' => false,
291 ),
292 array(
293 'id' => 'slider_mouse_wheel',
294 'type' => 'switcher',
295 'title' => __( 'Mouse Wheel', 'post-carousel' ),
296 'subtitle' => __( 'Enable/Disable mouse wheel mode.', 'post-carousel' ),
297 'text_on' => __( 'Enabled', 'post-carousel' ),
298 'text_off' => __( 'Disabled', 'post-carousel' ),
299 'text_width' => 94,
300 'default' => false,
301 ),
302 ), // End of fields array.
303 )
304 ); // Carousel Controls section end.
305 }
306 }
307