silverstripe-picasaweb 

silverstripe-picasaweb Commit Details

Date:2013-05-06 22:43:06 (7 years 11 months ago)
Author:Nicola Fontana
Branch:master
Commit:9afd80e6825a2c90631c029278e62851faf9a5ff
Parents: 88a6e01356200591d86839ed03d9f6f8b5014218
Message:Using a more consistent URL

Changes:
Mcode/Picasaweb.php (2 diffs)

File differences

code/Picasaweb.php
265265
266266
267267
268
268
269269
270270
271271
......
277277
278278
279279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
280
281
282
283
284
285
286
287
297288
298
289
299290
300291
301292
}
/**
* Build a Picasaweb URL.
* Build a Picasaweb API URL.
*
* Entry point for building the Picasaweb URL from its components
* conforming to the Picasaweb API version 2.0.
* @return String The API URL or null on errors.
*/
private static function apiUrl($user, $album, $photo = null) {
$url = null;
// The user is always required by the Picasaweb API
if (isset($user)) {
$domain = 'http://picasaweb.google.com';
$user = "/user/$user";
empty($album) or $album = self::isId($album) ? "/albumid/$album" : "/album/$album";
empty($photo) or $photo = self::isId($photo) ? "/photoid/$photo" : "/photo/$photo";
if (isset($photo)) {
// Photo URL
$url = "$domain/data/entry/api$user$album$photo";
} elseif (isset($album)) {
// Album URL
$url = "$domain/data/feed/api$user$album";
}
}
// The user is always required by the Picasaweb API, together
// with an album or a photo id to identify the subject
if (empty($user) || empty($album) && empty($photo))
return null;
$user = "/user/$user";
empty($album) or $album = self::isId($album) ? "/albumid/$album" : "/album/$album";
empty($photo) or $photo = self::isId($photo) ? "/photoid/$photo" : "/photo/$photo";
return $url;
return "http://picasaweb.google.com/data/feed/api$user$album$photo";
}
/**

Archive Download the corresponding diff file

Branches