2020-05-29 13:41:58 +02:00
|
|
|
<?php
|
2021-11-17 15:58:52 +01:00
|
|
|
$data = $this->Hash->extract($row, $field['data_path']);
|
2020-05-29 13:41:58 +02:00
|
|
|
// I feed dirty for this...
|
|
|
|
if (is_array($data) && count($data) === 1 && isset($data[0])) {
|
|
|
|
$data = $data[0];
|
|
|
|
}
|
2021-11-17 15:58:52 +01:00
|
|
|
if (!is_array($data)) {
|
|
|
|
$data = json_decode($data, true);
|
|
|
|
}
|
2020-05-29 13:41:58 +02:00
|
|
|
echo sprintf(
|
|
|
|
'<div class="json_container_%s"></div>',
|
|
|
|
h($k)
|
|
|
|
);
|
|
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('.json_container_<?php echo h($k);?>').html(syntaxHighlightJson(<?php echo json_encode($data); ?>, 4));
|
|
|
|
});
|
|
|
|
</script>
|