/** * Check if a gallery exists. Need to do this here so we can also check by * gallery slug. * * @param integer $gallery_id The gallery id * @param string $slug The gallery slug * * @return boolean * @throws Ansel_Exception */ public function galleryExists($gallery_id = null, $slug = null) { if (empty($slug)) { $results = $this->_shares->idExists($gallery_id); } else { $results = $this->_shares->countShares($GLOBALS['registry']->getAuth(), Horde_Perms::READ, array('slug' => $slug)); } return (bool) $results; }