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