if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) { $error = _("Access denied adding photos to this gallery."); } else { $error = false; } } catch (Ansel_Exception $e) { $error = _("There was an error accessing the gallery."); } } if (!$name || $error) { $error = _("No file specified"); } else { try { $GLOBALS['browser']->wasFileUploaded('imagefile', _("photo")); try { $image = Ansel::getImageFromFile($file, array('image_filename' => $name)); } catch (Ansel_Exception $e) { $error = $e->getMessage(); } $gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery($galleryId); try { $image_id = $gallery->addImage($image); $error = false; } catch (Ansel_Exception $e) { $error = _("There was a problem uploading the photo."); } } catch (Horde_Browser_Exception $e) { $error = $e->getMessage(); } } if ($error) {