diff --git a/web/api/app/Controller/Component/ConfigParserComponent.php b/web/api/app/Controller/Component/ConfigParserComponent.php index 4f26df975..a005516f6 100644 --- a/web/api/app/Controller/Component/ConfigParserComponent.php +++ b/web/api/app/Controller/Component/ConfigParserComponent.php @@ -11,61 +11,32 @@ class ConfigParserComponent extends Component { return $string; } - public function buildString($name, $type) { - - } - public function parseOptions($configs) { + $category = $configs[0]['Config']['Category']; $string = ""; + foreach ($configs as $option) { $type = $option['Config']['Type']; $name = $option['Config']['Name']; $value = $option['Config']['Value']; $hint = $option['Config']['Hint']; + $id = $option['Config']['Id']; switch ($type) { case "boolean": $string .= << - - -EOD; - break; - case "integer": - $string .= << - - + +
EOD; break; case "text": - $string .= $this->buildString($name, 'textbox'); $string .= << - - - -EOD; - break; - case "hexadecimal": - $string .= << - - - -EOD; - - break; - case "decimal": - $string .= << - - + +
EOD; break; @@ -73,29 +44,40 @@ EOD; if (strpos($hint, '|') === FALSE) { $string .= << - - + +
EOD; } else { $string .= << - - EOD; $string .= $this->parseHints($hint); $string .= << + + EOD; } break; + default: + $string .= << + +
+ +EOD; } $string .= "\n"; } - + file_put_contents("/tmp/html/$category.html", $string); return $string; } + + } ?>