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