/** * 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; }
/** * Ensure the share system has a default notepad share for the current user * if the default share feature is activated. * * @return string|NULL The id of the new default share or NULL if no share * was created. */ public function ensureDefaultShare() { /* If the user doesn't own a notepad, create one. */ if (!empty($this->_params['auto_create']) && $this->_user && !count(Mnemo::listNotepads(true))) { $share = $this->_shares->newShare($this->_user, strval(new Horde_Support_Randomid()), $this->_getDefaultShareName()); $this->_prepareDefaultShare($share); $this->_shares->addShare($share); return $share->getName(); } }
/** * Ensure the share system has a default tasklist share for the current user * if the default share feature is activated. * * @return string|NULL The id of the new default share or NULL if no share * was created. */ public function ensureDefaultShare() { /* If the user doesn't own a task list, create one. */ if (!empty($this->_params['auto_create']) && $this->_user && !count(Nag::listTasklists(true))) { $share = $this->_shares->newShare($this->_user, strval(new Horde_Support_Randomid()), $this->_getDefaultShareName()); $share->set('color', Nag::randomColor()); $this->_prepareDefaultShare($share); $this->_shares->addShare($share); return $share->getName(); } }