summaryrefslogtreecommitdiff
path: root/utils/forms.php
diff options
context:
space:
mode:
authordeva <deva>2010-02-28 10:20:09 +0000
committerdeva <deva>2010-02-28 10:20:09 +0000
commit8c69fd9b2e824114ee3cd0f6a7dcddc7e31d913c (patch)
tree5352520fe12cb1670d2d5f035483a172c467643b /utils/forms.php
parent5fac941e3295d4a094795aaf2f0e05c542879465 (diff)
Added users module. Made new password lineedit widget.
Diffstat (limited to 'utils/forms.php')
-rw-r--r--utils/forms.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/utils/forms.php b/utils/forms.php
index 45939e7..126d29f 100644
--- a/utils/forms.php
+++ b/utils/forms.php
@@ -19,6 +19,26 @@ class LineEdit {
}
}
+class LineEditPwd {
+ public $label, $name, $value;
+
+ function LineEditPwd($label, $name, $value = "")
+ {
+ $this->label = $label;
+ $this->name = $name;
+ $this->value = $value;
+ }
+
+ function render($indent = "")
+ {
+ $str = $indent . "<div class=\"input\">\n";
+ $str .= $indent . " <div class=\"label\">". $this->label ."</div>\n";
+ $str .= $indent . " <div class=\"widget\"><input name=\"vars[".$this->name."]\" value=\"".$this->value."\" type=\"password\"/></div>\n";
+ $str .= $indent . "</div>\n";
+ return $str;
+ }
+}
+
class FileUpload {
public $label, $name, $accept;
@@ -358,6 +378,36 @@ class ListEditor {
}
}
+class MultiList {
+ public $label, $name, $values;
+
+ function MultiList($label, $name, $values = "")
+ {
+ $this->label = $label;
+ $this->name = $name;
+ $this->values = $values;
+ }
+
+ function render($indent = "")
+ {
+ $str = $indent . "<div class=\"input\">\n";
+ $str .= $indent . " <div class=\"label\">". $this->label ."</div>\n";
+ $str .= $indent . " <div class=\"widget\">\n";
+ $str .= $indent . " <select multiple size=\"8\" id=\"items\" name=\"".$this->name."[]\">\n";
+ if(sizeof($this->values)) {
+ foreach($this->values as $value => $active) {
+ if($active == true) $sel = " selected=\"true\"";
+ else $sel = "";
+ $str .= $indent . " <option value=\"".$value."\"".$sel.">".$value."</option>\n";
+ }
+ }
+ $str .= $indent . " </select>\n";
+ $str .= $indent . " </div>\n";
+ $str .= $indent . "</div>\n";
+ return $str;
+ }
+}
+
class Form {
public $widgets = array();
public $action;