/** * Returns the fully-qualified URL for the given image resource * * @param int $elementId * @return string */ function getElementUrl($elementId) { global $mosConfig_live_site; $path = $mosConfig_live_site . GalleryService::G2ALBUM_BASE_URL; $parents = GalleryCoreApi::fetchParentSequence($elementId); if (isset($parents[1])) { foreach ($parents[1] as $nodeId) { $node = GalleryCoreApi::loadEntitiesById($nodeId); $comp = $node[1]->getPathComponent(); if ($comp != '') { $path .= "/" . $comp; } } } $self = GalleryCoreApi::loadEntitiesById($elementId); $path .= "/" . $self[1]->getPathComponent(); return $path; }