Renamed Photo::getArchive to Photo::getPhoto.

pull/646/head
Nils Asmussen 8 years ago
parent 7fd74462e2
commit 9088c1ed2c

@ -120,8 +120,8 @@ These hooks are called from `php/modules/Photo.php`.
| Photo::get:after | | | Photo::get:after | |
| Photo::getInfo:before | Lychee reads the metadata of an image | | Photo::getInfo:before | Lychee reads the metadata of an image |
| Photo::getInfo:after | | | Photo::getInfo:after | |
| Photo::getArchive:before | User downloads photo | | Photo::getPhoto:before | User downloads photo |
| Photo::getArchive:after | | | Photo::getPhoto:after | |
| Photo::setTitle:before | User renames photo | | Photo::setTitle:before | User renames photo |
| Photo::setTitle:after | | | Photo::setTitle:after | |
| Photo::setDescription:before | User sets description | | Photo::setDescription:before | User sets description |

@ -61,7 +61,7 @@ final class Admin extends Access {
// $_GET functions // $_GET functions
case 'Album::getArchive': self::getAlbumArchiveAction(); break; case 'Album::getArchive': self::getAlbumArchiveAction(); break;
case 'Photo::getArchive': self::getPhotoArchiveAction(); break; case 'Photo::getPhoto': self::getPhotoFileAction(); break;
} }
@ -341,12 +341,12 @@ final class Admin extends Access {
} }
private static function getPhotoArchiveAction() { private static function getPhotoFileAction() {
Validator::required(isset($_GET['photoID']), __METHOD__); Validator::required(isset($_GET['photoID']), __METHOD__);
$photo = new Photo($_GET['photoID']); $photo = new Photo($_GET['photoID']);
$photo->getArchive(); $photo->getPhoto();
} }

@ -32,7 +32,7 @@ final class Guest extends Access {
// $_GET functions // $_GET functions
case 'Album::getArchive': self::getAlbumArchiveAction(); break; case 'Album::getArchive': self::getAlbumArchiveAction(); break;
case 'Photo::getArchive': self::getPhotoArchiveAction(); break; case 'Photo::getPhoto': self::getPhotoFileAction(); break;
} }
@ -159,7 +159,7 @@ final class Guest extends Access {
} }
private static function getPhotoArchiveAction() { private static function getPhotoFileAction() {
Validator::required(isset($_GET['photoID'], $_GET['password']), __METHOD__); Validator::required(isset($_GET['photoID'], $_GET['password']), __METHOD__);
@ -171,7 +171,7 @@ final class Guest extends Access {
if ($pgP===2) { if ($pgP===2) {
// Photo Public // Photo Public
$photo->getArchive(); $photo->getPhoto();
} else { } else {

@ -889,9 +889,9 @@ final class Photo {
/** /**
* Starts a download of a photo. * Starts a download of a photo.
* @return resource|boolean Sends a ZIP-file or returns false on failure. * @return resource|boolean Sends the photo or returns false on failure.
*/ */
public function getArchive() { public function getPhoto() {
// Check dependencies // Check dependencies
Validator::required(isset($this->photoIDs), __METHOD__); Validator::required(isset($this->photoIDs), __METHOD__);

@ -310,7 +310,7 @@ contextMenu.photoMore = function(photoID, e) {
let items = [ let items = [
{ title: build.iconic('fullscreen-enter') + 'Full Photo', fn: () => window.open(photo.getDirectLink()) }, { title: build.iconic('fullscreen-enter') + 'Full Photo', fn: () => window.open(photo.getDirectLink()) },
{ title: build.iconic('cloud-download') + 'Download', visible: showDownload, fn: () => photo.getArchive(photoID) } { title: build.iconic('cloud-download') + 'Download', visible: showDownload, fn: () => photo.getPhoto(photoID) }
] ]
basicContext.show(items, e.originalEvent) basicContext.show(items, e.originalEvent)

@ -633,10 +633,10 @@ photo.share = function(photoID, service) {
} }
photo.getArchive = function(photoID) { photo.getPhoto = function(photoID) {
let link let link
let url = `${ api.path }?function=Photo::getArchive&photoID=${ photoID }` let url = `${ api.path }?function=Photo::getPhoto&photoID=${ photoID }`
if (location.href.indexOf('index.html')>0) link = location.href.replace(location.hash, '').replace('index.html', url) if (location.href.indexOf('index.html')>0) link = location.href.replace(location.hash, '').replace('index.html', url)
else link = location.href.replace(location.hash, '') + url else link = location.href.replace(location.hash, '') + url

Loading…
Cancel
Save