projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A bit more work on Greek file to improve quality.
[timetracker.git]
/
WEB-INF
/
lib
/
form
/
Form.class.php
diff --git
a/WEB-INF/lib/form/Form.class.php
b/WEB-INF/lib/form/Form.class.php
index
cb2f520
..
19dd011
100644
(file)
--- a/
WEB-INF/lib/form/Form.class.php
+++ b/
WEB-INF/lib/form/Form.class.php
@@
-77,8
+77,6
@@
class Form {
case 'textarea':
import('form.TextArea');
$el = new TextArea($params['name']);
case 'textarea':
import('form.TextArea');
$el = new TextArea($params['name']);
- if (isset($params['cols'])) $el->setColumns($params['cols']);
- if (isset($params['rows'])) $el->setRows($params['rows']);
if (isset($params['maxlength'])) $el->setMaxLength($params['maxlength']);
break;
if (isset($params['maxlength'])) $el->setMaxLength($params['maxlength']);
break;
@@
-87,6
+85,16
@@
class Form {
$el = new Checkbox($params['name']);
break;
$el = new Checkbox($params['name']);
break;
+ case 'hidden':
+ import('form.Hidden');
+ $el = new Hidden($params['name']);
+ break;
+
+ case 'submit':
+ import('form.Submit');
+ $el = new Submit($params['name']);
+ break;
+
// TODO: refactoring ongoing down from here.
case "checkboxgroup":
import('form.CheckboxGroup');
// TODO: refactoring ongoing down from here.
case "checkboxgroup":
import('form.CheckboxGroup');
@@
-102,19
+110,13
@@
class Form {
$el = new Combobox($params["name"]);
$el->setData(@$params["data"]);
$el->setDataDefault(@$params["empty"]);
$el = new Combobox($params["name"]);
$el->setData(@$params["data"]);
$el->setDataDefault(@$params["empty"]);
+ if (isset($params["multiple"])) {
+ $el->setMultiple($params["multiple"]);
+ $el->name .= '[]'; // Add brackets to the end of name to get back an array on POST.
+ }
if (isset($params["datakeys"])) $el->setDataKeys($params["datakeys"]);
break;
if (isset($params["datakeys"])) $el->setDataKeys($params["datakeys"]);
break;
-
- case "hidden":
- import('form.Hidden');
- $el = new Hidden($params["name"]);
- break;
-
- case "submit":
- import('form.Submit');
- $el = new Submit($params["name"]);
- break;
-
+
case "calendar":
import('form.Calendar');
$el = new Calendar($params["name"]);
case "calendar":
import('form.Calendar');
$el = new Calendar($params["name"]);
@@
-137,7
+139,7
@@
class Form {
if ($el!=null) {
$el->setFormName($this->name);
if (isset($params["id"])) $el->setId($params["id"]);
if ($el!=null) {
$el->setFormName($this->name);
if (isset($params["id"])) $el->setId($params["id"]);
-
if (isset($GLOBALS["I18N"])) $el->localize($GLOBALS["I18N"]
);
+
$el->localize(
);
if (isset($params["enable"])) $el->setEnabled($params["enable"]);
if (isset($params["style"])) $el->setStyle($params["style"]);
if (isset($params["enable"])) $el->setEnabled($params["enable"]);
if (isset($params["style"])) $el->setStyle($params["style"]);
@@
-155,7
+157,7
@@
class Form {
function addInputElement(&$el) {
if ($el && is_object($el)) {
function addInputElement(&$el) {
if ($el && is_object($el)) {
-
if (isset($GLOBALS["I18N"])) $el->localize($GLOBALS["I18N"]
);
+
$el->localize(
);
$el->setFormName($this->name);
$this->elements[$el->name] = &$el;
$el->setFormName($this->name);
$this->elements[$el->name] = &$el;