addShare() 공개 메소드

The share must first be created with newShare(), and have any initial details added to it, before this function is called.
public addShare ( Horde_Share_Object $share )
$share Horde_Share_Object The new share object.
예제 #1
0
파일: Base.php 프로젝트: DSNS-LAB/Dmail
 /**
  * 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;
 }
예제 #2
0
파일: Base.php 프로젝트: DSNS-LAB/Dmail
 /**
  * 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();
     }
 }
예제 #3
0
파일: Base.php 프로젝트: DSNS-LAB/Dmail
 /**
  * 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();
     }
 }