PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / admin / views / manageapiuser / tmpl / default_ip.php
vikappointments / admin / views / manageapiuser / tmpl Last commit date
default.php 6 days ago default_application.php 6 days ago default_ip.php 6 days ago default_plugins.php 6 days ago index.html 6 days ago
default_ip.php
72 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 ?>
15
16 <div class="vap-ips-container" id="ips-container">
17
18 <?php
19 foreach ($this->user->ips as $ip)
20 {
21 ?>
22 <div class="control-group input-append ip-wrapper">
23 <input type="text" name="ip[]" value="<?php echo $this->escape($ip); ?>" />
24
25 <button type="button" class="btn trash-ip">
26 <i class="fas fa-trash"></i>
27 </button>
28 </div>
29 <?php
30 }
31 ?>
32
33 </div>
34
35 <?php
36 echo VAPApplication::getInstance()->alert(
37 JText::translate('VAPAPIUSEREMPTYIPNOTICE'),
38 'info',
39 $dismissible = false,
40 array(
41 'id' => 'no-ip-notice',
42 'style' => $this->user->ips ? 'display:none;' : '',
43 )
44 );
45 ?>
46
47 <div class="control-group" id="ips-container">
48 <button type="button" class="btn" id="add-ip"><?php echo JText::translate('VAPMANAGEAPIUSER9'); ?></button>
49 </div>
50
51 <script>
52
53 jQuery(function($) {
54 $(document).on('click', '.trash-ip', function() {
55 $(this).closest('.ip-wrapper').remove();
56 });
57
58 $('#add-ip').on('click', () => {
59 const box = $('<div class="control-group input-append ip-wrapper"></div>');
60
61 box.append($('<input type="text" name="ip[]" />'));
62 box.append($('<button type="button" class="btn trash-ip"><i class="fas fa-trash"></i></button>'));
63
64 $('#ips-container').append(box);
65
66 // hide notice when adding an IP
67 $('#no-ip-notice').hide();
68 });
69 });
70
71 </script>
72