1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13: 14: 15: 16: 17:
18: class Kronolith_Form_EditRemoteCalendar extends Horde_Form
19: {
20: public function __construct($vars, $remote_calendar)
21: {
22: parent::__construct($vars, sprintf(_("Edit %s"), $remote_calendar['name']));
23:
24: $this->addHidden('', 'url', 'text', true);
25: $this->addVariable(_("Name"), 'name', 'text', true);
26: $v = &$this->addVariable(_("URL"), 'new_url', 'text', true);
27: $v->setDefault($vars->get('url'));
28: $this->addVariable(_("Username"), 'user', 'text', false);
29: $this->addVariable(_("Password"), 'password', 'password', false);
30: $this->addVariable(_("Color"), 'color', 'colorpicker', false);
31: $this->addVariable(_("Description"), 'desc', 'longtext', false, false, null, array(4, 60));
32:
33: $this->setButtons(array(_("Save")));
34: }
35:
36: 37: 38:
39: public function execute()
40: {
41: $info = array();
42: foreach (array('name', 'new_url', 'user', 'password', 'color', 'desc') as $key) {
43: $info[$key == 'new_url' ? 'url' : $key] = $this->_vars->get($key);
44: }
45: Kronolith::subscribeRemoteCalendar($info, trim($this->_vars->get('url')));
46: }
47:
48: }
49: