diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-22 16:14:10 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-22 16:14:10 +0000 |
commit | eece67611ef428a038b1d3e6ff35843d1b1f3470 (patch) | |
tree | 44f689e8e8cfb0a383b4ba7258eb13277a32c28b | |
parent | 1aa21cb2ab03766f7347ed2de371335961b7d5d6 (diff) |
Added "flv" to the list of the supported files
-rw-r--r-- | modules/local_import/controllers/local_import.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/modules/local_import/controllers/local_import.php b/modules/local_import/controllers/local_import.php index 9303c54f..3367bf7d 100644 --- a/modules/local_import/controllers/local_import.php +++ b/modules/local_import/controllers/local_import.php @@ -64,12 +64,19 @@ class Local_Import_Controller extends Controller { } $path = $this->input->post("path"); - + $pathinfo = pathinfo($path); set_time_limit(30); - $photo = photo::create($parent, $path, basename($path), basename($path)); - log::success("content", t("Added photo"), - html::anchor("photos/{$photo->id}", "View photo")); - message::success(t("Added photo %photo_title", array("photo_title" => $photo->title))); + if ($path_info["extension"] == "flv") { + $movie = movie::create($parent, $path, basename($path), basename($path)); + log::success("content", t("Added a movie"), + html::anchor("photos/{$photo->id}", t("view photo"))); + message::success(t("Added movie %movie_title", array("movie_title" => $movie->title))); + } else { + $photo = photo::create($parent, $path, basename($path), basename($path)); + log::success("content", t("Added a photo"), + html::anchor("photos/{$photo->id}", t("view photo"))); + message::success(t("Added photo %photo_title", array("photo_title" => $photo->title))); + } } private function _get_children($path) { @@ -85,7 +92,7 @@ class Local_Import_Controller extends Controller { $extension = strtolower(substr(strrchr($file, '.'), 1)); // Make sure the file is readable if (is_readable($full_path) && - in_array($extension, array("gif", "jpg", "jpeg", "png"))) { + in_array($extension, array("gif", "jpg", "jpeg", "png", "flv"))) { $file_list[$file] = array("path" => $full_path); } } |