1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13: 14: 15: 16: 17:
18: class Kronolith_Form_DeleteCalendar extends Horde_Form
19: {
20: 21: 22:
23: protected $_calendar;
24:
25: public function __construct($vars, $calendar)
26: {
27: $this->_calendar = $calendar;
28: parent::__construct($vars, sprintf(_("Delete %s"), $calendar->get('name')));
29:
30: $this->addHidden('', 'c', 'text', true);
31: $this->addVariable(sprintf(_("Really delete the calendar \"%s\"? This cannot be undone and all data on this calendar will be permanently removed."), $this->_calendar->get('name')), 'desc', 'description', false);
32:
33: $this->setButtons(array(_("Delete"), _("Cancel")));
34: }
35:
36: 37: 38:
39: public function execute()
40: {
41:
42: if ($this->_vars->get('submitbutton') == _("Cancel")) {
43: return false;
44: }
45:
46: return Kronolith::deleteShare($this->_calendar);
47: }
48:
49: }
50: