PluginProbe
Responsive Menu – Mobile Menu & Hamburger Menu Builder / 4.7.4
Responsive Menu – Mobile Menu & Hamburger Menu Builder 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
responsive-menu / v4.0.0 / inc / classes / class-control-manager.php

class-control-manager.php in Responsive Menu – Mobile Menu & Hamburger Menu Builder 4.7.4, at v4.0.0/inc/classes/class-control-manager.php

1,263 lines 41.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Control_Manager class.
4 * This class prepare the input control and it's markup.
5 *
6 * @version 4.0.0
7 * @author Expresstech System
8 *
9 * @package responsive-menu
10 */
11
12 namespace RMP\Features\Inc;
13
14 use RMP\Features\Inc\Traits\Singleton;
15
16 // Disable the direct access to this class.
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit;
19 }
20
21 /**
22 * Class Control_Manager
23 */
24 class Control_Manager {
25
26 use Singleton;
27 public $pro_plugin_url = 'https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile';
28 /**
29 * Construct method.
30 */
31 protected function __construct() {
32 $this->setup_hooks();
33 }
34
35 /**
36 * To setup action/filter.
37 *
38 * @version 4.0.0
39 *
40 * @return void
41 */
42 protected function setup_hooks() {
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
57 }
58
59 /**
60 * This function prepare the single text input control.
61 *
62 * @version 4.0.0
63 * @param array $param List of attributes for a input control
64 *
65 * @return HTML
66 */
67 public function add_text_input_control( $param ) {
68 if ( empty( $param ) ) {
69 return;
70 }
71
72 /**
73 * Filters the text input control attributes before create.
74 *
75 * @version 4.0.0
76 * @param array $param List of attribute.
77 */
78 $param = apply_filters( 'rmp_before_add_text_input_control', $param );
79
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
88
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
119
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 }
126
127 // Place holder text.
128 $placeholder = '';
129 if ( ! empty( $param['placeholder'] ) ) {
130 $placeholder = $param['placeholder'];
131 }
132
133 // Check the input control type that maybe text,number or any other.
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 }
143
144 // Check the unit of the this control.
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
158
159 /**
160 * Filters the text input attributes/contents after prepared.
161 *
162 * @version 4.0.0
163 *
164 * @param HTML|string Input control contents.
165 * @param array $param List of attribute.
166 */
167 echo apply_filters( 'rmp_text_control_html', '', $param );
168 }
169
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 }
182
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);
245 }
246
247 /**
248 * This function prepare the group text input control.
249 *
250 * @version 4.0.0
251 * @param array $param List of attributes for a input control
252 *
253 * @return HTML
254 */
255 public function add_group_text_control( $param ) {
256 if ( empty( $param ) ) {
257 return;
258 }
259
260 /**
261 * Filters the text group input control attributes before create.
262 *
263 * @version 4.0.0
264 * @param array $param List of attribute.
265 */
266 $param = apply_filters( 'rmp_before_add_group_text_control', $param );
267
268 $group_classes = '';
269
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
276
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
293
294 // Check this input has multi device options.
295 $has_multi_device = '';
296 if ( ! empty( $param['multi_device'] ) ) {
297 $has_multi_device = 'multi-device=true';
298 $this->get_device_options();
299 }
300
301 // Check the input control type that maybe text,number or any other.
302 if ( ! empty( $param['type'] ) ) {
303 $class = '';
304 if ( ! empty( $param['class'] ) ) {
305 $class = $param['class'];
306 }
307
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 }
326
327 // Check the unit of the this control.
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
341
342 /**
343 * Filters the text input attributes/contents after prepared.
344 *
345 * @version 4.0.0
346 *
347 * @param HTML|string Input control contents.
348 * @param array $param List of attribute.
349 */
350 echo apply_filters( 'rmp_text_control_html', '', $param );
351 }
352
353 /**
354 * This function prepare input unit options.
355 *
356 * @version 4.0.0
357 * @param array $param List of attributes for a input control
358 *
359 * @return HTML
360 */
361 protected function get_input_control_unit( $param ) {
362 if ( empty( $param['name'] ) ) {
363 return;
364 }
365
366 $value = '';
367
368 if ( ! empty( $param['value'] ) ) {
369 $value = $param['value'];
370 }
371
372 $has_multi_device = 'false';
373 if ( ! empty( $param['multi_device'] ) ) {
374 $has_multi_device = 'true';
375 }
376
377 $unit_options = array( 'px', '%', 'em', 'rem', 'vw', 'vh' );
378
379 /**
380 * Filters the input units.
381 *
382 * @param array $unit_options List of units.
383 */
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 }
393
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 }
413
414 /**
415 * This function prepare the color control.
416 *
417 * @version 4.0.0
418 * @param array $param List of attributes for a input control
419 *
420 * @return HTML
421 */
422 public function add_color_control( $param ) {
423 if ( empty( $param ) ) {
424 return;
425 }
426
427 /**
428 * Filters the color input control attribute.
429 *
430 * @version 4.0.0
431 * @param array $param List of attribute.
432 */
433 $param = apply_filters( 'rmp_before_add_color_control', $param );
434
435 $group_classes = '';
436
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
443
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
460
461 // Check this input has multi device options.
462 $has_multi_device = '';
463 if ( ! empty( $param['multi_device'] ) ) {
464 $has_multi_device = 'multi-device=true';
465 $this->get_device_options();
466 }
467
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
475
476 /**
477 * Filters the color input control html.
478 *
479 * @version 4.0.0
480 * @param HTML|string Input control contents.
481 * @param array $param List of attribute.
482 */
483 echo apply_filters( 'rmp_color_control_html', '', $param );
484 }
485
486 /**
487 * This function prepare the button input control.
488 *
489 * @version 4.0.0
490 * @param array $param List of attributes for a input control
491 *
492 * @return HTML
493 */
494 public function add_button_control( $param ) {
495 if ( empty( $param ) ) {
496 return;
497 }
498
499 /**
500 * Filters the button input control attribute.
501 *
502 * @version 4.0.0
503 * @param array $param List of attribute.
504 */
505 $param = apply_filters( 'rmp_before_add_button_control', $param );
506
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
522
523 /**
524 * Filters the button input control html.
525 *
526 * @version 4.0.0
527 *
528 * @param HTML|string Input control contents.
529 * @param array $param List of attribute.
530 */
531 echo apply_filters( 'rmp_button_control_html', '', $param );
532 }
533
534 /**
535 * This function prepare the checkbox as switcher input control.
536 *
537 * @version 4.0.0
538 * @param array $param List of attributes for a input control
539 *
540 * @return HTML
541 */
542 public function add_switcher_control( $param ) {
543 if ( empty( $param ) ) {
544 return;
545 }
546
547 /**
548 * Filters the switcher input control attributes.
549 *
550 * @version 4.0.0
551 * @param array $param List of attribute.
552 */
553 $param = apply_filters( 'rmp_before_add_switcher_control', $param );
554
555 $group_classes = '';
556
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
563
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 }
578
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 }
591
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 }
598
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
610
611 /**
612 * Filters the switcher input control html.
613 *
614 * @version 4.0.0
615 *
616 * @param HTML|string Input control contents.
617 * @param array $param List of attribute.
618 */
619 echo apply_filters( 'rmp_switcher_control_html', '', $param );
620 }
621
622 /**
623 * This function prepare the select/dropdown input control.
624 *
625 * @version 4.0.0
626 * @param array $param List of attributes for a input control
627 *
628 * @return HTML
629 */
630 public function add_select_control( $param ) {
631 if ( empty( $param ) ) {
632 return;
633 }
634
635 /**
636 * Filters the select input control attributes.
637 *
638 * @version 4.0.0
639 * @param array $param List of attribute.
640 */
641 $param = apply_filters( 'rmp_before_add_select_control', $param );
642
643 $group_classes = '';
644
645 if ( ! empty( $param['group_classes'] ) ) {
646 $group_classes = $param['group_classes'];
647 }
648
649 ?>
650 <div class="rmp-input-control-wrapper <?php echo esc_attr( $group_classes ); ?> ">
651 <?php
652
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
678
679 // Check multi device options is enabled.
680 $has_multi_device = '';
681 if ( ! empty( $param['multi_device'] ) ) {
682 $has_multi_device = 'multi-device=true';
683 $this->get_device_options();
684 }
685
686 $class = '';
687 if ( ! empty( $param['class'] ) ) {
688 $class = $param['class'];
689 }
690
691 // Check multiple value is allowed.
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 }
709
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
724
725 /**
726 * Filters the select input control html.
727 *
728 * @version 4.0.0
729 *
730 * @param HTML|string Input control contents.
731 * @param array $param List of attribute.
732 */
733 echo apply_filters( 'rmp_select_control_html', '', $param );
734 }
735
736 /**
737 * This function prepare the tooltip.
738 *
739 * @version 4.0.0
740 * @param array $param List of attributes for a input control
741 *
742 * @return HTML
743 */
744 public function get_tool_tip( $param ) {
745 if ( empty( $param['text'] ) ) {
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 }
766
767 /**
768 * This function prepare the shortcut.
769 *
770 * @version 4.0.0
771 * @param array $param List of attributes for a input control
772 *
773 * @return HTML
774 */
775 public function add_shortcut_link( $param ) {
776 if ( empty( $param ) ) {
777 return;
778 }
779
780 // Accordion id.
781 $accordion_id = '';
782 if ( ! empty( $param['accordion_id'] ) ) {
783 $accordion_id = $param['accordion_id'];
784 }
785
786 // Sub accordion id.
787 $sub_accordion_id = '';
788 if ( ! empty( $param['sub_accordion_id'] ) ) {
789 $sub_accordion_id = $param['sub_accordion_id'];
790 }
791
792 // Sub tab id.
793 $sub_tab_id = '';
794 if ( ! empty( $param['sub_tab_id'] ) ) {
795 $sub_tab_id = $param['sub_tab_id'];
796 }
797
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 }
806
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 }
819
820 global $wp_filesystem;
821 if ( empty( $wp_filesystem ) ) {
822 require_once ABSPATH . 'wp-admin/includes/file.php';
823 }
824 WP_Filesystem();
825
826 $group_classes = '';
827
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
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
865 // Check multiple device option enabled.
866 $has_multi_device = '';
867 if ( ! empty( $param['multi_device'] ) ) {
868 $has_multi_device = 'multi-device=true';
869 $this->get_device_options();
870 }
871
872 $class = '';
873 if ( ! empty( $param['class'] ) ) {
874 $class = $param['class'];
875 }
876
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
907
908 /**
909 * Filters the icon picker control html.
910 *
911 * @version 4.0.0
912 *
913 * @param HTML|string Input control contents.
914 * @param array $param List of attribute.
915 */
916 echo apply_filters( 'rmp_icon_picker_control_html', '', $param );
917 }
918
919 /**
920 * This function prepare the image input control.
921 *
922 * @version 4.0.0
923 * @param array $param List of attributes for a input control
924 *
925 * @return HTML
926 */
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 = '';
937
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
944
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
961
962 // Check multi device option is enabled.
963 $has_multi_device = '';
964 if ( ! empty( $param['multi_device'] ) ) {
965 $has_multi_device = 'multi-device=true';
966 $this->get_device_options();
967 }
968
969 $class = '';
970 if ( ! empty( $param['class'] ) ) {
971 $class = $param['class'];
972 }
973
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
1007
1008 /**
1009 * Filters the icon picker control html.
1010 *
1011 * @version 4.0.0
1012 *
1013 * @param HTML|string Input control contents.
1014 * @param array $param List of attribute.
1015 */
1016 echo apply_filters( 'rmp_add_image_control_html', '', $param );
1017 }
1018
1019 /**
1020 * This function prepare the alignment control.
1021 *
1022 * @version 4.0.0
1023 * @param array $param List of attributes for a input control
1024 *
1025 * @return HTML
1026 */
1027 public function add_text_alignment_control( $param ) {
1028 if ( empty( $param ) ) {
1029 return;
1030 }
1031
1032 $group_classes = '';
1033
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
1040
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
1057
1058 // Check multiple device options is enabled.
1059 $has_multi_device = '';
1060 if ( ! empty( $param['multi_device'] ) ) {
1061 $has_multi_device = 'multi-device=true';
1062 $this->get_device_options();
1063 }
1064
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
1106
1107 /**
1108 * Filters the icon picker control html.
1109 *
1110 * @version 4.0.0
1111 *
1112 * @param HTML|string Input control contents.
1113 * @param array $param List of attribute.
1114 */
1115 echo apply_filters( 'rmp_add_text_alignment_control_html', '', $param );
1116 }
1117
1118 /**
1119 * Function to prepare the device visibility control,
1120 * those are mobile, tablet and desktop as options.
1121 *
1122 * @version 4.0.0
1123 *
1124 * @param array $options list of values.
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 }
1188
1189 /**
1190 * Function to return the device options markup.
1191 *
1192 * @version 4.0.0
1193 *
1194 * @return HTML
1195 */
1196 protected function get_device_options() {
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 }
1234
1235 public function add_sub_heading( $param ) {
1236 if ( empty( $param['text'] ) ) {
1237 return;
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 }
1251
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 }
1262 }
1263