1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: class Whups_Form_Admin_EditAttributeStepOne extends Horde_Form
15: {
16: public function __construct(&$vars)
17: {
18: parent::__construct($vars, _("Edit or Delete Attributes"));
19: $this->setButtons(array(_("Edit Attribute"), _("Delete Attribute")));
20:
21: $attributes = $GLOBALS['whups_driver']->getAttributesForType($vars->get('type'));
22: if ($attributes) {
23: $params = array();
24: foreach ($attributes as $key => $attribute) {
25: $params[$key] = $attribute['human_name'];
26: }
27: $stype = 'enum';
28: $type_params = array($params);
29: } else {
30: $stype = 'invalid';
31: $type_params = array(_("There are no attribute types to edit"));
32: }
33:
34: $this->addHidden('', 'type', 'int', true, true);
35: $this->addVariable(
36: _("Attribute Name"), 'attribute', $stype, true, false, null, $type_params);
37: }
38:
39: }