diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-10 07:18:47 +0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-10 07:23:30 +0800 |
commit | b11ec14f2442cd92c4001e14afaadff80bff4ffb (patch) | |
tree | 3c1f892147f40ae519c992b37142bc90813eca45 /modules/server_add/controllers/server_add.php | |
parent | 3c3a65b5a76c2cb53fe143f2b89d767b36dcafa2 (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.
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
Diffstat (limited to 'modules/server_add/controllers/server_add.php')
-rw-r--r-- | modules/server_add/controllers/server_add.php | 15 |
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]); } } } |