summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-10-22 23:36:05 -0600
committerChad Kieffer <ckieffer@gmail.com>2009-10-22 23:36:05 -0600
commitda73c0c25f406ccef8351be06ab30fd0d71977b8 (patch)
tree807315a85edebfe19a07bf766f1764878966bd71 /modules/gallery/controllers
parent267c54d4381a9a8522e33f8d877b35adf0615e4c (diff)
Poor man's merge. Note to self, git pull before working. Next pound the steps to merge into your head.
Diffstat (limited to 'modules/gallery/controllers')
-rw-r--r--modules/gallery/controllers/albums.php5
-rw-r--r--modules/gallery/controllers/photos.php5
2 files changed, 8 insertions, 2 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index 9733d1cd..21e37073 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;
@@ -216,7 +218,8 @@ class Albums_Controller extends Items_Controller {
array("album_title" => html::purify($album->title))));
print json_encode(
- array("result" => "success"));
+ array("result" => "success",
+ "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 fbff53ce..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;
@@ -113,7 +115,8 @@ class Photos_Controller extends Items_Controller {
array("photo_title" => html::purify($photo->title))));
print json_encode(
- array("result" => "success"));
+ array("result" => "success",
+ "location" => $watching_album ? $location : $photo->url()));
} else {
print json_encode(
array("result" => "error",