[dev] [cvs] commit: ansel/lib api.php

Michael Rubinsky mike at theupstairsroom.com
Mon Jul 3 10:53:53 PDT 2006


Quoting Chuck Hagenbuch <chuck at horde.org>:
>
> So while I think it makes sense to use the datatree ids, I think we
> should "pretend" we don't they're datatree ids. They're just a gallery
> id.

OK.  What confused me, in  _ansel_saveImage, the $gallery_id parameter  
is, I now see, assumed to be the gallery id (datatree_id) *unless* the  
gallery doesn't exist yet.  Then, it is passed to Ansel::createGallery  
which uses it as the gallery_name (share name) to use when creating  
the gallery.

My thought is that we should remove the code from _ansel_saveImage  
that creates the gallery if it does not exist and return a PEAR_Error,  
in other words, require a valid gallery_id when saving an image...and  
now that there is a _ansel_addGallery() in the api, we really aren't  
losing any functionality.  I don't believe IMP allows you to create a  
gallery when importing image attachments, but I'm not sure about any  
other apps yet...

Thoughts?


> So if in your app it's possible to create the gallery, have that
> gallery creation return a gallery id, ideally you should store that id
> and use it, thus letting us ignore the datatree_name completely. This
> is even better for the api, because we can move Ansel away from the
> datatree without breaking the API as long as we preserve gallery ids.

Sounds good.  I'll change _ansel_addGallery to return the gallery_id then.


Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org



More information about the dev mailing list