| 1 |
<div class="logtivity-modal-strip"> |
| 2 |
<h2 class="title">Overview</h2> |
| 3 |
<button type="button" class="notice-dismiss js-logtivity-notice-dismiss"><span class="screen-reader-text">Dismiss this modal.</span></button> |
| 4 |
</div> |
| 5 |
|
| 6 |
<table style="margin-top: 0;" class="form-table logtivity-table"> |
| 7 |
<tbody> |
| 8 |
<tr> |
| 9 |
<th>Action</th> |
| 10 |
<td><?php echo sanitize_text_field($log->action) ?></td> |
| 11 |
</tr> |
| 12 |
<?php if ($log->context): ?> |
| 13 |
<tr> |
| 14 |
<th>Context</th> |
| 15 |
<td><?php echo sanitize_text_field($log->context) ?></td> |
| 16 |
</tr> |
| 17 |
<?php endif ?> |
| 18 |
<?php if ($log->action_user_id): ?> |
| 19 |
<tr> |
| 20 |
<th>User ID</th> |
| 21 |
<td><?php echo sanitize_text_field($log->action_user_id) ?></td> |
| 22 |
</tr> |
| 23 |
<?php endif ?> |
| 24 |
<?php if ($log->action_username): ?> |
| 25 |
<tr> |
| 26 |
<th>Username</th> |
| 27 |
<td><?php echo sanitize_text_field($log->action_username) ?></td> |
| 28 |
</tr> |
| 29 |
<?php endif ?> |
| 30 |
<?php if ($log->action_user_meta): ?> |
| 31 |
<?php foreach (json_decode($log->action_user_meta) as $key => $value): ?> |
| 32 |
<tr> |
| 33 |
<th><?php echo sanitize_text_field(ucfirst( str_replace('_', ' ', $key) )) ?></th> |
| 34 |
<td> |
| 35 |
<?php if (is_array($value)): ?> |
| 36 |
<pre class="mb-0"><?php var_export($value) ?></pre> |
| 37 |
<?php else: ?> |
| 38 |
<?php if (substr( $value, 0, 4 ) === "http"): ?> |
| 39 |
<a target="_blank" rel="noopener noreferrer" href="<?php echo sanitize_text_field($value) ?>"><?php echo sanitize_text_field($value) ?></a> |
| 40 |
<?php else: ?> |
| 41 |
<?php echo sanitize_text_field($value) ?> |
| 42 |
<?php endif ?> |
| 43 |
<?php endif ?> |
| 44 |
</td> |
| 45 |
</tr> |
| 46 |
<?php endforeach ?> |
| 47 |
<?php endif; ?> |
| 48 |
|
| 49 |
<?php if ($log->ip_address): ?> |
| 50 |
<tr> |
| 51 |
<th>IP</th> |
| 52 |
<td><?php echo sanitize_text_field($log->ip_address) ?></td> |
| 53 |
</tr> |
| 54 |
<?php endif ?> |
| 55 |
<tr> |
| 56 |
<th>Date</th> |
| 57 |
<td> |
| 58 |
<?php echo sanitize_text_field(date('M d Y', strtotime($log->occurred_at))) ?> <?php echo sanitize_text_field(date('H:i:s', strtotime($log->occurred_at))); ?> |
| 59 |
</td> |
| 60 |
</tr> |
| 61 |
</tbody> |
| 62 |
</table> |
| 63 |
|
| 64 |
<?php if ($log->meta): ?> |
| 65 |
|
| 66 |
<div class="logtivity-modal-strip light small"> |
| 67 |
<h3 class="hndle">Meta</h3> |
| 68 |
</div> |
| 69 |
|
| 70 |
<table style="margin-top: 0;" class="form-table logtivity-table"> |
| 71 |
<tbody> |
| 72 |
<?php foreach (json_decode($log->meta, true) as $key => $value): ?> |
| 73 |
|
| 74 |
<tr> |
| 75 |
<th> |
| 76 |
<?php if (isset($value['key'])): ?> |
| 77 |
<strong><?php echo sanitize_text_field($value['key']) ?></strong> |
| 78 |
<?php else: ?> |
| 79 |
<strong><?php echo sanitize_text_field($key) ?></strong> |
| 80 |
<?php endif ?> |
| 81 |
</th> |
| 82 |
<td> |
| 83 |
<?php if (isset($value['key']) && !isset($value['value'])) { |
| 84 |
$value = ''; |
| 85 |
} ?> |
| 86 |
<?php if (isset($value['value'])): ?> |
| 87 |
<?php $value = $value['value']; ?> |
| 88 |
<?php endif; ?> |
| 89 |
<?php if (is_array($value) || is_object($value)): ?> |
| 90 |
<pre><?php var_export($value) ?></pre> |
| 91 |
<?php else: ?> |
| 92 |
<?php if (substr( $value, 0, 4 ) === "http"): ?> |
| 93 |
<a target="_blank" rel="noopener noreferrer" href="<?php echo sanitize_text_field($value) ?>">Visit Link <i class="ml-1 small fas fa-external-link-alt"></i></a> |
| 94 |
<?php else: ?> |
| 95 |
<?php echo sanitize_text_field($value) ?> |
| 96 |
<?php endif ?> |
| 97 |
<?php endif ?> |
| 98 |
</td> |
| 99 |
</tr> |
| 100 |
|
| 101 |
<?php endforeach ?> |
| 102 |
</tbody> |
| 103 |
</table> |
| 104 |
|
| 105 |
<?php endif; ?> |
| 106 |
|