From 1e800336f8beb3fd13deab9c12f18bc2c208b287 Mon Sep 17 00:00:00 2001 From: Tohir Solomons Date: Wed, 14 Oct 2009 08:50:22 +0200 Subject: [PATCH] added support for multiselect types --- ktapi/KTAPIDocument.inc.php | 10 ++++++++++ ktapi/ktapi.inc.php | 15 +++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ktapi/KTAPIDocument.inc.php b/ktapi/KTAPIDocument.inc.php index 7266032..88756e2 100644 --- a/ktapi/KTAPIDocument.inc.php +++ b/ktapi/KTAPIDocument.inc.php @@ -1255,6 +1255,10 @@ class KTAPI_Document extends KTAPI_FolderItem // Options - Required for Custom Properties $options = array(); + if ($field->getInetLookupType() == 'multiwithcheckboxes' || $field->getInetLookupType() == 'multiwithlist') { + $controltype = 'multiselect'; + } + switch ($controltype) { case 'lookup': @@ -1270,6 +1274,12 @@ class KTAPI_Document extends KTAPI_FolderItem ); $selection= array(); break; + case 'multiselect': + $selection = KTAPI::get_metadata_lookup($field->getId()); + $options = array( + 'type' => $field->getInetLookupType() + ); + break; default: $selection= array(); } diff --git a/ktapi/ktapi.inc.php b/ktapi/ktapi.inc.php index e867883..ec3dbee 100644 --- a/ktapi/ktapi.inc.php +++ b/ktapi/ktapi.inc.php @@ -1036,8 +1036,13 @@ class KTAPI $controltype = 'tree'; } } - $options = array(); + + if ($field->getInetLookupType() == 'multiwithcheckboxes' || $field->getInetLookupType() == 'multiwithlist') { + $controltype = 'multiselect'; + } + + switch ($controltype) { case 'lookup': @@ -1053,6 +1058,12 @@ class KTAPI ); $selection= array(); break; + case 'multiselect': + $selection = KTAPI::get_metadata_lookup($field->getId()); + $options = array( + 'type' => $field->getInetLookupType() + ); + break; default: $selection= array(); } @@ -1065,7 +1076,7 @@ class KTAPI 'description' => $field->getDescription(), 'control_type' => $controltype, 'selection' => $selection, - 'options' => $options, + 'options' => $options ); } $result['fields'] = $fieldsresult; -- libgit2 0.21.4