Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Dec 17, 2009
2 parents 4566c29 + 02b3c4e commit 9b3b9c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
14 changes: 9 additions & 5 deletions modules/gallery/controllers/quick.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,15 @@ public function form_edit($id) {
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;
}
}
11 changes: 10 additions & 1 deletion modules/gallery/models/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,16 @@ public function rename($new_name) {

@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()) {
Expand Down

0 comments on commit 9b3b9c6

Please sign in to comment.