1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: class Whups_Form_Admin_DefaultState extends Horde_Form
15: {
16: public function __construct(&$vars)
17: {
18: parent::__construct($vars, _("Set Default State"));
19:
20: $this->setButtons(array(_("Set Default State")));
21:
22: $states = $GLOBALS['whups_driver']->getStates(
23: $vars->get('type'),
24: array('unconfirmed', 'new', 'assigned'));
25: if ($states) {
26: $stype = 'enum';
27: $type_params = array($states);
28: } else {
29: $stype = 'invalid';
30: $type_params = array(_("There are no states to edit"));
31: }
32:
33: $this->addHidden('', 'type', 'int', true, true);
34: $var = &$this->addVariable(
35: _("State Name"), 'state', $stype, false, false, null, $type_params);
36: $var->setDefault($GLOBALS['whups_driver']->getDefaultState($vars->get('type')));
37: }
38:
39: }
40: