finding parent/full path name

jerryh

Joined: 2013-02-04
Posts: 27
Posted: Fri, 2013-04-05 18:56

I am trying to find the parent path name (like you see in the UI programmitcally) in the album I am uploading into.

I've been looking through the code with very little luck. I've done some searching, but the results have not led me to what I am looking for.

I have tried fetchPath() but that is returning to me the path of item I am loading ($archiveItem). When I try to get ParentId of archiveItem, it appears to be moving up the archiveItem chain.

$archiveItem->fetchPath(); // returns the item that I inserting to albums (path)
$parentId->fetchPath(); // returning parent of the archiveitem but not giving me waht I want. Still path relative to $archiveItem.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2013-04-05 22:51
list($ret, $parent) = GalleryCoreApi::loadEntitiesById($archiveItem->getParentId(), 'GalleryItem');
if ($ret) {
    die("Error loading parent:".$ret->getAsHtml());
}
list($ret, $path) = $parent->fetchPath();
if ($ret) {
    die("Error fetching path for parent:".$ret->getAsHtml());
}

die($path);

-s
________________________________
All New jQuery Minislideshow for G2/G3