diff --git a/lib/googleapi.php b/lib/googleapi.php index 33c3a045bc9..a079ffb5d2f 100644 --- a/lib/googleapi.php +++ b/lib/googleapi.php @@ -379,6 +379,7 @@ class google_picasa { const MANAGE_URL = 'http://picasaweb.google.com/'; private $google_curl = null; + private $lastalbumname = null; /** * Constructor. @@ -454,6 +455,15 @@ class google_picasa { return $this->get_photo_details($albumcontent); } + /** + * Returns the name of the album for which get_photo_details was called last time. + * + * @return string + */ + public function get_last_album_name() { + return $this->lastalbumname; + } + /** * Does text search on the users photos and returns * matches in format for picasa api @@ -486,7 +496,7 @@ class google_picasa { //hacky... $thumbnailinfo = $mediainfo->group->thumbnail[0]->attributes(); - $files[] = array( 'title' => (string) $gphoto->name, + $files[] = array( 'title' => (string) $album->title, 'date' => userdate($gphoto->timestamp), 'size' => (int) $gphoto->bytesUsed, 'path' => (string) $gphoto->id, @@ -511,6 +521,7 @@ class google_picasa { public function get_photo_details($rawxml){ $xml = new SimpleXMLElement($rawxml); + $this->lastalbumname = (string)$xml->title; $files = array(); diff --git a/repository/picasa/lib.php b/repository/picasa/lib.php index 2566d991482..bd43d848242 100644 --- a/repository/picasa/lib.php +++ b/repository/picasa/lib.php @@ -86,6 +86,10 @@ class repository_picasa extends repository { $ret['dynload'] = true; $ret['manage'] = google_picasa::MANAGE_URL; $ret['list'] = $picasa->get_file_list($path); + $ret['path'] = array((object)array('name'=>get_string('home'), 'path' => '')); + if ($path) { + $ret['path'][] = (object)array('name'=>$picasa->get_last_album_name(), 'path' => $path); + } return $ret; }