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 / layouts / wizard / steps / locations.php
vikappointments / admin / layouts / wizard / steps Last commit date
employees.php 3 days ago index.html 3 days ago locations.php 3 days ago locwdays.php 3 days ago options.php 3 days ago packages.php 3 days ago payments.php 3 days ago services.php 3 days ago subscriptions.php 3 days ago syspack.php 3 days ago syssubscr.php 3 days ago system.php 3 days ago taxes.php 3 days ago
locations.php
96 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 * Layout variables
16 * -----------------
17 * @var VAPWizardStep $step The wizard step instance.
18 */
19 extract($displayData);
20
21 $progress = $step->getProgress();
22
23 $vik = VAPApplication::getInstance();
24
25 // get Google API Key configuration
26 if ($step->getGoogleAK() === '')
27 {
28 $id = $step->getID();
29
30 echo $vik->alert(JText::translate('VAP_WIZARD_STEP_LOCATIONS_GOOGLE_API_KEY_WARN'));
31 ?>
32 <div class="wizard-form">
33
34 <!-- GOOGLE API KEY - Text -->
35
36 <div class="controls">
37 <input type="text" name="wizard[<?php echo $id; ?>][googleapikey]" value="" class="required form-control" placeholder="Google API Key" />
38 </div>
39
40 </div>
41
42 <script>
43 (function($) {
44 'use strict';
45
46 VAPWizard.addPreflight('<?php echo $id; ?>', function(role, step) {
47 if (role != 'process') {
48 return true;
49 }
50
51 // create form validator
52 var validator = new VikFormValidator(step);
53
54 // validate form
55 if (!validator.validate()) {
56 // prevent request
57 return false;
58 }
59
60 return true;
61 });
62 })(jQuery);
63 </script>
64 <?php
65 }
66 else if ($locations = $step->getLocations())
67 {
68 ?>
69 <ul class="wizard-step-summary">
70 <?php
71
72
73 // display at most 3 locations
74 for ($i = 0; $i < min(array(3, count($locations))); $i++)
75 {
76 ?>
77 <li>
78 <b><?php echo $locations[$i]->name; ?></b>
79 </li>
80 <?php
81 }
82
83 // count remaining locations
84 $remaining = count($locations) - 3;
85
86 if ($remaining > 0)
87 {
88 ?>
89 <li><?php echo JText::plural('VAPWIZARDOTHER_N_ITEMS', $remaining); ?></li>
90 <?php
91 }
92 ?>
93 </ul>
94 <?php
95 }
96