1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13:
14: class Hermes_Form_Admin_EditJobTypeStepOne extends Horde_Form
15: {
16:
17: public function __construct(&$vars)
18: {
19: parent::__construct($vars, 'editjobtypestep1form');
20:
21: $values = array();
22: try {
23: $jobtypes = $GLOBALS['injector']
24: ->getInstance('Hermes_Driver')
25: ->listJobTypes();
26: foreach ($jobtypes as $id => $jobtype) {
27: $values[$id] = $jobtype['name'];
28: if (empty($jobtype['enabled'])) {
29: $values[$id] .= _(" (DISABLED)");
30: }
31: }
32: } catch (Hermes_Exception $e) {}
33:
34: if ($values) {
35: $subtype = 'enum';
36: $type_params = array($values);
37: } else {
38: $subtype = 'invalid';
39: $type_params = array(_("There are no job types to edit"));
40: }
41:
42: $this->addVariable(_("JobType Name"), 'jobtype', $subtype, true, false, null, $type_params);
43: }
44:
45: }