1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13: 14: 15: 16: 17:
18: class Kronolith_Form_UnsubscribeRemoteCalendar extends Horde_Form
19: {
20: public function __construct($vars, $calendar)
21: {
22: parent::__construct($vars, sprintf(_("Unsubscribe from %s"), $calendar['name']));
23:
24: $this->addHidden('', 'url', 'text', true);
25: $this->addVariable(sprintf(_("Really unsubscribe from the calendar \"%s\" (%s)?"), $calendar['name'], $calendar['url']), 'desc', 'description', false);
26:
27: $this->setButtons(array(_("Unsubscribe"), _("Cancel")));
28: }
29:
30: 31: 32:
33: public function execute()
34: {
35:
36: if ($this->_vars->get('submitbutton') == _("Cancel")) {
37: return false;
38: }
39: return Kronolith::unsubscribeRemoteCalendar($this->_vars->get('url'));
40: }
41:
42: }
43: