summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-12-16 20:14:03 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-12-16 20:14:03 -0800
commitcd0bf67441e8de9f32342dd0fb486976a8661d8b (patch)
treecb26652b182bbeb2bf8831770be2a2875aa43e6e
parent0d4c808b8ed3f75168bc73dfd4bec700542e0f43 (diff)
parent02b3c4e70478519e3baa7df80fefd19ebdd6e2e3 (diff)
Merge branch 'master' into talmdal_dev
-rw-r--r--modules/gallery/controllers/quick.php14
-rw-r--r--modules/gallery/models/item.php11
2 files changed, 19 insertions, 6 deletions
diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php
index f2a77033..7f1ad43b 100644
--- a/modules/gallery/controllers/quick.php
+++ b/modules/gallery/controllers/quick.php
@@ -131,11 +131,15 @@ class Quick_Controller extends Controller {
access::required("view", $item);
access::required("edit", $item);
- if ($item->is_album()) {
- $form = album::get_edit_form($item);
- } else {
- $form = photo::get_edit_form($item);
+ switch ($item->type) {
+ case "album":
+ return print album::get_edit_form($item);
+
+ case "photo":
+ return print photo::get_edit_form($item);
+
+ case "movie":
+ return print movie::get_edit_form($item);
}
- print $form;
}
}
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index d27e331b..96415b3d 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -157,7 +157,16 @@ class Item_Model extends ORM_MPTT {
@rename(VARPATH . "albums/$old_relative_path", VARPATH . "albums/$new_relative_path");
@rename(VARPATH . "resizes/$old_relative_path", VARPATH . "resizes/$new_relative_path");
- @rename(VARPATH . "thumbs/$old_relative_path", VARPATH . "thumbs/$new_relative_path");
+ if ($this->is_movie()) {
+ // Movie thumbnails have a .jpg extension
+ $old_relative_thumb_path = preg_replace("/...$/", "jpg", $old_relative_path);
+ $new_relative_thumb_path = preg_replace("/...$/", "jpg", $new_relative_path);
+ @rename(VARPATH . "thumbs/$old_relative_thumb_path",
+ VARPATH . "thumbs/$new_relative_thumb_path");
+ } else {
+ @rename(VARPATH . "thumbs/$old_relative_path", VARPATH . "thumbs/$new_relative_path");
+ }
+
$this->name = $new_name;
if ($this->is_album()) {