function __construct($name, &$form, $request=null) {
$this->setName($name);
- $form->setRequest($request);
$this->setForm($form);
//if ($request) $this->initAttributes($request);
$this->initAttributes($request);
}
function setName($name) {
- $this->mName = $name;
- $this->mSessionCell = "formbean_".$this->mName;
+ $this->name = $name;
+ $this->mSessionCell = "formbean_".$this->name;
}
/**
* @param object $request
*/
function initAttributes(&$request) {
- //$submit_flag = $this->isSubmit();
$submit_flag = (is_object($request) && ($request->isPost()));
if ($submit_flag) {
$this->mInitForm = true;
}
}
-
- /**
- * Init custom variables
- *
- * @param unknown $request
- * @param unknown $respons
- */
- function initVariables(&$request, &$respons) {
-
- }
-
+
function setVariablesNames($namelist) {
$this->mVariables = $namelist;
}
$this->mValues[$name] = $value;
if ($this->mForm) {
if (isset($this->mForm->elements[$name])) {
- if ($this->mForm->elements[$name]->cClassName=="DateField") {
+ if ($this->mForm->elements[$name]->class=="DateField") {
$dt = new DateAndTime($user->date_format, $value);
$value = $dt->toString(DB_DATEFORMAT);
}
foreach ($this->mValues as $name=>$value) {
if ($this->mForm) {
if (isset($this->mForm->elements[$name])) {
- if ($this->mForm->elements[$name]->cClassName=="DateField") {
+ if ($this->mForm->elements[$name]->class=="DateField") {
$dt = new DateAndTime($user->date_format, $value);
$value = $dt->toString(DB_DATEFORMAT);
}
print_r($this->mValues);
}
- function isSubmit() {
- $res = false;
- if (is_object($this->mForm)) {
- $res = $this->mForm->isSubmit();
- }
- return $res;
- }
-
function saveBean() {
if ($this->mForm) {
$elements = $this->mForm->getElements();
import('form.'.$ref_el["class"]);
$class_name = $ref_el["class"];
$el = new $class_name($ref_el["name"]);
- if (isset($GLOBALS["I18N"])) $el->setLocalization($GLOBALS["I18N"]);
+ $el->localize();
$el->setValueSafe(@$_SESSION[$this->mSessionCell . "_" .$el->getName()]);
if ($this->mForm && !isset($this->mForm->elements[$ref_el["name"]])) {