DirectorObjectForm: add dummy element for db vars
This commit is contained in:
parent
49abd08ec3
commit
a9b9342092
|
@ -96,12 +96,27 @@ abstract class DirectorObjectForm extends QuickForm
|
|||
$this->addHidden('id');
|
||||
}
|
||||
$this->setDefaults($this->object->getProperties());
|
||||
|
||||
if ($this->object->supportsCustomVars()) {
|
||||
foreach ($this->object->vars() as $key => $value) {
|
||||
$this->addCustomVar($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $this->hasBeenSubmitted()) {
|
||||
$this->beforeValidation($this->object->getProperties());
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function addCustomVar($key, $var)
|
||||
{
|
||||
$this->addElement('text', 'var_' . $key, array(
|
||||
'label' => 'vars.' . $key,
|
||||
'value' => $var->getValue()
|
||||
));
|
||||
}
|
||||
|
||||
public function setDb($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
|
Loading…
Reference in New Issue