1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10: 11: 12: 13: 14: 15:
16: class Mnemo_Form_EditNotepad extends Horde_Form
17: {
18: 19: 20:
21: protected $_notepad;
22:
23: public function __construct(&$vars, $notepad)
24: {
25: $this->_notepad = &$notepad;
26: parent::__construct($vars, sprintf(_("Edit %s"), $notepad->get('name')));
27:
28: $this->addHidden('', 'n', 'text', true);
29: $this->addVariable(_("Name"), 'name', 'text', true);
30: $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
31:
32: $this->setButtons(array(_("Save")));
33: }
34:
35: public function execute()
36: {
37: $this->_notepad->set('name', $this->_vars->get('name'));
38: $this->_notepad->set('desc', $this->_vars->get('description'));
39: $this->_notepad->save();
40:
41: return true;
42: }
43:
44: }
45: