Add additional types to gui generator.

This commit is contained in:
Starbeamrainbowlabs 2016-10-18 17:55:59 +01:00
parent 52569bbab2
commit 2eacd31577
1 changed files with 8 additions and 0 deletions

View File

@ -33,11 +33,19 @@ register_module([
$label = "<label for='setting-$configKey'>$configKey</label>";
switch($configData->type)
{
case "url":
case "number":
case "text":
$inputControl = "<input type='$configData->type' id='$configKey' value='$settings->$configKey' />";
break;
case "textarea":
$inputControl = "<textarea id='$configKey'>$settings->$configKey</textarea>";
case "checkbox":
$reverse = true;
$inputControl = "<input type='checkbox' id='$configKey' " . ($settings->$configKey ? " checked" : "") . " />";
default:
$label = "";
$inputControl = "<p><em>Sorry! The <code>$configKey</code> setting isn't editable yet through the gui. Please try editing <code>peppermint.json</code> for the time being.</p>";
}
$content .= !$reverse ? "$inputControl\n$label\n" : "$label\n$inputControl\n";