How does one navigate sub-albums programmatically? If I call getAlums on a gallery, it only gives me the high level albums. I called getNumAlbums() on an album that had sub albums and got the count of the albums. The getNext and getPrev functions only return albums at the same level. What do I call to get a sub album object?
Comments
http://www.zenphoto.org/news/zenphotos-object-model-framework
Here's the code I have so far
$gallery = new Gallery();
$numAlbums = $gallery->getNumAlbums();
$gallery->getAlbums();
for ($i = 0; $i < $numAlbums; $i++)
{
$album = $gallery->getAlbum($i);
$title = $album->getTitle(); echo $title;
if ($title == "Flora and Fauna") break;
}
$floraAndFauna = $album->getAlbums();
$numSubAlbums = $album->getNumAlbums();
The method getAlbums returns the names of the sub albums. The method getNumAlbums returns the number of the sub albums. I need a pointer to the sub album object. There's a method getParent that would presumably get me the parent of a sub album so there must be a way to get to the child.
If you want to create an object of a subalbum the name must include the parent album name(s) like "toplalbumfoldername/subalbum1folder/subalbum2folder" (etc);
This would work if I was willing to hard code the name of one of the sub albums. I want the code to be dynamic in that it would process any sub album it found if any.