1: <?php
 2:  3:  4:  5:  6:  7:  8:  9: 
10: 11: 12: 13: 14: 15: 16: 
17: class Nag_Form_EditTaskList extends Horde_Form
18: {
19:     20: 21: 22: 23: 24: 
25:     protected $_tasklist;
26: 
27:     28: 29: 30: 31: 
32:     public function __construct($vars, Horde_Share_Object $tasklist)
33:     {
34:         $this->_tasklist = $tasklist;
35:         parent::__construct($vars, sprintf(_("Edit %s"), $tasklist->get('name')));
36:         $this->addHidden('', 't', 'text', true);
37:         $this->addVariable(_("Task List Name"), 'name', 'text', true);
38:         $this->addVariable(_("Task List Description"), 'description', 'longtext', false, false, null, array(4, 60));
39:         if ($GLOBALS['registry']->isAdmin()) {
40:             $this->addVariable(
41:                 _("System Task List"), 'system', 'boolean', false, false,
42:                 _("System task lists don't have an owner. Only administrators can change the task list settings and permissions.")
43:             );
44:         }
45:         $this->setButtons(array(_("Save")));
46:     }
47: 
48:     public function execute()
49:     {
50:         $info = array();
51:         foreach (array('name', 'color', 'description', 'system') as $key) {
52:             $info[$key] = $this->_vars->get($key);
53:         }
54:         return Nag::updateTasklist($this->_tasklist, $info);
55:     }
56: 
57: }
58: