diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-22 10:09:25 -0700 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-22 10:09:25 -0700 |
| commit | e906e6bcbd6ed99b1029d4ceae45c03d77edc9ff (patch) | |
| tree | 1a7675712f1837f0dfd3d14c990d29f311c22829 /modules/gallery/controllers/albums.php | |
| parent | 95f3eb3aad3700c883ef6d865ae8d6512883b432 (diff) | |
Use the request::referrer to determine if we are editting the photo or album
from the context menu or from its photo or album page.
Fixes ticket #745. Thanks to jankoprowski for the referrer approach.
Diffstat (limited to 'modules/gallery/controllers/albums.php')
| -rw-r--r-- | modules/gallery/controllers/albums.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index ae4ad395..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; @@ -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", |
