Merge branch 'wip-MDL-32416-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Aparup Banerjee 2012-05-03 11:33:55 +08:00
commit b21a1d4086
2 changed files with 16 additions and 1 deletions

View File

@ -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();

View File

@ -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;
}