Skip to content

Commit 258873a

Browse files
committed
Added hidden field type. Expanded text field type. Fixed spacing for multiple buttons.
1 parent 2784e66 commit 258873a

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

support/flex_forms.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,12 @@ protected function ProcessField($num, &$field, $id)
660660
{
661661
// Do nothing if type is not specified.
662662
}
663+
else if ($field["type"] == "hidden")
664+
{
665+
?>
666+
<input type="hidden" id="<?php echo htmlspecialchars($id); ?>" name="<?php echo htmlspecialchars($field["name"]); ?>" value="<?php echo htmlspecialchars($field["value"]); ?>" />
667+
<?php
668+
}
663669
else if (isset($this->state["customfieldtypes"][$field["type"]]))
664670
{
665671
// Output custom fields.
@@ -743,19 +749,11 @@ protected function ProcessField($num, &$field, $id)
743749
break;
744750
}
745751
case "text":
746-
{
747-
?>
748-
<div class="formitemdata">
749-
<div class="textitemwrap"<?php if (isset($field["width"])) echo " style=\"" . ($this->state["responsive"] ? "max-" : "") . "width: " . htmlspecialchars($field["width"]) . ";\""; ?>><input class="text" type="text" id="<?php echo htmlspecialchars($id); ?>" name="<?php echo htmlspecialchars($field["name"]); ?>" value="<?php echo htmlspecialchars($field["value"]); ?>"<?php if ($this->state["autofocused"] === $id) echo " autofocus"; ?> /></div>
750-
</div>
751-
<?php
752-
break;
753-
}
754752
case "password":
755753
{
756754
?>
757755
<div class="formitemdata">
758-
<div class="textitemwrap"<?php if (isset($field["width"])) echo " style=\"" . ($this->state["responsive"] ? "max-" : "") . "width: " . htmlspecialchars($field["width"]) . ";\""; ?>><input class="text" type="password" id="<?php echo htmlspecialchars($id); ?>" name="<?php echo htmlspecialchars($field["name"]); ?>" value="<?php echo htmlspecialchars($field["value"]); ?>"<?php if ($this->state["autofocused"] === $id) echo " autofocus"; ?> /></div>
756+
<div class="textitemwrap"<?php if (isset($field["width"])) echo " style=\"" . ($this->state["responsive"] ? "max-" : "") . "width: " . htmlspecialchars($field["width"]) . ";\""; ?>><input class="text" type="<?php echo htmlspecialchars(isset($field["subtype"]) ? $field["subtype"] : $field["type"]); ?>" id="<?php echo htmlspecialchars($id); ?>" name="<?php echo htmlspecialchars($field["name"]); ?>" value="<?php echo htmlspecialchars($field["value"]); ?>"<?php if ($this->state["autofocused"] === $id) echo " autofocus"; ?> /></div>
759757
</div>
760758
<?php
761759
break;
@@ -1113,9 +1111,10 @@ protected function ProcessSubmit(&$options)
11131111
foreach ($options["submit"] as $name => $val)
11141112
{
11151113
if (is_int($name) && isset($options["submitname"])) $name = $options["submitname"];
1116-
?>
1117-
<input class="submit" type="submit"<?php if ($name !== "") echo " name=\"" . htmlspecialchars(isset($options["hashnames"]) && $options["hashnames"] ? $this->GetHashedFieldName($name) : $name) . "\""; ?> value="<?php echo htmlspecialchars(self::FFTranslate($val)); ?>" />
1118-
<?php
1114+
1115+
echo "<input class=\"submit\" type=\"submit\"";
1116+
if ($name !== "") echo " name=\"" . htmlspecialchars(isset($options["hashnames"]) && $options["hashnames"] ? $this->GetHashedFieldName($name) : $name) . "\"";
1117+
echo " value=\"" . htmlspecialchars(self::FFTranslate($val)) . "\" />";
11191118
}
11201119
?>
11211120
</div>

0 commit comments

Comments
 (0)