From 4c9512f8ca58fba92caa2d8bfbf377b8d8b1e0e1 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Tue, 2 Aug 2005 09:19:32 +0000 Subject: [PATCH] Implement pre- and post-code to execute before and after storage of the item. --- presentation/lookAndFeel/knowledgeTree/store.inc | 9 +++++++++ 1 file changed, 9 insertions(+), 0 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/store.inc b/presentation/lookAndFeel/knowledgeTree/store.inc index c606435..413bec8 100644 --- a/presentation/lookAndFeel/knowledgeTree/store.inc +++ b/presentation/lookAndFeel/knowledgeTree/store.inc @@ -26,6 +26,7 @@ function constructQuery($aKeys, $aSuppliedValues = null) { $aQuery = array(); + $first = true; for ($i = 0; $i < count($aKeys); $i++) { $sRowStart = $aKeys[$i]; $pos = strncasecmp("unique_start", $sRowStart, 12); @@ -58,6 +59,12 @@ function constructQuery($aKeys, $aSuppliedValues = null) { $i++; $iColumnCount = 0; + if ($first === true) { + $sPreCode = $_SESSION["pelfq_" . $sRandomString . "_code_pre"]; + eval($sPreCode); + $first = false; + } + //get all the values for the table while ((strncasecmp("unique_end", $sRowStart, 10) != 0) && ($i <= count($aKeys))) { //$aColumns[$iColumnCount] = $_POST[$aKeys[$i]]; @@ -107,6 +114,8 @@ function constructQuery($aKeys, $aSuppliedValues = null) { } } } + $sPostCode = $_SESSION["pelfq_" . $sRandomString . "_code_post"]; + eval($sPostCode); return $aQuery; } ?> -- libgit2 0.21.4