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