summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-06-09 16:18:47 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-06-09 16:18:47 -0700
commit08d8d320466f676e74a7c04a2fe874fd3a568429 (patch)
tree3c1f892147f40ae519c992b37142bc90813eca45
parent65e73f181b721a582b98b500fc12aa80272def8a (diff)
Changed how directories are processed when the parent directory is selected and
the branch was never opened on the client. This should fix some of the issues with the server_add as I was able to select the staging directory and then add over 400 images in a multi-tier structure.
-rw-r--r--modules/server_add/controllers/server_add.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php
index 2c6eb5e0..c92b4f7e 100644
--- a/modules/server_add/controllers/server_add.php
+++ b/modules/server_add/controllers/server_add.php
@@ -87,17 +87,20 @@ class Server_Add_Controller extends Controller {
foreach (array_keys($paths) as $valid_path) {
$path_length = strlen($valid_path);
foreach ($input_files as $key => $path) {
- if (!empty($path) && $valid_path != $path && strpos($path, $valid_path) === 0) {
- $relative_path = substr(dirname($path), $path_length);
- $name = basename($path);
- $files[$valid_path][] = array("path" => $relative_path,
- "parent_id" => $id, "name" => basename($path),
+ if (!empty($path)) {
+ if ($valid_path != $path && strpos($path, $valid_path) === 0) {
+ $relative_path = substr(dirname($path), $path_length);
+ $name = basename($path);
+ $files[$valid_path][] = array("path" => $relative_path,
+ "parent_id" => $id, "name" => basename($path),
"type" => is_dir($path) ? "album" : "file");
- $total_count++;
+ $total_count++;
+ }
if ($collapsed[$key] === "true") {
$total_count += $this->_select_children($id, $valid_path, $path, $files[$valid_path]);
}
unset($input_files[$key]);
+ unset($collapsed[$key]);
}
}
}