mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch 'wip-MDL-32416-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
commit
b21a1d4086
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user