summaryrefslogtreecommitdiff
path: root/list_kitlocker.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-19 12:30:36 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-19 12:30:36 +0100
commit7a3bb89372385a235522cdd46a9ff0a9fe13080f (patch)
treedb6947c785bc02c537a9decc05a04119da82d75e /list_kitlocker.php
parent673ac631795c6706671ef80353cb053917626c6d (diff)
downloadstock-7a3bb89372385a235522cdd46a9ff0a9fe13080f.tar.gz
stock-7a3bb89372385a235522cdd46a9ff0a9fe13080f.tar.bz2
stock-7a3bb89372385a235522cdd46a9ff0a9fe13080f.zip
Parse description data in list_kitlocker rather than escaping raw markup
Add format_guid to query, call parseDataHash() per row in PHP, display parsed_data|strip_tags|truncate in template. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'list_kitlocker.php')
-rw-r--r--list_kitlocker.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/list_kitlocker.php b/list_kitlocker.php
index 7598c53..33a7697 100644
--- a/list_kitlocker.php
+++ b/list_kitlocker.php
@@ -7,6 +7,7 @@
namespace Bitweaver\Stock;
use Bitweaver\KernelTools;
+use Bitweaver\Liberty\LibertyContent;
require_once '../kernel/includes/setup_inc.php';
@@ -35,7 +36,7 @@ if( $stgrp ) {
}
$items = $gBitDb->getAll(
- "SELECT lc.`content_id`, lc.`title`, lc.`data`, lc.`content_type_guid`,
+ "SELECT lc.`content_id`, lc.`title`, lc.`data`, lc.`format_guid`, lc.`content_type_guid`,
(SELECT FIRST 1 x.`xkey` FROM `{$X}liberty_xref` x
WHERE x.`content_id` = lc.`content_id` AND x.`item` = 'KLID') AS klid,
(SELECT FIRST 1 x.`xkey` FROM `{$X}liberty_xref` x
@@ -46,6 +47,12 @@ $items = $gBitDb->getAll(
$bindVars
);
+foreach( $items as &$row ) {
+ $parseHash = [ 'data' => $row['data'], 'format_guid' => $row['format_guid'] ?? 'bithtml' ];
+ $row['parsed_data'] = LibertyContent::parseDataHash( $parseHash );
+}
+unset( $row );
+
$gBitSmarty->assign( 'kitlockerItems', $items );
$gBitSmarty->assign( 'stgrp', $stgrp );
$gBitSmarty->assign( 'groupTitle', $groupTitle );