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