newShare() публичный Метод

Returns a new share object.
public newShare ( string $owner, string $share_name = '', string $name_attribute = '' ) : Horde_Share_Object
$owner string The share owner name.
$share_name string The share's name.
$name_attribute string The name displayed to the user.
Результат Horde_Share_Object A new share object.
Пример #1
0
 /**
  * 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
 /**
  * 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
 /**
  * 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();
     }
 }