1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: class Whups_Form_Admin_DeleteType extends Horde_Form
15: {
16: public function __construct(&$vars)
17: {
18: global $whups_driver;
19:
20: parent::__construct($vars, _("Delete Type Confirmation"));
21:
22: $type = $vars->get('type');
23: $info = $whups_driver->getType($type);
24:
25: $this->addHidden('', 'type', 'int', true, true);
26:
27: $tname = &$this->addVariable(
28: _("Type Name"), 'name', 'text', false, true);
29: $tname->setDefault($info['name']);
30:
31: $tdesc = &$this->addVariable(
32: _("Type Description"), 'description', 'text', false, true);
33: $tdesc->setDefault($info['description']);
34:
35: $states = $whups_driver->getStates($type);
36: $tstates = &$this->addVariable(
37: _("States for this Type"), 'state', 'set', false, true, null, array($states));
38: $tstates->setDefault(array_keys($states));
39:
40: $priorities = $whups_driver->getPriorities($type);
41: $tpriorities = &$this->addVariable(
42: _("Priorities for this Type"), 'priority', 'set', false, true, null,
43: array($priorities));
44: $tpriorities->setDefault(array_keys($priorities));
45:
46: $yesno = array(array(0 => _("No"), 1 => _("Yes")));
47: $this->addVariable(
48: _("Really delete this type? This may cause data problems!"),
49: 'yesno', 'enum', true, false, null, $yesno);
50: }
51:
52: }