1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11: class Vilma_Form_EditDomain extends Horde_Form
12: {
13: public function __construct($vars)
14: {
15:
16: $editing = $vars->exists('domain_id');
17: $domain = $GLOBALS['session']->get('vilma', 'domain');
18: parent::Horde_Form($vars, $editing ? _("Edit Domain") : _("New Domain"));
19: if ($editing && !$this->isSubmitted()) {
20: $domain = $GLOBALS['vilma']->driver->getDomain($vars->get('domain_id'));
21: }
22: $vars->add('name', $domain['domain_name']);
23: $vars->add('transport', $domain['domain_transport']);
24: $vars->add('max_users', $domain['domain_max_users']);
25: $vars->add('quota', $domain['domain_quota']);
26:
27:
28: $this->setButtons(true, true);
29: $this->addHidden('', 'domain_id', 'text', false);
30: $this->addVariable(_("Domain"), 'name', 'text', true);
31: $this->addVariable(_("Transport"), 'transport', 'enum', false, false, null, array(Horde_Array::valuesToKeys($GLOBALS['conf']['mta']['transports'])));
32: $this->addVariable(_("Max users"), 'max_users', 'int', false);
33: $this->addVariable(_("Quota"), 'quota', 'int', false, false, _("Value in MB"));
34: }
35: }
36: