PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 4.7.4
Responsive Menu – Create Mobile-Friendly Menu v4.7.4
4.7.4 4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 All 91 releases
← All changes | v4.0.0/inc/classes/class-control-manager.php +951 -960 4.0.1 → 4.7.4 View file →
@@ -1,13 +1,13 @@
1 1 <?php
2 2 /**
3 3 * Control_Manager class.
4 4 * This class prepare the input control and it's markup.
5 - *
5 + *
6 6 * @version 4.0.0
7 7 * @author Expresstech System
8 - *
9 - * @package responsive-menu-pro
8 + *
9 + * @package responsive-menu
10 10 */
11 11
12 12 namespace RMP\Features\Inc;
13 13
@@ -14,9 +14,9 @@
14 14 use RMP\Features\Inc\Traits\Singleton;
15 15
16 16 // Disable the direct access to this class.
17 17 if ( ! defined( 'ABSPATH' ) ) {
18 - exit;
18 + exit;
19 19 }
20 20
21 21 /**
22 22 * Class Control_Manager
@@ -23,9 +23,9 @@
23 23 */
24 24 class Control_Manager {
25 25
26 26 use Singleton;
27 -
27 + public $pro_plugin_url = 'https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile';
28 28 /**
29 29 * Construct method.
30 30 */
31 31 protected function __construct() {
@@ -35,1237 +35,1228 @@
35 35 /**
36 36 * To setup action/filter.
37 37 *
38 38 * @version 4.0.0
39 - *
39 + *
40 40 * @return void
41 41 */
42 42 protected function setup_hooks() {
43 + }
43 44
45 + /**
46 + * Add hidden field input control.
47 + *
48 + * @version 4.0.0
49 + *
50 + * @param array List of attribute
51 + *
52 + * @return HTML|string
53 + */
54 + public function add_hidden_control( $param ) {
55 + ?><input type="hidden" name="<?php echo esc_attr( $param['name'] ); ?>" value="<?php echo esc_attr( $param['value'] ); ?>" >
56 + <?php
44 57 }
45 58
46 - /**
47 - * Add hidden field input control.
48 - *
49 - * @version 4.0.0
50 - *
51 - * @param array List of attribute
52 - *
53 - * @return HTML|string
54 - */
55 - public function add_hidden_control( $param ) {
56 - return sprintf( '<input type="hidden" name="%s" value="%s" >',
57 - esc_attr( $param['name'] ),
58 - esc_attr( $param['value'] ) );
59 - }
60 -
61 - /**
59 + /**
62 60 * This function prepare the single text input control.
63 - *
61 + *
64 62 * @version 4.0.0
65 63 * @param array $param List of attributes for a input control
66 - *
64 + *
67 65 * @return HTML
68 66 */
69 67 public function add_text_input_control( $param ) {
70 -
71 68 if ( empty( $param ) ) {
72 - return;
69 + return;
73 70 }
74 71
75 72 /**
76 73 * Filters the text input control attributes before create.
77 - *
74 + *
78 75 * @version 4.0.0
79 76 * @param array $param List of attribute.
80 77 */
81 - $param = apply_filters( 'rmp_before_add_text_input_control', $param );
78 + $param = apply_filters( 'rmp_before_add_text_input_control', $param );
82 79
83 - $group_classes = '';
84 - if ( ! empty( $param['group_classes'] ) ) {
85 - $group_classes = $param['group_classes'];
86 - }
80 + $is_disabled = '';
81 + $group_classes = '';
82 + if ( ! empty( $param['group_classes'] ) ) {
83 + $group_classes = $param['group_classes'];
84 + }
85 + ?>
86 + <div class="rmp-input-control-wrapper <?php echo esc_attr( $group_classes ); ?>">
87 + <?php
87 88
88 - $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
89 + // Check label is exist.
90 + if ( ! empty( $param['label'] ) ) {
91 + ?>
92 + <div class="rmp-input-control-label">
93 + <span> <?php echo esc_html( $param['label'] ); ?> </span>
94 + <span>
95 + <?php
96 + // Check tooltip text is added or not.
97 + if ( ! empty( $param['tool_tip'] ) ) {
98 + $this->get_tool_tip( $param['tool_tip'] );
99 + }
100 + ?>
101 + </span>
102 + <?php
103 + // Check feature type.
104 + if ( ! empty( $param['feature_type'] ) ) {
105 + $is_disabled = 'disabled';
106 + ?>
107 + <a target="_blank" rel="noopener" class="upgrade-tooltip" href="<?php echo esc_url( $this->pro_plugin_url ); ?>" >
108 + <?php echo esc_html( $param['feature_type'] ); ?>
109 + </a>
110 + <?php
111 + }
112 + ?>
113 + </div>
114 + <?php
115 + }
116 + ?>
117 + <div class="rmp-input-control">
118 + <?php
89 119
90 - //Check tooltip text is added or not.
91 - $tool_tip = '';
92 - if ( ! empty( $param['tool_tip'] ) ) {
93 - $tool_tip = $this->get_tool_tip( $param['tool_tip'] );
94 - }
120 + // Check this input has multi device options.
121 + $has_multi_device = '';
122 + if ( ! empty( $param['multi_device'] ) ) {
123 + $has_multi_device = 'multi-device=true';
124 + $this->get_device_options();
125 + }
95 126
96 - $is_disabled = '';
97 - $feature_label = '';
98 - // Check feature type.
99 - if( ! empty( $param['feature_type'] ) ) {
100 - $is_disabled = 'disabled';
101 - $feature_label = sprintf(
102 - '<a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > %s </a>',
103 - $param['feature_type']
104 - );
105 - }
127 + // Place holder text.
128 + $placeholder = '';
129 + if ( ! empty( $param['placeholder'] ) ) {
130 + $placeholder = $param['placeholder'];
131 + }
106 132
107 - // Check label is exist.
108 - if ( ! empty( $param['label'] ) ) {
109 - $html .= sprintf(
110 - '<div class="rmp-input-control-label">
111 - <span> %s </span>
112 - <span> %s </span>
113 - %s
114 - </div>',
115 - esc_html( $param['label'] ),
116 - $tool_tip,
117 - $feature_label
118 - );
119 - }
120 -
121 - $html .= '<div class="rmp-input-control">';
122 -
123 - // Check this input has multi device options.
124 - $has_multi_device = '';
125 - if ( ! empty( $param['multi_device']) ) {
126 - $has_multi_device = 'multi-device=true';
127 -
128 - $html .= $this->get_device_options();
129 - }
130 -
131 - //Place holder text.
132 - $placeholder = '';
133 - if ( ! empty( $param['placeholder'] ) ) {
134 - $placeholder = $param['placeholder'];
135 - }
136 -
137 133 // Check the input control type that maybe text,number or any other.
138 - if ( ! empty( $param['type']) ) {
134 + if ( ! empty( $param['type'] ) ) {
135 + $class = '';
136 + if ( ! empty( $param['class'] ) ) {
137 + $class = $param['class'];
138 + }
139 + ?>
140 + <input type="<?php echo esc_attr( $param['type'] ); ?>" id="<?php echo esc_attr( $param['id'] ); ?>" name="<?php echo esc_attr( $param['name'] ); ?>" <?php echo esc_attr( $has_multi_device ); ?> class="<?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr( $param['value'] ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" <?php echo esc_attr( $is_disabled ); ?> >
141 + <?php
142 + }
139 143
140 - $class = '';
141 - if ( ! empty( $param['class'] ) ) {
142 - $class = $param['class'];
143 - }
144 -
145 - $html .= sprintf( '<input type="%s" id="%s" name="%s" %s class="%s" value="%s" placeholder="%s" %s>',
146 - esc_attr( $param['type'] ),
147 - esc_attr( $param['id'] ),
148 - esc_attr( $param['name'] ),
149 - esc_attr( $has_multi_device ),
150 - esc_attr( $class ),
151 - esc_attr( $param['value'] ),
152 - esc_attr( $placeholder ),
153 - esc_attr( $is_disabled )
154 - );
155 - }
156 -
157 144 // Check the unit of the this control.
158 - if ( ! empty( $param['has_unit']) ) {
159 - $unit_type = $param['has_unit']['unit_type'];
160 - if ( 'all' === $unit_type ) {
161 - $html .= $this->get_input_control_unit( $param['has_unit'] );
162 - } else {
163 - $html .= sprintf('<span class="unit-%1$s"> %1$s </span>', esc_html( $unit_type ) );
164 - }
165 - }
145 + if ( ! empty( $param['has_unit'] ) ) {
146 + $unit_type = $param['has_unit']['unit_type'];
147 + if ( 'all' === $unit_type ) {
148 + $this->get_input_control_unit( $param['has_unit'] );
149 + } else {
150 + ?>
151 + <span class="unit-<?php echo esc_html( $unit_type ); ?>"> <?php echo esc_html( $unit_type ); ?> </span>
152 + <?php
153 + }
154 + }
155 + ?>
156 + </div></div>
157 + <?php
166 158
167 - $html .= '</div></div>';
168 -
169 159 /**
170 160 * Filters the text input attributes/contents after prepared.
171 - *
161 + *
172 162 * @version 4.0.0
173 - *
174 - * @param HTML|string Input control contents.
163 + *
164 + * @param HTML|string Input control contents.
175 165 * @param array $param List of attribute.
176 - */
177 - $html = apply_filters( 'rmp_text_control_html', $html, $param );
166 + */
167 + echo apply_filters( 'rmp_text_control_html', '', $param );
168 + }
178 169
179 - // Check if echo parameter is empty or false.
180 - if ( empty( $param['echo'] ) ) {
181 - return $html;
182 - }
170 + /**
171 + * This function prepare the single text input control.
172 + *
173 + * @version 4.4.0
174 + * @param array $param List of attributes for a input control
175 + *
176 + * @return HTML
177 + */
178 + public function rmp_textarea_control_html( $param ) {
179 + if ( empty($param) ) {
180 + return;
181 + }
183 182
184 - echo $html;
183 + /**
184 + * Filters the textarea input control attributes before creation.
185 + *
186 + * @version 4.0.0
187 + * @param array $param List of attributes.
188 + */
189 + $param = apply_filters('rmp_before_add_textarea_input_control', $param);
190 +
191 + $is_disabled = '';
192 + $group_classes = ! empty($param['group_classes']) ? $param['group_classes'] : '';
193 +
194 + ?>
195 + <div class="rmp-input-control-wrapper <?php echo esc_attr($group_classes); ?>">
196 + <?php
197 + // Check if label exists.
198 + if ( ! empty($param['label']) ) {
199 + ?>
200 + <div class="rmp-textarea-control-label">
201 + <span><?php echo esc_html($param['label']); ?></span>
202 + <span>
203 + <?php
204 + // Check if tooltip for textarea is added.
205 + if ( ! empty($param['tool_tip']) ) {
206 + $this->get_tool_tip($param['tool_tip']);
207 + }
208 + ?>
209 + </span>
210 + <?php
211 + // Check feature type.
212 + if ( ! empty($param['feature_type']) ) {
213 + $is_disabled = 'disabled';
214 + ?>
215 + <a target="_blank" rel="noopener" class="upgrade-tooltip" href="<?php echo esc_url($this->pro_plugin_url); ?>">
216 + <?php echo esc_html($param['feature_type']); ?>
217 + </a>
218 + <?php
219 + }
220 + ?>
221 + </div>
222 + <?php
223 + }
224 + ?>
225 + <div class="rmp-textarea-control">
226 + <?php
227 + // Placeholder for textarea.
228 + $placeholder = ! empty($param['placeholder']) ? $param['placeholder'] : '';
229 + $class = ! empty($param['class']) ? $param['class'] : '';
230 + ?>
231 + <textarea id="<?php echo esc_attr($param['id']); ?>" name="<?php echo esc_attr($param['name']); ?>" class="<?php echo esc_attr($class); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" <?php echo $is_disabled ? 'disabled' : ''; ?>><?php echo esc_html($param['value']); ?></textarea>
232 + </div>
233 + </div>
234 + <?php
235 +
236 + /**
237 + * Filters the textarea attributes/contents after preparation.
238 + *
239 + * @version 4.4.0
240 + *
241 + * @param string|HTML $textarea_control_contents The textarea control contents.
242 + * @param array $param List of attributes.
243 + */
244 + do_action('rmp_textarea_control_html', $param);
185 245 }
186 -
246 +
187 247 /**
188 248 * This function prepare the group text input control.
189 - *
249 + *
190 250 * @version 4.0.0
191 251 * @param array $param List of attributes for a input control
192 - *
252 + *
193 253 * @return HTML
194 254 */
195 - public function add_group_text_control( $param ) {
196 -
197 - if ( empty( $param) ) {
198 - return;
255 + public function add_group_text_control( $param ) {
256 + if ( empty( $param ) ) {
257 + return;
199 258 }
200 259
201 260 /**
202 261 * Filters the text group input control attributes before create.
203 - *
262 + *
204 263 * @version 4.0.0
205 264 * @param array $param List of attribute.
206 265 */
207 - $param = apply_filters('rmp_before_add_group_text_control', $param );
266 + $param = apply_filters( 'rmp_before_add_group_text_control', $param );
208 267
209 - $group_classes = '';
268 + $group_classes = '';
210 269
211 - if ( ! empty( $param['group_classes'] ) ) {
212 - $group_classes = $param['group_classes'];
213 - }
270 + if ( ! empty( $param['group_classes'] ) ) {
271 + $group_classes = $param['group_classes'];
272 + }
273 + ?>
274 + <div class="rmp-input-control-wrapper full-size <?php echo esc_attr( $group_classes ); ?>">
275 + <?php
214 276
215 - $html = sprintf('<div class="rmp-input-control-wrapper full-size %s">', $group_classes );
277 + // Check label is exist.
278 + if ( ! empty( $param['label'] ) ) {
279 + ?>
280 + <div class="rmp-input-control-label"> <span> <?php echo esc_html( $param['label'] ); ?> </span>
281 + <?php
282 + // Check tooltip text is added or not.
283 + if ( ! empty( $param['tool_tip'] ) ) {
284 + $this->get_tool_tip( $param['tool_tip'] );
285 + }
286 + ?>
287 + </div>
288 + <?php
289 + }
290 + ?>
291 + <div class="rmp-input-control rmp-input-group-control">
292 + <?php
216 293
217 - //Check tooltip text is added or not.
218 - $tool_tip = '';
219 - if ( ! empty( $param['tool_tip'] ) ) {
220 - $tool_tip = $this->get_tool_tip( $param['tool_tip'] );
221 - }
222 -
223 - // Check label is exist.
224 - if ( ! empty( $param['label'] ) ) {
225 - $html .= sprintf('<div class="rmp-input-control-label"> <span> %s </span> %s </div>', esc_html( $param['label'] ), $tool_tip );
226 - }
227 -
228 - $html .= '<div class="rmp-input-control rmp-input-group-control">';
229 -
230 294 // Check this input has multi device options.
231 - $has_multi_device = '';
232 - if ( ! empty( $param['multi_device']) ) {
233 - $has_multi_device = 'multi-device=true';
295 + $has_multi_device = '';
296 + if ( ! empty( $param['multi_device'] ) ) {
297 + $has_multi_device = 'multi-device=true';
298 + $this->get_device_options();
299 + }
234 300
235 - $html .= $this->get_device_options();
236 - }
237 -
238 301 // Check the input control type that maybe text,number or any other.
239 - if ( ! empty( $param['type']) ) {
240 - $class = '';
241 - if ( ! empty( $param['class'] ) ) {
242 - $class = $param['class'];
243 - }
302 + if ( ! empty( $param['type'] ) ) {
303 + $class = '';
304 + if ( ! empty( $param['class'] ) ) {
305 + $class = $param['class'];
306 + }
244 307
245 - if ( ! empty( $param['input_options'] ) ) {
308 + if ( ! empty( $param['input_options'] ) ) {
309 + foreach ( $param['input_options'] as $input ) {
310 + $value = ! empty( $param['value_options'][ $input ] ) ? $param['value_options'][ $input ] : '0px';
311 + ?>
312 + <div class="rmp-group-input-wrapper">
313 + <label> <?php echo esc_html( $input ); ?> </label>
314 + <input type="<?php echo esc_attr( $param['type'] ); ?>" placeholder="0px" data-input="<?php echo esc_attr( $input ); ?>" id="<?php echo esc_attr( $class . '-' . $input ); ?>" name="<?php echo esc_attr( $param['name'] . '[' . $input . ']' ); ?>" <?php echo esc_attr( $has_multi_device ); ?> class="no-updates rmp-group-input <?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr( $value ); ?>">
315 + </div>
316 + <?php
317 + }
318 + ?>
319 + <div class="rmp-group-input-wrapper">
320 + <button type="button" class="is-linked rmp-group-input rmp-group-input-linked">
321 + <span class="dashicons dashicons-admin-links "></span>
322 + </button></div>
323 + <?php
324 + }
325 + }
246 326
247 - foreach( $param['input_options'] as $input ) {
248 - $value = ! empty( $param['value_options'][$input] ) ? $param['value_options'][$input] : '0px';
249 -
250 - $html .= sprintf(
251 - '<div class="rmp-group-input-wrapper">
252 - <label> %s </label>
253 - <input type="%s" placeholder="0px" data-input="%s" id="%s" name="%s" %s class="no-updates rmp-group-input %s" value="%s">
254 - </div>',
255 - esc_html__( $input, 'responsive-menu-pro' ),
256 - esc_attr( $param['type'] ),
257 - esc_attr( $input ),
258 - esc_attr( $class.'-'.$input ),
259 - esc_attr( $param['name'].'['. $input .']' ),
260 - esc_attr( $has_multi_device ),
261 - esc_attr( $class ),
262 - esc_attr( $value )
263 - );
264 - }
265 -
266 - $html .= sprintf(
267 - '<div class="rmp-group-input-wrapper">
268 - <button type="button" class="is-linked rmp-group-input rmp-group-input-linked">
269 - <span class="dashicons dashicons-admin-links "></span>
270 - </button></div>');
271 - }
272 - }
273 -
274 327 // Check the unit of the this control.
275 - if ( ! empty( $param['has_unit']) ) {
276 - $unit_type = $param['has_unit']['unit_type'];
277 - if ( 'all' === $unit_type ) {
278 - $html .= $this->get_input_control_unit( $param['has_unit'] );
279 - } else {
280 - $html .= sprintf('<span class="unit-%1$s"> %1$s </span>', esc_html( $unit_type ) );
281 - }
282 - }
328 + if ( ! empty( $param['has_unit'] ) ) {
329 + $unit_type = $param['has_unit']['unit_type'];
330 + if ( 'all' === $unit_type ) {
331 + $this->get_input_control_unit( $param['has_unit'] );
332 + } else {
333 + ?>
334 + <span class="unit-<?php echo esc_html( $unit_type ); ?>"> <?php echo esc_html( $unit_type ); ?> </span>
335 + <?php
336 + }
337 + }
338 + ?>
339 + </div></div>
340 + <?php
283 341
284 - $html .= '</div></div>';
285 -
286 - /**
342 + /**
287 343 * Filters the text input attributes/contents after prepared.
288 - *
344 + *
289 345 * @version 4.0.0
290 - *
291 - * @param HTML|string Input control contents.
346 + *
347 + * @param HTML|string Input control contents.
292 348 * @param array $param List of attribute.
293 - */
294 - $html = apply_filters( 'rmp_text_control_html', $html, $param );
349 + */
350 + echo apply_filters( 'rmp_text_control_html', '', $param );
351 + }
295 352
296 -
297 - // Check if echo parameter is empty or false.
298 - if ( empty( $param['echo'] ) ) {
299 - return $html;
300 - }
301 -
302 - echo $html;
303 -
304 - }
305 -
306 - /**
353 + /**
307 354 * This function prepare input unit options.
308 - *
355 + *
309 356 * @version 4.0.0
310 357 * @param array $param List of attributes for a input control
311 - *
358 + *
312 359 * @return HTML
313 360 */
314 - protected function get_input_control_unit( $param ) {
361 + protected function get_input_control_unit( $param ) {
362 + if ( empty( $param['name'] ) ) {
363 + return;
364 + }
315 365
316 - if ( empty( $param['name'] ) ) {
317 - return;
318 - }
319 -
320 - $value = '';
366 + $value = '';
321 367
322 - if ( ! empty( $param['value'] ) ) {
323 - $value = $param['value'];
324 - }
368 + if ( ! empty( $param['value'] ) ) {
369 + $value = $param['value'];
370 + }
325 371
326 - $has_multi_device = '';
327 - if ( ! empty( $param['multi_device']) ) {
328 - $has_multi_device = 'multi-device="true"';
329 - }
372 + $has_multi_device = 'false';
373 + if ( ! empty( $param['multi_device'] ) ) {
374 + $has_multi_device = 'true';
375 + }
330 376
331 - $unit_options = [ 'px', '%','em','rem','vw','vh' ];
377 + $unit_options = array( 'px', '%', 'em', 'rem', 'vw', 'vh' );
332 378
333 379 /**
334 380 * Filters the input units.
335 - *
381 + *
336 382 * @param array $unit_options List of units.
337 383 */
338 - $unit_options = apply_filters( 'rmp_input_units', $unit_options );
384 + $unit_options = apply_filters( 'rmp_input_units', $unit_options );
385 + ?>
386 + <select id="<?php echo esc_attr( $param['id'] ); ?>" name="<?php echo esc_attr( $param['name'] ); ?>" class="<?php echo esc_attr( $param['classes'] ); ?>" multi-device="<?php echo esc_attr( $has_multi_device ); ?>" >
387 + <?php
388 + foreach ( $unit_options as $unit ) {
389 + $is_selected = '';
390 + if ( $value === $unit ) {
391 + $is_selected = 'selected';
392 + }
339 393
340 - $options = '';
341 - foreach( $unit_options as $unit ) {
342 -
343 - $is_selected = '';
344 - if ( $value === $unit ) {
345 - $is_selected = 'selected';
346 - }
394 + $is_disabled = '';
395 + if ( ! empty( $param['default'] ) && $param['default'] !== $unit ) {
396 + $is_disabled = 'disabled';
397 + }
398 + ?>
399 + <option <?php echo esc_attr( $is_disabled ); ?> value="<?php echo esc_attr( $unit ); ?>" <?php echo esc_attr( $is_selected ); ?> >
400 + <?php
401 + echo esc_attr( $unit );
402 + if ( ! empty( $param['default'] ) && $param['default'] !== $unit ) {
403 + esc_html_e( ' (PRO)', 'responsive-menu' );
404 + }
405 + ?>
406 + </option>
407 + <?php
408 + }
409 + ?>
410 + </select>
411 + <?php
412 + }
347 413
348 - $feature_label = '';
349 - $is_disabled = '';
350 - if ( ! empty( $param['default'] ) && $param['default'] !== $unit ) {
351 - $is_disabled = 'disabled';
352 - $feature_label = __( ' (PRO)', 'responsive-menu-pro' );
353 - }
354 -
355 - $options .= sprintf(
356 - '<option %s value="%s" %s >%s</option>',
357 - esc_attr( $is_disabled ),
358 - esc_attr($unit),
359 - esc_attr( $is_selected ),
360 - esc_attr( $unit . $feature_label )
361 - );
362 - }
363 -
364 - return sprintf(
365 - '<select id="%1$s" name="%2$s" class="%3$s" %4$s > %5$s </select>',
366 - esc_attr( $param['id'] ),
367 - esc_attr( $param['name'] ),
368 - esc_attr( $param['classes'] ),
369 - $has_multi_device,
370 - $options
371 - );
372 -
373 - }
374 -
375 414 /**
376 415 * This function prepare the color control.
377 - *
416 + *
378 417 * @version 4.0.0
379 418 * @param array $param List of attributes for a input control
380 - *
419 + *
381 420 * @return HTML
382 421 */
383 - public function add_color_control( $param ) {
384 -
385 - if ( empty( $param) ) {
386 - return;
422 + public function add_color_control( $param ) {
423 + if ( empty( $param ) ) {
424 + return;
387 425 }
388 426
389 427 /**
390 428 * Filters the color input control attribute.
391 - *
429 + *
392 430 * @version 4.0.0
393 431 * @param array $param List of attribute.
394 - */
395 - $param = apply_filters( 'rmp_before_add_color_control', $param );
432 + */
433 + $param = apply_filters( 'rmp_before_add_color_control', $param );
396 434
397 - $group_classes = '';
435 + $group_classes = '';
398 436
399 - if ( ! empty( $param['group_classes'] ) ) {
400 - $group_classes = $param['group_classes'];
401 - }
437 + if ( ! empty( $param['group_classes'] ) ) {
438 + $group_classes = $param['group_classes'];
439 + }
440 + ?>
441 + <div class="rmp-input-control-wrapper <?php echo esc_attr( $group_classes ); ?>">
442 + <?php
402 443
403 - $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
444 + // Check label is exist.
445 + if ( ! empty( $param['label'] ) ) {
446 + ?>
447 + <div class="rmp-input-control-label"> <span> <?php echo esc_html( $param['label'] ); ?> </span>
448 + <?php
449 + // Check tooltip text is added or not.
450 + if ( ! empty( $param['tool_tip'] ) ) {
451 + $this->get_tool_tip( $param['tool_tip'] );
452 + }
453 + ?>
454 + </div>
455 + <?php
456 + }
457 + ?>
458 + <div class="rmp-input-control">
459 + <?php
404 460
405 - //Check tooltip text is added or not.
406 - $tool_tip = '';
407 - if ( ! empty( $param['tool_tip'] ) ) {
408 - $tool_tip = $this->get_tool_tip( $param['tool_tip'] );
409 - }
410 -
411 - // Check label is exist.
412 - if ( ! empty( $param['label'] ) ) {
413 - $html .= sprintf('<div class="rmp-input-control-label"> <span> %s </span> %s </div>', esc_html( $param['label'] ), $tool_tip );
414 - }
415 -
416 - $html .= '<div class="rmp-input-control">';
417 -
418 461 // Check this input has multi device options.
419 - $has_multi_device = '';
420 - if ( ! empty( $param['multi_device']) ) {
421 - $has_multi_device = 'multi-device=true';
422 - $html .= $this->get_device_options();
423 - }
462 + $has_multi_device = '';
463 + if ( ! empty( $param['multi_device'] ) ) {
464 + $has_multi_device = 'multi-device=true';
465 + $this->get_device_options();
466 + }
424 467
425 - $class = '';
426 - if ( ! empty( $param['class'] ) ) {
427 - $class = $param['class'];
428 - }
468 + $class = '';
469 + if ( ! empty( $param['class'] ) ) {
470 + $class = $param['class'];
471 + }
472 + ?>
473 + <input type="text" data-alpha="true" id="<?php echo esc_attr( $param['id'] ); ?>" name="<?php echo esc_attr( $param['name'] ); ?>" <?php echo esc_attr( $has_multi_device ); ?> class="no-updates rmp-color-input <?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr( $param['value'] ); ?>"></div></div>
474 + <?php
429 475
430 - $html .= sprintf( '<input type="text" id="%s" name="%s" %s class="no-updates rmp-color-input %s" value="%s">',
431 - esc_attr( $param['id'] ),
432 - esc_attr( $param['name'] ),
433 - esc_attr( $has_multi_device ),
434 - esc_attr( $class ),
435 - esc_attr( $param['value'] )
436 - );
437 -
438 - $html .= '</div></div>';
439 -
440 -
441 476 /**
442 477 * Filters the color input control html.
443 - *
478 + *
444 479 * @version 4.0.0
445 480 * @param HTML|string Input control contents.
446 481 * @param array $param List of attribute.
447 - */
448 - $html = apply_filters( 'rmp_color_control_html', $html, $param );
482 + */
483 + echo apply_filters( 'rmp_color_control_html', '', $param );
484 + }
449 485
450 - // Check if echo parameter is empty or false.
451 - if ( empty( $param['echo'] ) ) {
452 - return $html;
453 - }
454 -
455 - echo $html;
456 - }
457 -
458 486 /**
459 487 * This function prepare the button input control.
460 - *
488 + *
461 489 * @version 4.0.0
462 490 * @param array $param List of attributes for a input control
463 - *
491 + *
464 492 * @return HTML
465 493 */
466 - public function add_button_control( $param ) {
467 - if ( empty( $param) ) {
468 - return;
494 + public function add_button_control( $param ) {
495 + if ( empty( $param ) ) {
496 + return;
469 497 }
470 498
471 499 /**
472 500 * Filters the button input control attribute.
473 - *
501 + *
474 502 * @version 4.0.0
475 503 * @param array $param List of attribute.
476 - */
477 - $param = apply_filters('rmp_before_add_button_control', $param );
504 + */
505 + $param = apply_filters( 'rmp_before_add_button_control', $param );
478 506
479 - $group_classes = '';
480 - if ( ! empty( $param['group_classes'] ) ) {
481 - $group_classes = $param['group_classes'];
482 - }
507 + $group_classes = '';
508 + if ( ! empty( $param['group_classes'] ) ) {
509 + $group_classes = $param['group_classes'];
510 + }
511 + $class = '';
512 + if ( ! empty( $param['class'] ) ) {
513 + $class = $param['class'];
514 + }
515 + ?>
516 + <div class="rmp-input-control-wrapper <?php echo esc_attr( $group_classes ); ?>">
517 + <div class="rmp-input-control">
518 + <button type="button" id="<?php echo esc_attr( $param['id'] ); ?>" class="button button-primary button-large <?php echo esc_attr( $class ); ?>" ><?php echo esc_html( $param['label'] ); ?></button>
519 + </div>
520 + </div>
521 + <?php
483 522
484 - $html = sprintf( '<div class="rmp-input-control-wrapper %s">', $group_classes );
485 -
486 - $html .= '<div class="rmp-input-control">';
487 -
488 - $class = '';
489 - if ( ! empty( $param['class'] ) ) {
490 - $class = $param['class'];
491 - }
492 -
493 -
494 - $html .= sprintf( '<button type="button" id="%s" class="button button-primary button-large %s" >%s</button>',
495 - esc_attr( $param['id'] ),
496 - esc_attr( $class ),
497 - esc_html( $param['label'] )
498 - );
499 -
500 - $html .= '</div></div>';
501 -
502 523 /**
503 524 * Filters the button input control html.
525 + *
504 526 * @version 4.0.0
505 - *
527 + *
506 528 * @param HTML|string Input control contents.
507 529 * @param array $param List of attribute.
508 - */
509 - $html = apply_filters( 'rmp_button_control_html', $html, $param );
530 + */
531 + echo apply_filters( 'rmp_button_control_html', '', $param );
532 + }
510 533
511 - // Check if echo parameter is empty or false.
512 - if ( empty( $param['echo'] ) ) {
513 - return $html;
514 - }
515 -
516 - echo $html;
517 -
518 - }
519 -
520 534 /**
521 535 * This function prepare the checkbox as switcher input control.
522 - *
536 + *
523 537 * @version 4.0.0
524 538 * @param array $param List of attributes for a input control
525 - *
539 + *
526 540 * @return HTML
527 541 */
528 - public function add_switcher_control( $param ) {
529 -
542 + public function add_switcher_control( $param ) {
530 543 if ( empty( $param ) ) {
531 - return;
532 - }
544 + return;
545 + }
533 546
534 547 /**
535 548 * Filters the switcher input control attributes.
536 - *
549 + *
537 550 * @version 4.0.0
538 551 * @param array $param List of attribute.
539 - */
540 - $param = apply_filters('rmp_before_add_switcher_control', $param );
552 + */
553 + $param = apply_filters( 'rmp_before_add_switcher_control', $param );
541 554
542 - $group_classes = '';
555 + $group_classes = '';
543 556
544 - if ( ! empty( $param['group_classes'] ) ) {
545 - $group_classes = $param['group_classes'];
546 - }
557 + if ( ! empty( $param['group_classes'] ) ) {
558 + $group_classes = $param['group_classes'];
559 + }
560 + ?>
561 + <div class="rmp-input-control-wrapper rmp-input-control-switcher <?php echo esc_attr( $group_classes ); ?>" >
562 + <?php
547 563
548 - $html = sprintf('<div class="rmp-input-control-wrapper rmp-input-control-switcher %s">', $group_classes );
564 + // Check label is exist.
565 + if ( ! empty( $param['label'] ) ) {
566 + ?>
567 + <div class="rmp-input-control-label">
568 + <span> <?php echo esc_html( $param['label'] ); ?> </span>
569 + <?php
570 + // Check tooltip text is added or not.
571 + if ( ! empty( $param['tool_tip'] ) ) {
572 + $this->get_tool_tip( $param['tool_tip'] );
573 + }
574 + ?>
575 + </div>
576 + <?php
577 + }
549 578
550 - //Check tooltip text is added or not.
551 - $tool_tip = '';
552 - if ( ! empty( $param['tool_tip'] ) ) {
553 - $tool_tip = $this->get_tool_tip( $param['tool_tip'] );
554 - }
579 + if ( ! empty( $param['name'] ) ) {
580 + ?>
581 + <div class="rmp-input-control">
582 + <?php
583 + $is_disabled = '';
584 + // Check feature type.
585 + if ( ! empty( $param['feature_type'] ) ) {
586 + $is_disabled = 'disabled';
587 + ?>
588 + <a target="_blank" rel="noopener" class="upgrade-tooltip" href="<?php echo esc_url( $this->pro_plugin_url ); ?>" > <?php echo esc_html( $param['feature_type'] ); ?> </a>
589 + <?php
590 + }
555 591
556 - $is_disabled = '';
557 - $feature_label = '';
558 - // Check feature type.
559 - if( ! empty( $param['feature_type'] ) ) {
560 - $is_disabled = 'disabled';
561 - $feature_label = sprintf(
562 - '<a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > %s </a>',
563 - $param['feature_type']
564 - );
565 - }
592 + // Check multi device options is enabled.
593 + $has_multi_device = '';
594 + if ( ! empty( $param['multi_device'] ) ) {
595 + $has_multi_device = 'multi-device=true';
596 + $this->get_device_options();
597 + }
566 598
567 - // Check label is exist.
568 - if ( ! empty( $param['label'] ) ) {
569 - $html .= sprintf(
570 - '<div class="rmp-input-control-label">
571 - <span> %s </span>
572 - %s
573 - </div>',
574 - esc_html( $param['label'] ),
575 - $tool_tip
576 - );
577 - }
599 + $class = '';
600 + if ( ! empty( $param['class'] ) ) {
601 + $class = $param['class'];
602 + }
603 + ?>
604 + <input <?php echo esc_attr( $is_disabled ); ?> type="hidden" value="off" name="<?php echo esc_attr( $param['name'] ); ?>"/><input <?php echo esc_attr( $is_disabled ); ?> type="checkbox" id="<?php echo esc_attr( $param['id'] ); ?>" name="<?php echo esc_attr( $param['name'] ); ?>" <?php echo esc_attr( $has_multi_device ); ?> class="toggle <?php echo esc_attr( $class ); ?>" value="on" <?php echo esc_attr( $param['is_checked'] ); ?> ></div>
605 + <?php
606 + }
607 + ?>
608 + </div>
609 + <?php
578 610
579 - if ( ! empty( $param['name'] ) ) {
580 -
581 - $html .= '<div class="rmp-input-control">';
582 - $html .= $feature_label;
583 -
584 - // Check multi device options is enabled.
585 - $has_multi_device = '';
586 - if ( ! empty( $param['multi_device']) ) {
587 - $has_multi_device = 'multi-device=true';
588 - $html .= $this->get_device_options();
589 - }
590 -
591 - $class = '';
592 - if ( ! empty( $param['class'] ) ) {
593 - $class = $param['class'];
594 - }
595 -
596 - $html .= sprintf( '<input %s type="hidden" value="off" name="%s"/>', esc_attr( $is_disabled ), esc_attr( $param['name'] ) );
597 - $html .= sprintf( '<input %s type="checkbox" id="%s" name="%s" %s class="toggle %s" value="on" %s>',
598 - esc_attr( $is_disabled ),
599 - esc_attr( $param['id'] ),
600 - esc_attr( $param['name'] ),
601 - esc_attr( $has_multi_device ),
602 - esc_attr( $class ),
603 - esc_attr( $param['is_checked'] )
604 - );
605 -
606 - $html .= '</div>';
607 - }
608 -
609 - $html .= '</div>';
610 -
611 611 /**
612 612 * Filters the switcher input control html.
613 613 *
614 614 * @version 4.0.0
615 - *
615 + *
616 616 * @param HTML|string Input control contents.
617 617 * @param array $param List of attribute.
618 618 */
619 - $html = apply_filters( 'rmp_switcher_control_html', $html, $param );
619 + echo apply_filters( 'rmp_switcher_control_html', '', $param );
620 + }
620 621
621 - // Check if echo parameter is empty or false.
622 - if ( empty( $param['echo'] ) ) {
623 - return $html;
624 - }
625 -
626 - echo $html;
627 - }
628 -
629 622 /**
630 623 * This function prepare the select/dropdown input control.
631 - *
624 + *
632 625 * @version 4.0.0
633 626 * @param array $param List of attributes for a input control
634 - *
627 + *
635 628 * @return HTML
636 629 */
637 - public function add_select_control( $param ) {
638 -
639 - if ( empty( $param) ) {
640 - return;
630 + public function add_select_control( $param ) {
631 + if ( empty( $param ) ) {
632 + return;
641 633 }
642 634
643 635 /**
644 636 * Filters the select input control attributes.
645 - *
637 + *
646 638 * @version 4.0.0
647 639 * @param array $param List of attribute.
648 640 */
649 - $param = apply_filters('rmp_before_add_select_control', $param );
641 + $param = apply_filters( 'rmp_before_add_select_control', $param );
650 642
651 - $group_classes = '';
643 + $group_classes = '';
652 644
653 - if ( ! empty( $param['group_classes'] ) ) {
654 - $group_classes = $param['group_classes'];
655 - }
645 + if ( ! empty( $param['group_classes'] ) ) {
646 + $group_classes = $param['group_classes'];
647 + }
656 648
657 - $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
649 + ?>
650 + <div class="rmp-input-control-wrapper <?php echo esc_attr( $group_classes ); ?> ">
651 + <?php
658 652
659 - //Check tooltip text is added or not.
660 - $tool_tip = '';
661 - if ( ! empty( $param['tool_tip'] ) ) {
662 - $tool_tip = $this->get_tool_tip( $param['tool_tip'] );
663 - }
653 + // Check label is exist.
654 + if ( ! empty( $param['label'] ) ) {
655 + ?>
656 + <div class="rmp-input-control-label">
657 + <span> <?php echo esc_html( $param['label'] ); ?> </span>
658 + <span>
659 + <?php
660 + // Check tooltip text is added or not.
661 + if ( ! empty( $param['tool_tip'] ) ) {
662 + $this->get_tool_tip( $param['tool_tip'] );
663 + }
664 + ?>
665 + </span>
666 + <?php
667 + // Check feature type.
668 + if ( ! empty( $param['feature_type'] ) ) {
669 + ?>
670 + <a target="_blank" rel="noopener" class="upgrade-tooltip" href="<?php echo esc_url( $this->pro_plugin_url ); ?>" > <?php echo esc_html( $param['feature_type'] ); ?> </a>
671 + <?php } ?>
672 + </div>
673 + <?php
674 + }
675 + ?>
676 + <div class="rmp-input-control">
677 + <?php
664 678
665 - $is_disabled = '';
666 - $feature_label = '';
667 - // Check feature type.
668 - if( ! empty( $param['feature_type'] ) ) {
669 - $is_disabled = 'disabled';
670 - $feature_label = sprintf(
671 - '<a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > %s </a>',
672 - $param['feature_type']
673 - );
674 - }
675 -
676 - // Check label is exist.
677 - if ( ! empty( $param['label'] ) ) {
678 - $html .= sprintf(
679 - '<div class="rmp-input-control-label">
680 - <span> %s </span>
681 - <span> %s </span>
682 - %s
683 - </div>',
684 - esc_html( $param['label'] ),
685 - $tool_tip,
686 - $feature_label
687 - );
688 - }
689 -
690 - $html .= '<div class="rmp-input-control">';
691 -
692 679 // Check multi device options is enabled.
693 - $has_multi_device = '';
694 - if ( ! empty( $param['multi_device']) ) {
695 - $has_multi_device = 'multi-device=true';
680 + $has_multi_device = '';
681 + if ( ! empty( $param['multi_device'] ) ) {
682 + $has_multi_device = 'multi-device=true';
683 + $this->get_device_options();
684 + }
696 685
697 - $html .= $this->get_device_options();
698 - }
686 + $class = '';
687 + if ( ! empty( $param['class'] ) ) {
688 + $class = $param['class'];
689 + }
699 690
700 - $class = '';
701 - if ( ! empty( $param['class'] ) ) {
702 - $class = $param['class'];
703 - }
704 -
705 - $options = '';
706 -
707 - if ( ! empty( $param['options'] ) ) {
708 - foreach( $param['options'] as $key => $value ) {
709 - $is_select = '';
710 - if ( ! empty( $param['value'] ) ) {
711 - if( ! empty( $param['multiple'] ) && is_array( $param['value'] ) && in_array( $key, $param['value'] ) ) {
712 - $is_select = 'selected';
713 - } elseif( $key == $param['value'] ) {
714 - $is_select = 'selected';
715 - }
716 - }
717 -
718 - // Check options is pro.
719 - $disabled = '';
720 - if ( strpos( strtolower($value) , 'pro' ) ) {
721 - $disabled = 'disabled';
722 - }
723 -
724 - $options .= sprintf('<option %s value="%s" %s> %s </option>',
725 - esc_attr( $disabled ),
726 - esc_attr( $key ),
727 - esc_attr( $is_select ),
728 - esc_html( $value )
729 - );
730 - }
731 - }
732 -
733 691 // Check multiple value is allowed.
734 - $is_multiple_value_allow = '';
735 - if ( ! empty( $param['multiple'] ) ) {
736 - $is_multiple_value_allow = 'multiple';
737 - }
692 + $is_multiple_value_allow = '';
693 + if ( ! empty( $param['multiple'] ) ) {
694 + $is_multiple_value_allow = 'multiple';
695 + }
696 + ?>
697 + <select id="<?php echo esc_attr( $param['id'] ); ?>" name="<?php echo esc_attr( $param['name'] ); ?>" <?php echo esc_attr( $has_multi_device ); ?> class="<?php echo esc_attr( $class ); ?>" <?php echo esc_attr( $is_multiple_value_allow ); ?>>
698 + <?php
699 + if ( ! empty( $param['options'] ) ) {
700 + foreach ( $param['options'] as $key => $value ) {
701 + $is_select = '';
702 + if ( ! empty( $param['value'] ) ) {
703 + if ( ! empty( $param['multiple'] ) && is_array( $param['value'] ) && in_array( $key, $param['value'], true ) ) {
704 + $is_select = 'selected';
705 + } elseif ( $key == $param['value'] ) {
706 + $is_select = 'selected';
707 + }
708 + }
738 709
739 - $html .= sprintf( '<select id="%s" name="%s" %s class="%s" %s>%s</select>',
740 - esc_attr( $param['id'] ),
741 - esc_attr( $param['name'] ),
742 - esc_attr( $has_multi_device ),
743 - esc_attr( $class ),
744 - esc_attr( $is_multiple_value_allow ),
745 - $options
746 - );
747 -
748 - $html .= '</div></div>';
710 + // Check options is pro.
711 + $disabled = '';
712 + if ( strpos( strtolower( $value ), 'pro' ) ) {
713 + $disabled = 'disabled';
714 + }
715 + ?>
716 + <option <?php echo esc_attr( $disabled ); ?> value="<?php echo esc_attr( $key ); ?>" <?php echo esc_attr( $is_select ); ?>> <?php echo esc_html( $value ); ?> </option>
717 + <?php
718 + }
719 + }
720 + ?>
721 + </select>
722 + </div></div>
723 + <?php
749 724
750 725 /**
751 726 * Filters the select input control html.
752 727 *
753 728 * @version 4.0.0
754 - *
729 + *
755 730 * @param HTML|string Input control contents.
756 731 * @param array $param List of attribute.
757 732 */
758 - $html = apply_filters( 'rmp_select_control_html', $html, $param );
733 + echo apply_filters( 'rmp_select_control_html', '', $param );
734 + }
759 735
760 - // Check if echo parameter is empty or false.
761 - if ( empty( $param['echo'] ) ) {
762 - return $html;
763 - }
764 -
765 - echo $html;
766 - }
767 -
768 736 /**
769 737 * This function prepare the tooltip.
770 - *
738 + *
771 739 * @version 4.0.0
772 740 * @param array $param List of attributes for a input control
773 - *
741 + *
774 742 * @return HTML
775 743 */
776 - public function get_tool_tip( $param ) {
777 -
744 + public function get_tool_tip( $param ) {
778 745 if ( empty( $param['text'] ) ) {
779 - return;
780 - }
746 + return;
747 + }
748 + ?>
749 + <div class="rmp-tooltip-icon dashicons dashicons-editor-help">
750 + <span class="rmp-tooltip-content">
751 + <?php
752 + echo wp_kses(
753 + $param['text'],
754 + array(
755 + 'a' => array(
756 + 'href' => array(),
757 + 'title' => array(),
758 + ),
759 + )
760 + );
761 + ?>
762 + </span>
763 + </div>
764 + <?php
765 + }
781 766
782 - return sprintf(
783 - '<div class="rmp-tooltip-icon dashicons dashicons-editor-help">
784 - <span class="rmp-tooltip-content"> %s </span>
785 - </div>',
786 - wp_kses(
787 - $param['text'],
788 - array(
789 - 'a' => array(
790 - 'href' => array(),
791 - 'title' => array()
792 - )
793 - )
794 - )
795 - );
796 - }
797 -
798 767 /**
799 - * This function prepare the icon picker control.
800 - *
768 + * This function prepare the shortcut.
769 + *
801 770 * @version 4.0.0
802 771 * @param array $param List of attributes for a input control
803 - *
772 + *
804 773 * @return HTML
805 774 */
806 - public function add_icon_picker_control( $param ) {
775 + public function add_shortcut_link( $param ) {
776 + if ( empty( $param ) ) {
777 + return;
778 + }
807 779
808 - if ( empty( $param) ) {
809 - return;
780 + // Accordion id.
781 + $accordion_id = '';
782 + if ( ! empty( $param['accordion_id'] ) ) {
783 + $accordion_id = $param['accordion_id'];
810 784 }
811 785
812 - $group_classes = '';
786 + // Sub accordion id.
787 + $sub_accordion_id = '';
788 + if ( ! empty( $param['sub_accordion_id'] ) ) {
789 + $sub_accordion_id = $param['sub_accordion_id'];
790 + }
813 791
814 - if ( ! empty( $param['group_classes'] ) ) {
815 - $group_classes = $param['group_classes'];
816 - }
792 + // Sub tab id.
793 + $sub_tab_id = '';
794 + if ( ! empty( $param['sub_tab_id'] ) ) {
795 + $sub_tab_id = $param['sub_tab_id'];
796 + }
817 797
818 - $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
798 + if ( ! empty( $param['label'] ) && ! empty( $param['target'] ) ) {
799 + ?>
800 + <div class="rmp-quick-edit-link rmp-input-control-wrapper" aria-owns="<?php echo esc_attr( $param['target'] ); ?>" accordion-id="<?php echo esc_attr( $accordion_id ); ?>" sub-accordion-id="<?php echo esc_attr( $sub_accordion_id ); ?>" sub-tab-id="<?php echo esc_attr( $sub_tab_id ); ?>">
801 + <a href="javascript:void(0)"><?php echo esc_html( $param['label'] ); ?> <i class="fas fa-share"></i></a>
802 + </div>
803 + <?php
804 + }
805 + }
819 806
820 - //Check tooltip text is added or not.
821 - $tool_tip = '';
822 - if ( ! empty( $param['tool_tip'] ) ) {
823 - $tool_tip = $this->get_tool_tip( $param['tool_tip'] );
824 - }
807 + /**
808 + * This function prepare the icon picker control.
809 + *
810 + * @version 4.0.0
811 + * @param array $param List of attributes for a input control
812 + *
813 + * @return HTML
814 + */
815 + public function add_icon_picker_control( $param ) {
816 + if ( empty( $param ) ) {
817 + return;
818 + }
825 819
826 - $is_disabled = '';
827 - $feature_label = '';
828 - // Check feature type.
829 - if( ! empty( $param['feature_type'] ) ) {
830 - $is_disabled = 'disabled';
831 - $feature_label = sprintf(
832 - '<a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > %s </a>',
833 - $param['feature_type']
834 - );
835 - }
820 + global $wp_filesystem;
821 + if ( empty( $wp_filesystem ) ) {
822 + require_once ABSPATH . 'wp-admin/includes/file.php';
823 + }
824 + WP_Filesystem();
836 825
837 - // Check label is exist.
838 - if ( ! empty( $param['label'] ) ) {
839 - $html .= sprintf(
840 - '<div class="rmp-input-control-label">
841 - <span> %s </span>
842 - <span> %s </span>
843 - %s
844 - </div>',
845 - esc_html( $param['label'] ),
846 - $tool_tip,
847 - $feature_label
848 - );
849 - }
826 + $group_classes = '';
850 827
851 - $html .= sprintf('<div class="rmp-input-control rmp-icon-picker-container">');
828 + if ( ! empty( $param['group_classes'] ) ) {
829 + $group_classes = $param['group_classes'];
830 + }
831 + $is_disabled = '';
832 + ?>
833 + <div class="rmp-input-control-wrapper <?php echo esc_attr( $group_classes ); ?>">
834 + <?php
852 835
836 + // Check label is exist.
837 + if ( ! empty( $param['label'] ) ) {
838 + ?>
839 + <div class="rmp-input-control-label">
840 + <span> <?php echo esc_html( $param['label'] ); ?> </span>
841 + <span>
842 + <?php
843 + // Check tooltip text is added or not.
844 + if ( ! empty( $param['tool_tip'] ) ) {
845 + $this->get_tool_tip( $param['tool_tip'] );
846 + }
847 + ?>
848 + </span>
849 + <?php
850 + // Check feature type.
851 + if ( ! empty( $param['feature_type'] ) ) {
852 + $is_disabled = 'disabled';
853 + ?>
854 + <a target="_blank" rel="noopener" class="upgrade-tooltip" href="<?php echo esc_url( $this->pro_plugin_url ); ?>" > <?php echo esc_html( $param['feature_type'] ); ?></a>
855 + <?php
856 + }
857 + ?>
858 + </div>
859 + <?php
860 + }
861 + ?>
862 + <div class="rmp-input-control rmp-icon-picker-container">
863 + <?php
864 +
853 865 // Check multiple device option enabled.
854 - $has_multi_device = '';
855 - if ( ! empty( $param['multi_device']) ) {
856 - $has_multi_device = 'multi-device=true';
866 + $has_multi_device = '';
867 + if ( ! empty( $param['multi_device'] ) ) {
868 + $has_multi_device = 'multi-device=true';
869 + $this->get_device_options();
870 + }
857 871
858 - $html .= $this->get_device_options();
859 - }
872 + $class = '';
873 + if ( ! empty( $param['class'] ) ) {
874 + $class = $param['class'];
875 + }
860 876
861 - $class = '';
862 - if ( ! empty( $param['class'] ) ) {
863 - $class = $param['class'];
864 - }
877 + $icon_value = '';
878 + $is_icon_set = 'false';
879 + if ( ! empty( $param['value'] ) ) {
880 + $icon_value = $param['value'];
881 + $is_icon_set = 'true';
882 + }
883 + ?>
884 + <input type="hidden" placeholder="fa fa-icon" id="<?php echo esc_attr( $param['id'] ); ?>" name="<?php echo esc_attr( $param['name'] ); ?>" <?php echo esc_attr( $has_multi_device ); ?> class="rmp-icon-hidden-input <?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr( $icon_value ); ?>"><div class="rmp-icon-picker <?php echo esc_attr( $param['picker_class'] . $is_disabled ); ?>" for="<?php echo esc_attr( $param['id'] ); ?>" id="<?php echo esc_attr( $param['picker_id'] ); ?>" data-icon="<?php echo esc_attr( $is_icon_set ); ?>">
885 + <div class="rmp-icon-picker-placeholder">
886 + <span>
887 + <?php
888 + $svg_placeholder = $wp_filesystem->get_contents( RMP_PLUGIN_PATH_V4 . '/assets/admin/icons/svg/image-placeholder.svg' );
889 + if ( $svg_placeholder ) {
890 + echo wp_kses( $svg_placeholder, rmp_allow_svg_html_tags() );
891 + }
892 + ?>
893 + </span>
894 + <label> Choose Icon</label>
895 + </div>
896 + <?php
897 + echo wp_kses( $icon_value, rmp_allow_svg_html_tags() );
898 + if ( ! empty( $param['value'] ) ) {
899 + ?>
900 + <i class="rmp-icon-picker-trash dashicons dashicons-trash" aria-hidden="true"></i>
901 + <?php
902 + }
903 + ?>
904 + </div>
905 + </div></div>
906 + <?php
865 907
866 - $icon_value = '';
867 - $trash_icon = '';
868 - $is_icon_set = "false";
869 - if( ! empty( $param['value'] ) ) {
870 - $icon_value = $param['value'];
871 - $trash_icon = '<i class="rmp-icon-picker-trash dashicons dashicons-trash" aria-hidden="true"></i>';
872 - $is_icon_set = "true";
873 - }
874 -
875 - $html .= sprintf( '<input type="hidden" placeholder="fa fa-icon" id="%s" name="%s" %s class="rmp-icon-hidden-input %s" value="%s">',
876 - esc_attr( $param['id'] ),
877 - esc_attr( $param['name'] ),
878 - esc_attr( $has_multi_device ),
879 - esc_attr( $class ),
880 - esc_attr( $icon_value )
881 - );
882 -
883 - $html .= sprintf(
884 - '<div class="rmp-icon-picker %s" for="%s" id="%s" data-icon="%s">
885 - <div class="rmp-icon-picker-placeholder">
886 - <span> %s </span>
887 - <label> Choose Icon</label>
888 - </div>
889 - %s
890 - %s
891 - </div>',
892 - esc_attr( $param['picker_class'] . $is_disabled ),
893 - esc_attr( $param['id'] ),
894 - esc_attr( $param['picker_id'] ),
895 - esc_attr( $is_icon_set ),
896 - file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/image-placeholder.svg' ),
897 - $icon_value,
898 - $trash_icon
899 - );
900 -
901 - $html .= '</div></div>';
902 -
903 908 /**
904 909 * Filters the icon picker control html.
905 910 *
906 911 * @version 4.0.0
907 - *
912 + *
908 913 * @param HTML|string Input control contents.
909 914 * @param array $param List of attribute.
910 915 */
911 - $html = apply_filters( 'rmp_icon_picker_control_html', $html, $param);
912 -
913 - // Check if echo parameter is empty or false.
914 - if ( empty( $param['echo'] ) ) {
915 - return $html;
916 - }
917 -
918 - echo $html;
916 + echo apply_filters( 'rmp_icon_picker_control_html', '', $param );
919 917 }
920 918
921 919 /**
922 920 * This function prepare the image input control.
923 - *
921 + *
924 922 * @version 4.0.0
925 923 * @param array $param List of attributes for a input control
926 - *
924 + *
927 925 * @return HTML
928 926 */
929 - public function add_image_control( $param ) {
927 + public function add_image_control( $param ) {
928 + if ( empty( $param ) ) {
929 + return;
930 + }
931 + global $wp_filesystem;
932 + if ( empty( $wp_filesystem ) ) {
933 + require_once ABSPATH . 'wp-admin/includes/file.php';
934 + }
935 + WP_Filesystem();
936 + $group_classes = '';
930 937
931 - if ( empty( $param) ) {
932 - return;
933 - }
938 + if ( ! empty( $param['group_classes'] ) ) {
939 + $group_classes = $param['group_classes'];
940 + }
941 + ?>
942 + <div class="rmp-input-control-wrapper <?php echo esc_attr( $group_classes ); ?>">
943 + <?php
934 944
935 - $group_classes = '';
945 + // Check label is exist.
946 + if ( ! empty( $param['label'] ) ) {
947 + ?>
948 + <div class="rmp-input-control-label"> <span> <?php echo esc_html( $param['label'] ); ?> </span>
949 + <?php
950 + // Check tooltip text is added or not.
951 + if ( ! empty( $param['tool_tip'] ) ) {
952 + $this->get_tool_tip( $param['tool_tip'] );
953 + }
954 + ?>
955 + </div>
956 + <?php
957 + }
958 + ?>
959 + <div class="rmp-input-control rmp-image-picker-container">
960 + <?php
936 961
937 - if ( ! empty( $param['group_classes'] ) ) {
938 - $group_classes = $param['group_classes'];
939 - }
940 -
941 - $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
942 -
943 - //Check tooltip text is added or not.
944 - $tool_tip = '';
945 - if ( ! empty( $param['tool_tip'] ) ) {
946 - $tool_tip = $this->get_tool_tip( $param['tool_tip'] );
947 - }
948 -
949 - // Check label is exist.
950 - if ( ! empty( $param['label'] ) ) {
951 - $html .= sprintf('<div class="rmp-input-control-label"> <span> %s </span> %s </div>', esc_html( $param['label'] ), $tool_tip );
952 - }
953 -
954 - $html .= '<div class="rmp-input-control rmp-image-picker-container">';
955 -
956 962 // Check multi device option is enabled.
957 - $has_multi_device = '';
958 - if ( ! empty( $param['multi_device']) ) {
959 - $has_multi_device = 'multi-device=true';
960 - $html .= $this->get_device_options();
961 - }
963 + $has_multi_device = '';
964 + if ( ! empty( $param['multi_device'] ) ) {
965 + $has_multi_device = 'multi-device=true';
966 + $this->get_device_options();
967 + }
962 968
963 - $class = '';
964 - if ( ! empty( $param['class'] ) ) {
965 - $class = $param['class'];
966 - }
969 + $class = '';
970 + if ( ! empty( $param['class'] ) ) {
971 + $class = $param['class'];
972 + }
967 973
968 - $image_url = '';
969 - $trash_icon = '';
970 - $image_style = '';
971 - if ( ! empty( $param['value'] ) ) {
972 - $image_url = $param['value'];
973 - $trash_icon = '<i class="rmp-image-picker-trash dashicons dashicons-trash" aria-hidden="true"></i>';
974 - $image_style = sprintf('style="background-image: url(%s);"', $image_url );
975 - }
974 + $image_url = '';
975 + if ( ! empty( $param['value'] ) ) {
976 + $image_url = $param['value'];
977 + }
978 + ?>
979 + <input type="hidden" id="<?php echo esc_attr( $param['id'] ); ?>" name="<?php echo esc_attr( $param['name'] ); ?>" <?php echo esc_attr( $has_multi_device ); ?> class="rmp-image-url-input <?php echo esc_attr( $class ); ?>" value="<?php echo esc_url( $image_url ); ?>"><div class="rmp-image-picker <?php echo esc_attr( $param['picker_class'] ); ?>" for="<?php echo esc_attr( $param['id'] ); ?>" id="<?php echo esc_attr( $param['picker_id'] ); ?>"
980 + <?php
981 + if ( ! empty( $param['value'] ) ) {
982 + echo 'style="background-image: url(' . esc_url( $image_url ) . ');"';
983 + }
984 + ?>
985 + >
986 + <div class="rmp-image-picker-placeholder">
987 + <span>
988 + <?php
989 + $svg_placeholder = $wp_filesystem->get_contents( RMP_PLUGIN_PATH_V4 . '/assets/admin/icons/svg/image-placeholder.svg' );
990 + if ( $svg_placeholder ) {
991 + echo wp_kses( $svg_placeholder, rmp_allow_svg_html_tags() );
992 + }
993 + ?>
994 + </span>
995 + <label> Choose Image</label>
996 + </div>
997 + <?php
998 + if ( ! empty( $param['value'] ) ) {
999 + ?>
1000 + <i class="rmp-image-picker-trash dashicons dashicons-trash" aria-hidden="true"></i>
1001 + <?php
1002 + }
1003 + ?>
1004 + </div>
1005 + </div></div>
1006 + <?php
976 1007
977 - $html .= sprintf( '<input type="hidden" id="%s" name="%s" %s class="rmp-image-url-input %s" value="%s">',
978 - esc_attr( $param['id'] ),
979 - esc_attr( $param['name'] ),
980 - esc_attr( $has_multi_device ),
981 - esc_attr( $class ),
982 - esc_url( $image_url )
983 - );
984 -
985 - $html .= sprintf(
986 - '<div class="rmp-image-picker %s" for="%s" id="%s" %s>
987 - <div class="rmp-image-picker-placeholder">
988 - <span> %s </span>
989 - <label> Choose Image</label>
990 - </div>
991 - %s
992 - </div>',
993 - esc_attr( $param['picker_class'] ),
994 - esc_attr( $param['id'] ),
995 - esc_attr( $param['picker_id'] ),
996 - $image_style,
997 - file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/image-placeholder.svg' ),
998 - $trash_icon
999 - );
1000 -
1001 - $html .= '</div></div>';
1002 -
1003 1008 /**
1004 1009 * Filters the icon picker control html.
1005 1010 *
1006 1011 * @version 4.0.0
1007 - *
1012 + *
1008 1013 * @param HTML|string Input control contents.
1009 1014 * @param array $param List of attribute.
1010 1015 */
1011 - $html = apply_filters( 'rmp_add_image_control_html', $html, $param );
1016 + echo apply_filters( 'rmp_add_image_control_html', '', $param );
1017 + }
1012 1018
1013 - // Check if echo parameter is empty or false.
1014 - if ( empty( $param['echo'] ) ) {
1015 - return $html;
1016 - }
1017 -
1018 - echo $html;
1019 - }
1020 -
1021 1019 /**
1022 1020 * This function prepare the alignment control.
1023 - *
1021 + *
1024 1022 * @version 4.0.0
1025 1023 * @param array $param List of attributes for a input control
1026 - *
1024 + *
1027 1025 * @return HTML
1028 1026 */
1029 - public function add_text_alignment_control( $param ) {
1027 + public function add_text_alignment_control( $param ) {
1028 + if ( empty( $param ) ) {
1029 + return;
1030 + }
1030 1031
1031 - if ( empty( $param) ) {
1032 - return;
1033 - }
1032 + $group_classes = '';
1034 1033
1035 - $group_classes = '';
1034 + if ( ! empty( $param['group_classes'] ) ) {
1035 + $group_classes = $param['group_classes'];
1036 + }
1037 + ?>
1038 + <div class="rmp-input-control-wrapper <?php echo esc_attr( $group_classes ); ?>">
1039 + <?php
1036 1040
1037 - if ( ! empty( $param['group_classes'] ) ) {
1038 - $group_classes = $param['group_classes'];
1039 - }
1041 + // Check label is exist.
1042 + if ( ! empty( $param['label'] ) ) {
1043 + ?>
1044 + <div class="rmp-input-control-label"> <span> <?php echo esc_html( $param['label'] ); ?> </span>
1045 + <?php
1046 + // Check tooltip text is added or not.
1047 + if ( ! empty( $param['tool_tip'] ) ) {
1048 + $this->get_tool_tip( $param['tool_tip'] );
1049 + }
1050 + ?>
1051 + </div>
1052 + <?php
1053 + }
1054 + ?>
1055 + <div class="rmp-input-control">
1056 + <?php
1040 1057
1041 - $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
1042 -
1043 - //Check tooltip text is added or not.
1044 - $tool_tip = '';
1045 - if ( ! empty( $param['tool_tip'] ) ) {
1046 - $tool_tip = $this->get_tool_tip( $param['tool_tip'] );
1047 - }
1048 -
1049 - // Check label is exist.
1050 - if ( ! empty( $param['label'] ) ) {
1051 - $html .= sprintf('<div class="rmp-input-control-label"> <span> %s </span> %s </div>', esc_html( $param['label'] ), $tool_tip );
1052 - }
1053 -
1054 - $html .= '<div class="rmp-input-control">';
1055 -
1056 1058 // Check multiple device options is enabled.
1057 - $has_multi_device = '';
1058 - if ( ! empty( $param['multi_device']) ) {
1059 - $has_multi_device = 'multi-device=true';
1059 + $has_multi_device = '';
1060 + if ( ! empty( $param['multi_device'] ) ) {
1061 + $has_multi_device = 'multi-device=true';
1062 + $this->get_device_options();
1063 + }
1060 1064
1061 - $html .= $this->get_device_options();
1062 - }
1065 + $class = '';
1066 + if ( ! empty( $param['class'] ) ) {
1067 + $class = $param['class'];
1068 + }
1069 + ?>
1070 + <div class="align-icons-group">
1071 + <?php
1072 + foreach ( $param['options'] as $value ) {
1073 + $is_checked = '';
1074 + if ( $param['value'] == $value ) {
1075 + $is_checked = 'checked';
1076 + }
1077 + ?>
1078 + <input id="<?php echo esc_attr( $class . '-' . $value ); ?>" type="radio" name="<?php echo esc_attr( $param['name'] ); ?>" <?php echo esc_attr( $has_multi_device ); ?> class="no-updates <?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php echo esc_attr( $is_checked ); ?> >
1079 + <label for="<?php echo esc_attr( $class . '-' . $value ); ?>">
1080 + <?php
1081 + if ( 'left' == $value ) {
1082 + ?>
1083 + <span class="dashicons dashicons-editor-alignleft"></span>
1084 + <?php
1085 + } elseif ( 'justify' == $value ) {
1086 + ?>
1087 + <span class="dashicons dashicons-editor-justify"></span>
1088 + <?php
1089 + } elseif ( 'right' == $value ) {
1090 + ?>
1091 + <span class="dashicons dashicons-editor-alignright "></span>
1092 + <?php
1093 + } elseif ( 'center' == $value ) {
1094 + ?>
1095 + <span class="dashicons dashicons-editor-aligncenter "></span>
1096 + <?php
1097 + }
1098 + ?>
1099 + </label>
1100 + <?php
1101 + }
1102 + ?>
1103 + </div>
1104 + </div></div>
1105 + <?php
1063 1106
1064 - $class = '';
1065 - if ( ! empty( $param['class'] ) ) {
1066 - $class = $param['class'];
1067 - }
1068 -
1069 - $options = '';
1070 - foreach( $param['options'] as $value ) {
1071 - $is_checked = '';
1072 - if ( $param['value'] == $value ) {
1073 - $is_checked = 'checked';
1074 - }
1075 -
1076 - $id = esc_attr( $class ) . '-' . $value;
1077 - $icon = '';
1078 - if ( 'left' == $value ) {
1079 - $icon = '<span class="dashicons dashicons-editor-alignleft"></span>';
1080 - } else if( 'justify' == $value ) {
1081 - $icon = '<span class="dashicons dashicons-editor-justify"></span>';
1082 - } else if( 'right' == $value ) {
1083 - $icon = '<span class="dashicons dashicons-editor-alignright "></span>';
1084 - } else if( 'center' == $value ) {
1085 - $icon = '<span class="dashicons dashicons-editor-aligncenter "></span>';
1086 - }
1087 -
1088 - $options .= sprintf(
1089 - '<input id="%s" type="radio" name="%s" %s class="no-updates %s" value="%s" %s>
1090 - <label for="%s"> %s </label>',
1091 - esc_attr( $id ),
1092 - esc_attr( $param['name'] ),
1093 - esc_attr( $has_multi_device ),
1094 - esc_attr( $class ),
1095 - esc_attr( $value ),
1096 - esc_attr( $is_checked ),
1097 - esc_attr( $id ),
1098 - $icon
1099 - );
1100 - }
1101 -
1102 - $html .= sprintf( '<div class="align-icons-group"> %s </div>', $options );
1103 -
1104 - $html .= '</div></div>';
1105 -
1106 1107 /**
1107 1108 * Filters the icon picker control html.
1108 1109 *
1109 1110 * @version 4.0.0
1110 - *
1111 + *
1111 1112 * @param HTML|string Input control contents.
1112 1113 * @param array $param List of attribute.
1113 1114 */
1114 - $html = apply_filters( 'rmp_add_text_alignment_control_html', $html, $param );
1115 -
1116 - // Check if echo parameter is empty or false.
1117 - if ( empty( $param['echo'] ) ) {
1118 - return $html;
1119 - }
1115 + echo apply_filters( 'rmp_add_text_alignment_control_html', '', $param );
1116 + }
1120 1117
1121 - echo $html;
1122 - }
1123 -
1124 - /**
1125 - * Function to prepare the device visibility control,
1118 + /**
1119 + * Function to prepare the device visibility control,
1126 1120 * those are mobile, tablet and desktop as options.
1127 - *
1121 + *
1128 1122 * @version 4.0.0
1129 - *
1123 + *
1130 1124 * @param array $options list of values.
1131 - *
1132 - * @return HTML
1133 - */
1134 - public function add_device_visibility_control( $options ) {
1125 + *
1126 + * @return HTML
1127 + */
1128 + public function add_device_visibility_control( $options ) {
1129 + ?>
1130 + <div class="rmp-input-control-wrapper full-size">
1131 + <label class="rmp-input-control-label">
1132 + <?php esc_html_e( 'Device Visibility', 'responsive-menu' ); ?>
1133 + <a target="_blank" rel="noopener" class="upgrade-tooltip" href="<?php echo esc_url( $this->pro_plugin_url ); ?>" > <?php esc_html_e( 'PRO', 'responsive-menu' ); ?> </a>
1134 + </label>
1135 + <div class="rmp-input-control">
1136 + <div class="device-icons-group">
1137 + <div class="device-icon">
1138 + <input type="hidden" name="menu[use_mobile_menu]" value="on"/>
1139 + <input disabled checked class="rmp-menu-display-device checkbox mobile" type="checkbox"/>
1140 + <label for="rmp-menu-display-device-mobile" title="mobile" >
1141 + <span class="corner-icon">
1142 + <i class="fas fa-check-circle" aria-hidden="true"></i>
1143 + </span>
1144 + <span class="device">
1145 + <svg width="15" height="20" viewBox="0 0 15 20" fill="none" xmlns="http://www.w3.org/2000/svg">
1146 + <path d="M7.5 5.625C7.5 5.625 7.49251 5.625 7.47754 5.625C7.28288 5.625 7.10319 5.57259 6.93848 5.46777C6.78874 5.34798 6.68392 5.20573 6.62402 5.04102C6.59408 4.98112 6.57161 4.92122 6.55664 4.86133C6.54167 4.80143 6.53418 4.74154 6.53418 4.68164C6.53418 4.68164 6.53418 4.67415 6.53418 4.65918C6.53418 4.62923 6.53418 4.59928 6.53418 4.56934C6.54915 4.53939 6.55664 4.50195 6.55664 4.45703V4.47949C6.57161 4.44954 6.5791 4.4196 6.5791 4.38965C6.59408 4.3597 6.60905 4.32975 6.62402 4.2998C6.639 4.26986 6.64648 4.23991 6.64648 4.20996C6.66146 4.18001 6.68392 4.15007 6.71387 4.12012C6.72884 4.10514 6.74382 4.08268 6.75879 4.05273C6.77376 4.02279 6.79622 4.00033 6.82617 3.98535C6.90104 3.89551 6.99837 3.82812 7.11816 3.7832C7.23796 3.73828 7.36523 3.71582 7.5 3.71582C7.52995 3.71582 7.5599 3.71582 7.58984 3.71582C7.61979 3.71582 7.64974 3.72331 7.67969 3.73828C7.70964 3.73828 7.73958 3.74577 7.76953 3.76074C7.81445 3.76074 7.8444 3.76823 7.85938 3.7832C7.88932 3.79818 7.91927 3.81315 7.94922 3.82812C7.97917 3.8431 8.00911 3.85807 8.03906 3.87305C8.06901 3.88802 8.09147 3.91048 8.10645 3.94043C8.13639 3.9554 8.15885 3.97038 8.17383 3.98535C8.20378 4.00033 8.22624 4.02279 8.24121 4.05273C8.25618 4.08268 8.27116 4.10514 8.28613 4.12012C8.31608 4.15007 8.33105 4.18001 8.33105 4.20996C8.34603 4.23991 8.361 4.26986 8.37598 4.2998C8.39095 4.32975 8.39844 4.3597 8.39844 4.38965C8.41341 4.4196 8.42839 4.44954 8.44336 4.47949C8.44336 4.50944 8.44336 4.53939 8.44336 4.56934C8.45833 4.59928 8.46582 4.62923 8.46582 4.65918C8.46582 4.73405 8.45833 4.80143 8.44336 4.86133C8.42839 4.92122 8.40592 4.98112 8.37598 5.04102C8.361 5.10091 8.33105 5.16081 8.28613 5.2207C8.25618 5.26562 8.21875 5.31055 8.17383 5.35547C8.08398 5.43034 7.97917 5.49772 7.85938 5.55762C7.75456 5.60254 7.63477 5.625 7.5 5.625ZM9.40918 16.1592C9.40918 15.9046 9.31185 15.6875 9.11719 15.5078C8.9375 15.3132 8.72038 15.2158 8.46582 15.2158H6.53418C6.27962 15.2158 6.05501 15.3132 5.86035 15.5078C5.68066 15.6875 5.59082 15.9046 5.59082 16.1592C5.59082 16.4287 5.68066 16.6608 5.86035 16.8555C6.05501 17.0352 6.27962 17.125 6.53418 17.125H8.46582C8.72038 17.125 8.9375 17.0352 9.11719 16.8555C9.31185 16.6608 9.40918 16.4287 9.40918 16.1592ZM14.2158 16.6533V4.1875C14.2158 3.25911 13.8864 2.47298 13.2275 1.8291C12.5687 1.17025 11.7751 0.84082 10.8467 0.84082H4.15332C3.22493 0.84082 2.43132 1.17025 1.77246 1.8291C1.11361 2.47298 0.78418 3.25911 0.78418 4.1875V16.6533C0.78418 17.5667 1.11361 18.3529 1.77246 19.0117C2.43132 19.6706 3.22493 20 4.15332 20H10.8467C11.7751 20 12.5687 19.6706 13.2275 19.0117C13.8864 18.3529 14.2158 17.5667 14.2158 16.6533ZM10.8467 2.75C11.251 2.75 11.5879 2.89225 11.8574 3.17676C12.1419 3.46126 12.2842 3.79818 12.2842 4.1875V16.6533C12.2842 17.0426 12.1419 17.3796 11.8574 17.6641C11.5879 17.9486 11.251 18.0908 10.8467 18.0908H4.15332C3.74902 18.0908 3.40462 17.9486 3.12012 17.6641C2.85059 17.3796 2.71582 17.0426 2.71582 16.6533V4.1875C2.71582 3.79818 2.85059 3.46126 3.12012 3.17676C3.40462 2.89225 3.74902 2.75 4.15332 2.75H10.8467Z" fill="#56606D"/>
1147 + </svg>
1148 + </span>
1149 + </label>
1150 + <span class="rmp-input-control-label device-title"> <?php esc_html_e( 'Mobile', 'responsive-menu' ); ?> </span>
1151 + </div>
1152 + <div class="device-icon">
1153 + <input type="hidden" name="menu[use_tablet_menu]" value="on"/>
1154 + <input type="hidden" name="menu[use_tablet_menu]" value="on"/>
1155 + <input disabled checked class="rmp-menu-display-device checkbox tablet" type="checkbox"/>
1156 + <label for="rmp-menu-display-device-tablet" title="tablet" >
1157 + <span class="corner-icon">
1158 + <i class="fas fa-check-circle" aria-hidden="true"></i>
1159 + </span>
1160 + <span class="device">
1161 + <svg width="16" height="19" viewBox="0 0 16 19" fill="none" xmlns="http://www.w3.org/2000/svg">
1162 + <path d="M12.125 19H3.875C2.98698 19 2.22786 18.6849 1.59766 18.0547C0.981771 17.4245 0.673828 16.6725 0.673828 15.7988V3.875C0.673828 2.98698 0.981771 2.23503 1.59766 1.61914C2.22786 0.988932 2.98698 0.673828 3.875 0.673828H12.125C13.013 0.673828 13.765 0.988932 14.3809 1.61914C15.0111 2.23503 15.3262 2.98698 15.3262 3.875V15.7988C15.3262 16.6725 15.0111 17.4245 14.3809 18.0547C13.765 18.6849 13.013 19 12.125 19ZM3.875 2.5C3.5026 2.5 3.18034 2.63607 2.9082 2.9082C2.63607 3.18034 2.5 3.5026 2.5 3.875V15.7988C2.5 16.1712 2.63607 16.4935 2.9082 16.7656C3.18034 17.0378 3.5026 17.1738 3.875 17.1738H12.125C12.4974 17.1738 12.8197 17.0378 13.0918 16.7656C13.3639 16.4935 13.5 16.1712 13.5 15.7988V3.875C13.5 3.5026 13.3639 3.18034 13.0918 2.9082C12.8197 2.63607 12.4974 2.5 12.125 2.5H3.875ZM8.64453 15.9922C8.73047 15.9062 8.79492 15.806 8.83789 15.6914C8.89518 15.5768 8.92383 15.4622 8.92383 15.3477C8.92383 15.3333 8.92383 15.3262 8.92383 15.3262C8.92383 15.0827 8.83073 14.875 8.64453 14.7031C8.47266 14.5169 8.25781 14.4238 8 14.4238C7.74219 14.4238 7.52018 14.5169 7.33398 14.7031C7.16211 14.875 7.07617 15.0827 7.07617 15.3262C7.07617 15.584 7.16211 15.806 7.33398 15.9922C7.52018 16.1641 7.74219 16.25 8 16.25C8.12891 16.25 8.24349 16.2285 8.34375 16.1855C8.45833 16.1283 8.55859 16.0638 8.64453 15.9922Z" fill="#56606D"/>
1163 + </svg>
1164 + </span>
1165 + </label>
1166 + <span class="rmp-input-control-label device-title"> <?php esc_html_e( 'Tablet', 'responsive-menu' ); ?> </span>
1167 + </div>
1168 + <div class="device-icon">
1169 + <input type="hidden" name="menu[use_desktop_menu]" value="off"/>
1170 + <input disabled class="rmp-menu-display-device checkbox desktop" type="checkbox" />
1171 + <label for="rmp-menu-display-device-desktop" title="desktop" >
1172 + <span class="corner-icon">
1173 + <i class="fas fa-check-circle" aria-hidden="true"></i>
1174 + </span>
1175 + <span class="device">
1176 + <svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
1177 + <path d="M15.9512 0.673828H4.04883C3.16081 0.673828 2.40169 0.988932 1.77148 1.61914C1.14128 2.23503 0.826172 2.98698 0.826172 3.875V12.125C0.826172 13.013 1.14128 13.7721 1.77148 14.4023C2.40169 15.0182 3.16081 15.3262 4.04883 15.3262H9.07617V17.1738H6.32617C6.08268 17.1738 5.86784 17.2669 5.68164 17.4531C5.50977 17.625 5.42383 17.8327 5.42383 18.0762C5.42383 18.334 5.50977 18.556 5.68164 18.7422C5.86784 18.9141 6.08268 19 6.32617 19H13.6738C13.9173 19 14.125 18.9141 14.2969 18.7422C14.4831 18.556 14.5762 18.334 14.5762 18.0762C14.5762 17.8327 14.4831 17.625 14.2969 17.4531C14.125 17.2669 13.9173 17.1738 13.6738 17.1738H10.9238V15.3262H15.9512C16.8392 15.3262 17.5983 15.0182 18.2285 14.4023C18.8587 13.7721 19.1738 13.013 19.1738 12.125V3.875C19.1738 2.98698 18.8587 2.23503 18.2285 1.61914C17.5983 0.988932 16.8392 0.673828 15.9512 0.673828ZM17.3262 12.125C17.3262 12.4974 17.1901 12.8197 16.918 13.0918C16.6602 13.3639 16.3379 13.5 15.9512 13.5H4.04883C3.66211 13.5 3.33268 13.3639 3.06055 13.0918C2.80273 12.8197 2.67383 12.4974 2.67383 12.125V3.875C2.67383 3.5026 2.80273 3.18034 3.06055 2.9082C3.33268 2.63607 3.66211 2.5 4.04883 2.5H15.9512C16.3379 2.5 16.6602 2.63607 16.918 2.9082C17.1901 3.18034 17.3262 3.5026 17.3262 3.875V12.125ZM7.76562 3.83203C7.83724 3.90365 7.88737 3.98242 7.91602 4.06836C7.95898 4.13997 7.98047 4.22591 7.98047 4.32617C7.98047 4.42643 7.95898 4.51953 7.91602 4.60547C7.88737 4.67708 7.83724 4.7487 7.76562 4.82031L5.01562 7.57031C4.95833 7.6276 4.88672 7.67057 4.80078 7.69922C4.72917 7.72786 4.64323 7.74219 4.54297 7.74219C4.35677 7.74219 4.19206 7.67773 4.04883 7.54883C3.91992 7.41992 3.85547 7.25521 3.85547 7.05469C3.85547 6.96875 3.86979 6.88997 3.89844 6.81836C3.94141 6.73242 3.99154 6.65365 4.04883 6.58203L6.79883 3.83203C6.85612 3.77474 6.92773 3.73177 7.01367 3.70312C7.09961 3.66016 7.19271 3.63867 7.29297 3.63867C7.37891 3.63867 7.46484 3.66016 7.55078 3.70312C7.63672 3.73177 7.70833 3.77474 7.76562 3.83203Z" fill="white"/>
1178 + </svg>
1179 + </span>
1180 + </label>
1181 + <span class="rmp-input-control-label device-title"> <?php esc_html_e( 'Desktop', 'responsive-menu' ); ?> </span>
1182 + </div>
1183 + </div>
1184 + </div>
1185 + </div>
1186 + <?php
1187 + }
1135 1188
1136 - $mobile = sprintf(
1137 - '<div class="device-icon">
1138 - <input type="hidden" name="menu[use_mobile_menu]" value="on"/>
1139 - <input disabled class="rmp-menu-display-device checkbox mobile" type="checkbox"/>
1140 - <label for="rmp-menu-display-device-mobile" title="mobile" >
1141 - <span class="corner-icon">
1142 - <i class="fas fa-check-circle" aria-hidden="true"></i>
1143 - </span>
1144 - <span class="device">
1145 - <svg width="15" height="20" viewBox="0 0 15 20" fill="none" xmlns="http://www.w3.org/2000/svg">
1146 - <path d="M7.5 5.625C7.5 5.625 7.49251 5.625 7.47754 5.625C7.28288 5.625 7.10319 5.57259 6.93848 5.46777C6.78874 5.34798 6.68392 5.20573 6.62402 5.04102C6.59408 4.98112 6.57161 4.92122 6.55664 4.86133C6.54167 4.80143 6.53418 4.74154 6.53418 4.68164C6.53418 4.68164 6.53418 4.67415 6.53418 4.65918C6.53418 4.62923 6.53418 4.59928 6.53418 4.56934C6.54915 4.53939 6.55664 4.50195 6.55664 4.45703V4.47949C6.57161 4.44954 6.5791 4.4196 6.5791 4.38965C6.59408 4.3597 6.60905 4.32975 6.62402 4.2998C6.639 4.26986 6.64648 4.23991 6.64648 4.20996C6.66146 4.18001 6.68392 4.15007 6.71387 4.12012C6.72884 4.10514 6.74382 4.08268 6.75879 4.05273C6.77376 4.02279 6.79622 4.00033 6.82617 3.98535C6.90104 3.89551 6.99837 3.82812 7.11816 3.7832C7.23796 3.73828 7.36523 3.71582 7.5 3.71582C7.52995 3.71582 7.5599 3.71582 7.58984 3.71582C7.61979 3.71582 7.64974 3.72331 7.67969 3.73828C7.70964 3.73828 7.73958 3.74577 7.76953 3.76074C7.81445 3.76074 7.8444 3.76823 7.85938 3.7832C7.88932 3.79818 7.91927 3.81315 7.94922 3.82812C7.97917 3.8431 8.00911 3.85807 8.03906 3.87305C8.06901 3.88802 8.09147 3.91048 8.10645 3.94043C8.13639 3.9554 8.15885 3.97038 8.17383 3.98535C8.20378 4.00033 8.22624 4.02279 8.24121 4.05273C8.25618 4.08268 8.27116 4.10514 8.28613 4.12012C8.31608 4.15007 8.33105 4.18001 8.33105 4.20996C8.34603 4.23991 8.361 4.26986 8.37598 4.2998C8.39095 4.32975 8.39844 4.3597 8.39844 4.38965C8.41341 4.4196 8.42839 4.44954 8.44336 4.47949C8.44336 4.50944 8.44336 4.53939 8.44336 4.56934C8.45833 4.59928 8.46582 4.62923 8.46582 4.65918C8.46582 4.73405 8.45833 4.80143 8.44336 4.86133C8.42839 4.92122 8.40592 4.98112 8.37598 5.04102C8.361 5.10091 8.33105 5.16081 8.28613 5.2207C8.25618 5.26562 8.21875 5.31055 8.17383 5.35547C8.08398 5.43034 7.97917 5.49772 7.85938 5.55762C7.75456 5.60254 7.63477 5.625 7.5 5.625ZM9.40918 16.1592C9.40918 15.9046 9.31185 15.6875 9.11719 15.5078C8.9375 15.3132 8.72038 15.2158 8.46582 15.2158H6.53418C6.27962 15.2158 6.05501 15.3132 5.86035 15.5078C5.68066 15.6875 5.59082 15.9046 5.59082 16.1592C5.59082 16.4287 5.68066 16.6608 5.86035 16.8555C6.05501 17.0352 6.27962 17.125 6.53418 17.125H8.46582C8.72038 17.125 8.9375 17.0352 9.11719 16.8555C9.31185 16.6608 9.40918 16.4287 9.40918 16.1592ZM14.2158 16.6533V4.1875C14.2158 3.25911 13.8864 2.47298 13.2275 1.8291C12.5687 1.17025 11.7751 0.84082 10.8467 0.84082H4.15332C3.22493 0.84082 2.43132 1.17025 1.77246 1.8291C1.11361 2.47298 0.78418 3.25911 0.78418 4.1875V16.6533C0.78418 17.5667 1.11361 18.3529 1.77246 19.0117C2.43132 19.6706 3.22493 20 4.15332 20H10.8467C11.7751 20 12.5687 19.6706 13.2275 19.0117C13.8864 18.3529 14.2158 17.5667 14.2158 16.6533ZM10.8467 2.75C11.251 2.75 11.5879 2.89225 11.8574 3.17676C12.1419 3.46126 12.2842 3.79818 12.2842 4.1875V16.6533C12.2842 17.0426 12.1419 17.3796 11.8574 17.6641C11.5879 17.9486 11.251 18.0908 10.8467 18.0908H4.15332C3.74902 18.0908 3.40462 17.9486 3.12012 17.6641C2.85059 17.3796 2.71582 17.0426 2.71582 16.6533V4.1875C2.71582 3.79818 2.85059 3.46126 3.12012 3.17676C3.40462 2.89225 3.74902 2.75 4.15332 2.75H10.8467Z" fill="#56606D"/>
1147 - </svg>
1148 - </span>
1149 - </label>
1150 - <span class="rmp-input-control-label device-title"> %s </span>
1151 - </div>',
1152 - __( 'Mobile', 'responsive-menu-pro' )
1153 - );
1154 -
1155 - $tablet = sprintf(
1156 - '<div class="device-icon">
1157 - <input type="hidden" name="menu[use_tablet_menu]" value="on"/>
1158 - <input type="hidden" name="menu[use_tablet_menu]" value="on"/>
1159 - <input disabled class="rmp-menu-display-device checkbox tablet" type="checkbox"/>
1160 - <label for="rmp-menu-display-device-tablet" title="tablet" >
1161 - <span class="corner-icon">
1162 - <i class="fas fa-check-circle" aria-hidden="true"></i>
1163 - </span>
1164 - <span class="device">
1165 - <svg width="16" height="19" viewBox="0 0 16 19" fill="none" xmlns="http://www.w3.org/2000/svg">
1166 - <path d="M12.125 19H3.875C2.98698 19 2.22786 18.6849 1.59766 18.0547C0.981771 17.4245 0.673828 16.6725 0.673828 15.7988V3.875C0.673828 2.98698 0.981771 2.23503 1.59766 1.61914C2.22786 0.988932 2.98698 0.673828 3.875 0.673828H12.125C13.013 0.673828 13.765 0.988932 14.3809 1.61914C15.0111 2.23503 15.3262 2.98698 15.3262 3.875V15.7988C15.3262 16.6725 15.0111 17.4245 14.3809 18.0547C13.765 18.6849 13.013 19 12.125 19ZM3.875 2.5C3.5026 2.5 3.18034 2.63607 2.9082 2.9082C2.63607 3.18034 2.5 3.5026 2.5 3.875V15.7988C2.5 16.1712 2.63607 16.4935 2.9082 16.7656C3.18034 17.0378 3.5026 17.1738 3.875 17.1738H12.125C12.4974 17.1738 12.8197 17.0378 13.0918 16.7656C13.3639 16.4935 13.5 16.1712 13.5 15.7988V3.875C13.5 3.5026 13.3639 3.18034 13.0918 2.9082C12.8197 2.63607 12.4974 2.5 12.125 2.5H3.875ZM8.64453 15.9922C8.73047 15.9062 8.79492 15.806 8.83789 15.6914C8.89518 15.5768 8.92383 15.4622 8.92383 15.3477C8.92383 15.3333 8.92383 15.3262 8.92383 15.3262C8.92383 15.0827 8.83073 14.875 8.64453 14.7031C8.47266 14.5169 8.25781 14.4238 8 14.4238C7.74219 14.4238 7.52018 14.5169 7.33398 14.7031C7.16211 14.875 7.07617 15.0827 7.07617 15.3262C7.07617 15.584 7.16211 15.806 7.33398 15.9922C7.52018 16.1641 7.74219 16.25 8 16.25C8.12891 16.25 8.24349 16.2285 8.34375 16.1855C8.45833 16.1283 8.55859 16.0638 8.64453 15.9922Z" fill="#56606D"/>
1167 - </svg>
1168 - </span>
1169 - </label>
1170 - <span class="rmp-input-control-label device-title"> %s </span>
1171 - </div>',
1172 - __( 'Tablet', 'responsive-menu-pro' )
1173 - );
1174 -
1175 - $desktop = sprintf(
1176 - '<div class="device-icon">
1177 - <input type="hidden" name="menu[use_desktop_menu]" value="off"/>
1178 - <input disabled class="rmp-menu-display-device checkbox desktop" type="checkbox" />
1179 - <label for="rmp-menu-display-device-desktop" title="desktop" >
1180 - <span class="corner-icon">
1181 - <i class="fas fa-check-circle" aria-hidden="true"></i>
1182 - </span>
1183 - <span class="device">
1184 - <svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
1185 - <path d="M15.9512 0.673828H4.04883C3.16081 0.673828 2.40169 0.988932 1.77148 1.61914C1.14128 2.23503 0.826172 2.98698 0.826172 3.875V12.125C0.826172 13.013 1.14128 13.7721 1.77148 14.4023C2.40169 15.0182 3.16081 15.3262 4.04883 15.3262H9.07617V17.1738H6.32617C6.08268 17.1738 5.86784 17.2669 5.68164 17.4531C5.50977 17.625 5.42383 17.8327 5.42383 18.0762C5.42383 18.334 5.50977 18.556 5.68164 18.7422C5.86784 18.9141 6.08268 19 6.32617 19H13.6738C13.9173 19 14.125 18.9141 14.2969 18.7422C14.4831 18.556 14.5762 18.334 14.5762 18.0762C14.5762 17.8327 14.4831 17.625 14.2969 17.4531C14.125 17.2669 13.9173 17.1738 13.6738 17.1738H10.9238V15.3262H15.9512C16.8392 15.3262 17.5983 15.0182 18.2285 14.4023C18.8587 13.7721 19.1738 13.013 19.1738 12.125V3.875C19.1738 2.98698 18.8587 2.23503 18.2285 1.61914C17.5983 0.988932 16.8392 0.673828 15.9512 0.673828ZM17.3262 12.125C17.3262 12.4974 17.1901 12.8197 16.918 13.0918C16.6602 13.3639 16.3379 13.5 15.9512 13.5H4.04883C3.66211 13.5 3.33268 13.3639 3.06055 13.0918C2.80273 12.8197 2.67383 12.4974 2.67383 12.125V3.875C2.67383 3.5026 2.80273 3.18034 3.06055 2.9082C3.33268 2.63607 3.66211 2.5 4.04883 2.5H15.9512C16.3379 2.5 16.6602 2.63607 16.918 2.9082C17.1901 3.18034 17.3262 3.5026 17.3262 3.875V12.125ZM7.76562 3.83203C7.83724 3.90365 7.88737 3.98242 7.91602 4.06836C7.95898 4.13997 7.98047 4.22591 7.98047 4.32617C7.98047 4.42643 7.95898 4.51953 7.91602 4.60547C7.88737 4.67708 7.83724 4.7487 7.76562 4.82031L5.01562 7.57031C4.95833 7.6276 4.88672 7.67057 4.80078 7.69922C4.72917 7.72786 4.64323 7.74219 4.54297 7.74219C4.35677 7.74219 4.19206 7.67773 4.04883 7.54883C3.91992 7.41992 3.85547 7.25521 3.85547 7.05469C3.85547 6.96875 3.86979 6.88997 3.89844 6.81836C3.94141 6.73242 3.99154 6.65365 4.04883 6.58203L6.79883 3.83203C6.85612 3.77474 6.92773 3.73177 7.01367 3.70312C7.09961 3.66016 7.19271 3.63867 7.29297 3.63867C7.37891 3.63867 7.46484 3.66016 7.55078 3.70312C7.63672 3.73177 7.70833 3.77474 7.76562 3.83203Z" fill="white"/>
1186 - </svg>
1187 - </span>
1188 - </label>
1189 - <span class="rmp-input-control-label device-title"> %s </span>
1190 - </div>',
1191 - __( 'Desktop', 'responsive-menu-pro' )
1192 - );
1193 -
1194 - $device_options = sprintf( '<div class="device-icons-group">%s %s %s</div>', $mobile, $tablet, $desktop );
1195 -
1196 - return sprintf(
1197 - '<div class="rmp-input-control-wrapper full-size">
1198 - <label class="rmp-input-control-label">
1199 - %s
1200 - <a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > PRO </a>
1201 - </label>
1202 - <div class="rmp-input-control">
1203 - %s
1204 - </div>
1205 - </div>',
1206 - __('Device Visibility', 'responsive-menu-pro'),
1207 - $device_options
1208 - );
1209 - }
1210 -
1211 1189 /**
1212 1190 * Function to return the device options markup.
1213 - *
1191 + *
1214 1192 * @version 4.0.0
1215 - *
1193 + *
1216 1194 * @return HTML
1217 1195 */
1218 1196 protected function get_device_options() {
1219 - return sprintf(
1220 - '<div class="rmp-device-switcher-holder">
1221 - <a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > PRO </a>
1222 - <ul class="select rmp-device-switcher" >
1223 - <li data-device="mobile">
1224 - %s
1225 - </li>
1226 - <li data-device="tablet">
1227 - %s
1228 - </li>
1229 - <li data-device="desktop">
1230 - %s
1231 - </li>
1232 - </ul>
1233 - </div>',
1234 - file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/mobile.svg' ),
1235 - file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/tablet.svg' ),
1236 - file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/desktop.svg' )
1237 - );
1238 - }
1197 + global $wp_filesystem;
1198 + if ( empty( $wp_filesystem ) ) {
1199 + require_once ABSPATH . 'wp-admin/includes/file.php';
1200 + }
1201 + WP_Filesystem();
1202 + ?>
1203 + <div class="rmp-device-switcher-holder">
1204 + <a target="_blank" rel="noopener" class="upgrade-tooltip" href="<?php echo esc_url( $this->pro_plugin_url ); ?>" > <?php esc_html_e( 'PRO', 'responsive-menu' ); ?> </a>
1205 + <ul class="select rmp-device-switcher" >
1206 + <li data-device="mobile">
1207 + <?php
1208 + $svg_mobile = $wp_filesystem->get_contents( RMP_PLUGIN_PATH_V4 . '/assets/admin/icons/svg/mobile.svg' );
1209 + if ( $svg_mobile ) {
1210 + echo wp_kses( $svg_mobile, rmp_allow_svg_html_tags() );
1211 + }
1212 + ?>
1213 + </li>
1214 + <li data-device="tablet">
1215 + <?php
1216 + $svg_tablet = $wp_filesystem->get_contents( RMP_PLUGIN_PATH_V4 . '/assets/admin/icons/svg/tablet.svg' );
1217 + if ( $svg_tablet ) {
1218 + echo wp_kses( $svg_tablet, rmp_allow_svg_html_tags() );
1219 + }
1220 + ?>
1221 + </li>
1222 + <li data-device="desktop">
1223 + <?php
1224 + $svg_desktop = $wp_filesystem->get_contents( RMP_PLUGIN_PATH_V4 . '/assets/admin/icons/svg/desktop.svg' );
1225 + if ( $svg_desktop ) {
1226 + echo wp_kses( $svg_desktop, rmp_allow_svg_html_tags() );
1227 + }
1228 + ?>
1229 + </li>
1230 + </ul>
1231 + </div>
1232 + <?php
1233 + }
1239 1234
1240 - public function add_sub_heading( $param ) {
1235 + public function add_sub_heading( $param ) {
1241 1236 if ( empty( $param['text'] ) ) {
1242 1237 return;
1243 1238 }
1239 + ?>
1240 + <div class="rmp-accordion-sub-heading">
1241 + <?php
1242 + echo esc_html( $param['text'] );
1243 + // Check tooltip text is added or not.
1244 + if ( ! empty( $param['tool_tip'] ) ) {
1245 + $this->get_tool_tip( $param['tool_tip'] );
1246 + }
1247 + ?>
1248 + </div>
1249 + <?php
1250 + }
1244 1251
1245 - //Check tooltip text is added or not.
1246 - $tool_tip = '';
1247 - if ( ! empty( $param['tool_tip'] ) ) {
1248 - $tool_tip = $this->get_tool_tip( $param['tool_tip'] );
1249 - }
1250 -
1251 - return sprintf (
1252 - '<div class="rmp-accordion-sub-heading"> %s %s</div>',
1253 - esc_html( $param['text'] ),
1254 - $tool_tip
1255 - );
1256 - }
1257 -
1258 - public function upgrade_notice() {
1259 - return sprintf(
1260 - '<div class="upgrade-options">
1261 - <div class="upgrade-notes">
1262 - <p> %s </p>
1263 - <a target="_blank" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" class="button"> %s </a>
1264 - </div>
1265 - </div>',
1266 - __('This feature is not available in free version. <br/> Upgrade now to use', 'responsive-menu-pro'),
1267 - esc_html__('Upgrade to Pro', 'responsive-menu-pro')
1268 - );
1269 - }
1270 -
1252 + public function upgrade_notice() {
1253 + ?>
1254 + <div class="upgrade-options">
1255 + <div class="upgrade-notes">
1256 + <p><?php echo esc_html_e( 'This feature is not available in free version. Upgrade now to use', 'responsive-menu' ); ?> </p>
1257 + <a target="_blank" rel="noopener" href="<?php echo esc_attr( $this->pro_plugin_url ); ?>" class="button"> <?php esc_html_e( 'Upgrade to Pro', 'responsive-menu' ); ?> </a>
1258 + </div>
1259 + </div>
1260 + <?php
1261 + }
1271 1262 }