From a5af531fbee1db0c3a0ae0d23388245b2d2ec2de Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 17 Sep 2009 07:04:11 -0700 Subject: Don't show links as part of the auto complete list --- modules/server_add/controllers/admin_server_add.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/server_add/controllers/admin_server_add.php b/modules/server_add/controllers/admin_server_add.php index 7cd82d60..38190fee 100644 --- a/modules/server_add/controllers/admin_server_add.php +++ b/modules/server_add/controllers/admin_server_add.php @@ -36,7 +36,7 @@ class Admin_Server_Add_Controller extends Admin_Controller { if ($form->validate()) { if (is_link($form->add_path->path->value)) { $form->add_path->path->add_error("is_symlink", 1); - } else if (! is_readable($form->add_path->path->value)) { + } else if (!is_readable($form->add_path->path->value)) { $form->add_path->path->add_error("not_readable", 1); } else { $path = $form->add_path->path->value; @@ -73,7 +73,7 @@ class Admin_Server_Add_Controller extends Admin_Controller { $directories = array(); $path_prefix = $this->input->get("q"); foreach (glob("{$path_prefix}*") as $file) { - if (is_dir($file)) { + if (is_dir($file) && !is_link($file)) { $directories[] = $file; } } -- cgit v1.2.3 From 88c374dee8b63957b7523850508c9bd7b8c4f100 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Thu, 17 Sep 2009 10:01:15 -0700 Subject: Arg, fixing the "Sharing your Translations" text, thanks engineer@gmc --- modules/gallery/views/admin_languages.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php index ab370f88..fb30c7ba 100644 --- a/modules/gallery/views/admin_languages.html.php +++ b/modules/gallery/views/admin_languages.html.php @@ -98,6 +98,6 @@ -

t("Sharing your translations")

+

-- cgit v1.2.3 From be1d49d017a71ee0967c47325986f482532a4f16 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 17 Sep 2009 10:55:50 -0700 Subject: Change the timeout on resubmitting the next task iteration to 25ms instead of. This allows the jQuery.ajax method to complete its processing. Otherwise, the browser can spend time thrashing around trying to send the next request. --- modules/server_add/js/server_add.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/server_add/js/server_add.js b/modules/server_add/js/server_add.js index 51ef41a7..4c411715 100644 --- a/modules/server_add/js/server_add.js +++ b/modules/server_add/js/server_add.js @@ -39,7 +39,7 @@ function start_add() { success: function(data, textStatus) { $("#gStatus").html(data.status); $("#gServerAdd .gProgressBar").progressbar("value", data.percent_complete); - setTimeout(function() { run_add(data.url); }, 0); + setTimeout(function() { run_add(data.url); }, 25); } }); return false; @@ -56,7 +56,7 @@ function run_add(url) { if (data.done) { $("#gServerAddProgress").slideUp(); } else { - setTimeout(function() { run_add(url); }, 0); + setTimeout(function() { run_add(url); }, 25); } } }); -- cgit v1.2.3 From c7f8d8be6fe9e15b11ef781bdd6ed279fcb5f1a4 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 17 Sep 2009 10:57:22 -0700 Subject: Don't try to creat an album that corresponds to the staging directory. Just add the contents of the staging directlyinto the album that server_add was invoked from. Fixes ticket #785 --- modules/server_add/controllers/server_add.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 26b3bd08..9769cd6f 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -137,17 +137,25 @@ class Server_Add_Controller extends Admin_Controller { // form [path, parent_id] where the parent_id refers to another Server_Add_File_Model. We // have this extra level of abstraction because we don't know its Item_Model id yet. $queue = $task->get("queue"); + $paths = unserialize(module::get_var("server_add", "authorized_paths")); + while ($queue && microtime(true) - $start < 0.5) { list($file, $parent_entry_id) = array_shift($queue); - $entry = ORM::factory("server_add_file"); - $entry->task_id = $task->id; - $entry->file = $file; - $entry->parent_id = $parent_entry_id; - $entry->save(); + // Ignore the staging directories as directories to be imported. + if (empty($paths[$file])) { + $entry = ORM::factory("server_add_file"); + $entry->task_id = $task->id; + $entry->file = $file; + $entry->parent_id = $parent_entry_id; + $entry->save(); + $entry_id = $entry->id; + } else { + $entry_id = null; + } foreach (glob("$file/*") as $child) { if (is_dir($child)) { - $queue[] = array($child, $entry->id); + $queue[] = array($child, $entry_id); } else { $ext = strtolower(pathinfo($child, PATHINFO_EXTENSION)); if (in_array($ext, array("gif", "jpeg", "jpg", "png", "flv", "mp4")) && @@ -155,7 +163,7 @@ class Server_Add_Controller extends Admin_Controller { $child_entry = ORM::factory("server_add_file"); $child_entry->task_id = $task->id; $child_entry->file = $child; - $child_entry->parent_id = $entry->id; + $child_entry->parent_id = $entry_id; $child_entry->save(); } } -- cgit v1.2.3 From 6469763225b1f74bc5391f09446bcf280bea389e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 17 Sep 2009 11:10:15 -0700 Subject: Reload the album when server_add dialog is closed --- modules/server_add/views/server_add_tree_dialog.html.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules') diff --git a/modules/server_add/views/server_add_tree_dialog.html.php b/modules/server_add/views/server_add_tree_dialog.html.php index 8eb6e4df..dd4efd06 100644 --- a/modules/server_add/views/server_add_tree_dialog.html.php +++ b/modules/server_add/views/server_add_tree_dialog.html.php @@ -50,6 +50,7 @@ }); $("#gServerCloseButton").click(function(event) { $("#gDialog").dialog("close"); + window.location.reload(); }); }); -- cgit v1.2.3