1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-12-22 13:45:02 +00:00

Add additional types to gui generator.

This commit is contained in:
Starbeamrainbowlabs 2016-10-18 17:55:59 +01:00
parent 52569bbab2
commit 2eacd31577

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";