User can set the import-path #187

This commit is contained in:
Tobias Reich 2014-07-23 21:58:41 +02:00
parent 6c142f8570
commit d991eef2c9
3 changed files with 18 additions and 13 deletions

View File

@ -198,7 +198,7 @@ upload = {
}
upload.show("Importing URL", files, function() {
$(".upload_message .rows .row:nth-child(1) .status").html("Importing");
$(".upload_message .rows .row .status").html("Importing");
});
params = "importUrl&url=" + escape(encodeURI(link)) + "&albumID=" + albumID;
@ -229,21 +229,26 @@ upload = {
var albumID = album.getID(),
params,
buttons,
files = [];
files = [],
path;
if (albumID===false) albumID = 0;
buttons = [
["Import", function() {
path = $(".message input.text").val();
files[0] = {
name: "uploads/import/",
name: path,
supported: true
};
upload.show("Importing from server", files);
upload.show("Importing from server", files, function() {
$(".upload_message .rows .row .status").html("Importing");
});
params = "importServer&albumID=" + albumID;
params = "importServer&albumID=" + albumID + "&path=" + escape(encodeURI(path));
lychee.api(params, function(data) {
upload.close();
@ -266,7 +271,7 @@ upload = {
["Cancel", function() {}]
];
modal.show("Import from Server", "This action will import all photos and albums which are located in <b>'uploads/import/'</b> of your Lychee installation.", buttons);
modal.show("Import from Server", "This action will import all photos and albums which are located in the following directory: <input class='text' type='text' maxlength='100' placeholder='Absolute path to directory' value='" + lychee.location + "uploads/import/'>", buttons);
},

File diff suppressed because one or more lines are too long

View File

@ -208,8 +208,8 @@ class Admin extends Access {
private function importServer() {
Module::dependencies(isset($_POST['albumID']));
echo Import::server($_POST['albumID'], null);
Module::dependencies(isset($_POST['albumID'], $_POST['path']));
echo Import::server($_POST['albumID'], $_POST['path']);
}