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