summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-22 10:13:31 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-22 10:13:31 -0700
commit6a4d175b85567cb54938bce0fa0628b222875ee3 (patch)
tree82b4cf69a7cd84efdd8cb71e19e309f816008996
parent51a69d7218de1cb4e82872e64560d4e3d3a01f8d (diff)
parente906e6bcbd6ed99b1029d4ceae45c03d77edc9ff (diff)
Merge branch 'master' into talmdal_dev
-rw-r--r--modules/gallery/controllers/albums.php4
-rw-r--r--modules/gallery/controllers/photos.php4
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index 9480a037..fabf67ce 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -200,6 +200,8 @@ class Albums_Controller extends Items_Controller {
}
if ($valid) {
+ $watching_album = $album->url() != ($location = parse_url(request::referrer(), PHP_URL_PATH));
+
$album->title = $form->edit_item->title->value;
$album->description = $form->edit_item->description->value;
$album->sort_column = $form->edit_item->sort_order->column->value;
@@ -217,7 +219,7 @@ class Albums_Controller extends Items_Controller {
print json_encode(
array("result" => "success",
- "location" => $album->url()));
+ "location" => $watching_album ? $location : $album->url()));
} else {
print json_encode(
array("result" => "error",
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index 6bb5af89..54cd63c6 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -100,6 +100,8 @@ class Photos_Controller extends Items_Controller {
}
if ($valid) {
+ $watching_album = $photo->url() != ($location = parse_url(request::referrer(), PHP_URL_PATH));
+
$photo->title = $form->edit_item->title->value;
$photo->description = $form->edit_item->description->value;
$photo->slug = $form->edit_item->slug->value;
@@ -114,7 +116,7 @@ class Photos_Controller extends Items_Controller {
print json_encode(
array("result" => "success",
- "location" => $photo->url()));
+ "location" => $watching_album ? $location : $photo->url()));
} else {
print json_encode(
array("result" => "error",