mirror of https://github.com/MISP/MISP
new: [generic json template] added with JS based highlighting
parent
e48f76ce34
commit
55ab16b568
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
$randomId = dechex(mt_rand());
|
||||||
|
echo sprintf(
|
||||||
|
'<pre id="%s">%s</pre>',
|
||||||
|
$randomId,
|
||||||
|
json_encode($json)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#<?= $randomId ?>').html(syntaxHighlightJson(<?php echo json_encode($json); ?>, 4));
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -6,7 +6,7 @@
|
||||||
<h3 id="genericModalLabel"><?= h($title) ?></h3>
|
<h3 id="genericModalLabel"><?= h($title) ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body modal-body-long">
|
<div class="modal-body modal-body-long">
|
||||||
<p><?= empty($html) ? '' : $html ?><?= empty($text) ? '' : h($text) ?></p>
|
<p><?= empty($html) ? '' : $html ?><?= empty($text) ? '' : h($text) ?><?= empty($json) ? '' : $this->element('genericElements/json', ['json' => $json]) ?></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary cancel-button" data-dismiss="modal"><?= __('Cancel') ?></button>
|
<button type="button" class="btn btn-secondary cancel-button" data-dismiss="modal"><?= __('Cancel') ?></button>
|
||||||
|
|
Loading…
Reference in New Issue