Example #1
0
 /**
  * Get all children of this share.
  *
  * @param string $user        The user to use for checking perms
  * @param integer $perm       Horde_Perms::* constant. If NULL will return
  *                            all shares regardless of permissions.
  * @param boolean $allLevels  Return all levels.
  *
  * @return array  An array of Ansel_Gallery objects
  * @throws Ansel_Exception
  */
 public function getChildren($user, $perm = Horde_Perms::SHOW, $allLevels = true)
 {
     try {
         return $GLOBALS['injector']->getInstance('Ansel_Storage')->buildGalleries($this->_share->getChildren($user, $perm, $allLevels));
     } catch (Horde_Share_Exception $e) {
         throw new Ansel_Exception($e);
     }
 }
Example #2
0
 /**
  * Removes a share from the shares system permanently.
  *
  * @param Horde_Share_Object $share  The share to remove.
  *
  * @throws Horde_Share_Exception
  */
 public function removeShare(Horde_Share_Object $share)
 {
     // First Remove Children
     foreach ($share->getChildren(null, null, true) as $child) {
         $this->removeShare($child);
     }
     // Run the results through the callback, if configured.
     $this->runCallback('remove', array($share));
     /* Remove share from the caches. */
     $id = $share->getId();
     unset($this->_shareMap[$id]);
     unset($this->_cache[$share->getName()]);
     /* Reset caches that depend on unknown criteria. */
     $this->expireListCache();
     $this->_removeShare($share);
 }