PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 2.4.2
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v2.4.2
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.2, at admin/views/configs/generator/class-sps-carousel.php

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