From 567c0c5c208bc9e9b407e54cf8655077e8b283f2 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 21 Jun 2013 22:20:16 -0400 Subject: [PATCH] Switching on the category type to determine which type of input to display. --- web/app/View/Config/index.ctp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/web/app/View/Config/index.ctp b/web/app/View/Config/index.ctp index d6c4b552f..3a57f4716 100644 --- a/web/app/View/Config/index.ctp +++ b/web/app/View/Config/index.ctp @@ -19,10 +19,23 @@ foreach ($options as $option => $value) { foreach ($value as $val) { $id = $val['Config']['Id']; $inputname = 'Config.' . $id . '.' . $val['Config']['Name']; + + switch ($val['Config']['Type']) { + case 'boolean': + $type = 'checkbox'; + break; + case 'integer': + $type = 'text'; + break; + case 'string': + $type = 'text'; + break; + } echo $this->Form->input($inputname, array( 'default' => $val['Config']['Value'], 'label' => $val['Config']['Name'], - 'title' => $val['Config']['Prompt'] + 'title' => $val['Config']['Prompt'], + 'type' => $type )); echo "\n"; }