1: <?php
2: 3: 4: 5: 6:
7:
8: class Ansel_Form_Ecard extends Horde_Form {
9:
10: protected $_useFormToken = false;
11:
12: public function __construct(&$vars, $title)
13: {
14: parent::Horde_Form($vars, $title);
15:
16: $this->setButtons(_("Send"));
17: $this->addHidden('', 'actionID', 'text', false);
18: $this->addHidden('', 'gallery', 'text', false);
19: $this->addHidden('', 'image', 'text', false);
20: $this->addHidden('', 'image_desc', 'text', false);
21:
22: $user = $GLOBALS['registry']->getAuth();
23: if (empty($user)) {
24: $this->addVariable(_("Use the following return address:"), 'ecard_retaddr', 'text', true);
25: } else {
26: $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
27: $from_addr = $identity->getDefaultFromAddress();
28: $vars->set('ecard_retaddr', $from_addr);
29: $this->addHidden('', 'ecard_retaddr', 'text', true);
30: }
31:
32: $this->addVariable(_("Send ecard to the following address:"), 'ecard_addr', 'text', true);
33: $this->addVariable(_("Comments:"), 'ecard_comments', 'longtext', false, false, null, array('15', '60'));
34: }
35:
36: }
37: