1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: class Sesha_Forms_PropertyList extends Horde_Form
13: {
14: function __construct($vars)
15: {
16: parent::Horde_Form($vars);
17:
18:
19: $sesha_driver = $GLOBALS['injector']->getInstance('Sesha_Factory_Driver')->create();
20: $this->setButtons(array(_("Edit Property"), _("Delete Property")));
21: $properties = $sesha_driver->getProperties();
22: $params = array();
23: foreach ($properties as $property) {
24: $params[$property['property_id']] = $property['property'];
25: }
26: $title = !empty($title) ? $title : _("Edit a property");
27: $this->setTitle($title);
28:
29: $this->addHidden('', 'actionID', 'text', false, false, null, array('edit_property'));
30: if (!count($params)) {
31: $fieldtype = 'invalid';
32: $params = _("No properties are currently configured. Use the form below to add one.");
33: } else {
34: $fieldtype = 'enum';
35: }
36: $this->addVariable(_("Property"), 'property_id', $fieldtype, true, false, null, array($params));
37: }
38:
39: }
40: