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 / apilogs / tmpl / default_payload.php
vikappointments / admin / views / apilogs / tmpl Last commit date
default.php 4 days ago default_payload.php 4 days ago index.html 4 days ago
default_payload.php
64 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 $log = $this->currentLog;
15
16 if (defined('JSON_PRETTY_PRINT'))
17 {
18 $log['payload'] = json_encode(json_decode($log['payload']), JSON_PRETTY_PRINT);
19 }
20
21 $params = array(
22 'readonly' => true,
23 'syntax' => 'json',
24 );
25
26 ?>
27
28 <div style="padding: 10px;">
29
30 <?php echo VAPApplication::getInstance()->getCodeMirror('payload_' . $log['id'], $log['payload'], $params); ?>
31
32 <textarea class="keep-active-but-hidden" id="payload_copy_<?php echo $log['id']; ?>"><?php echo $log['payload']; ?></textarea>
33
34 </div>
35
36 <script>
37
38 <?php
39 /**
40 * In WordPress the codemirror seems to have rendering problems while
41 * initialized on a hidden panel. For this reason, we need to refresh
42 * its contents when the modal is displayed.
43 * @wponly
44 */
45 if (VersionListener::isWordpress())
46 {
47 ?>
48 (function($) {
49 'use strict';
50
51 $(function() {
52 $('#jmodal-payload-<?php echo $log['id']; ?>').on('show', () => {
53 setTimeout(() => {
54 Joomla.editors.instances['payload_<?php echo $log['id']; ?>'].element.codemirror.refresh();
55 }, 256);
56 });
57 });
58 })(jQuery);
59 <?php
60 }
61 ?>
62
63 </script>
64