1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13: 14: 15: 16: 17:
18: class Kronolith_Form_EditCalendar 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(_("Edit %s"), $calendar->get('name')));
29:
30: $this->addHidden('', 'c', 'text', true);
31: $this->addVariable(_("Name"), 'name', 'text', true);
32: $this->addVariable(_("Color"), 'color', 'colorpicker', false);
33: $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
34: $this->addVariable(_("Tags"), 'tags', 'text', false);
35: if ($GLOBALS['registry']->isAdmin()) {
36: $this->addVariable(_("System Calendar"), 'system', 'boolean', false, false, _("System calendars don't have an owner. Only administrators can change the calendar settings and permissions."));
37: }
38:
39: $this->setButtons(array(_("Save")));
40: }
41:
42: 43: 44:
45: public function execute()
46: {
47: $info = array();
48: foreach (array('name', 'color', 'description', 'tags', 'system') as $key) {
49: $info[$key] = $this->_vars->get($key);
50: }
51: return Kronolith::updateShare($this->_calendar, $info);
52: }
53:
54: }
55: