/** * Create the default calendar share for the current user. * * @return Horde_Share_Object The new default share. */ public function createDefaultShare() { $share = $this->_shares->newShare($this->_user, strval(new Horde_Support_Randomid()), $this->_getDefaultShareName()); $share->set('color', Kronolith::randomColor()); $this->_prepareDefaultShare($share); $this->_shares->addShare($share); return $share; }
public function __construct($vars) { parent::__construct($vars, _("Create Calendar")); $this->addVariable(_("Name"), 'name', 'text', true); $v = $this->addVariable(_("Color"), 'color', 'colorpicker', false); $v->setDefault(Kronolith::randomColor()); if ($GLOBALS['registry']->isAdmin()) { $this->addVariable(_("System Calendar"), 'system', 'boolean', false, false, _("System calendars don't have an owner. Only administrators can change the calendar settings and permissions.")); } $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60)); $this->addVariable(_("Tags"), 'tags', 'kronolith:KronolithTags', false); $this->setButtons(array(_("Create"))); }