Index: www/photo-delete.tcl
===================================================================
--- www/photo-delete.tcl (revision 92)
+++ www/photo-delete.tcl (working copy)
@@ -13,6 +13,7 @@
} {
photo_id:integer,notnull
{confirmed_p "f"}
+ return_url:optional
} -validate {
valid_photo -requires {photo_id:integer} {
if [string equal [pa_is_photo_p $photo_id] "f"] {
@@ -44,7 +45,12 @@
pa_flush_photo_in_album_cache $album_id
- ad_returnredirect "album?album_id=$album_id"
+ # HAM : added return_url
+ if { ![exists_and_not_null return_url] } {
+ ad_returnredirect "album?album_id=$album_id"
+ } else {
+ ad_returnredirect $return_url
+ }
ad_script_abort
} else {
Index: www/folder-add.tcl
===================================================================
--- www/folder-add.tcl (revision 92)
+++ www/folder-add.tcl (working copy)
@@ -9,6 +9,7 @@
@cvs-id $Id: photo-album-ajaxpa.diff,v 1.2 2018/04/25 19:47:46 hectorr Exp $
} {
parent_id:integer,notnull
+ return_url:optional
} -validate {
valid_parent -requires {parent_id:integer} {
if [string equal [pa_is_folder_p $parent_id] "f"] {
@@ -104,7 +105,12 @@
ad_script_abort
}
- #redirect back to index page with parent_id
- ad_returnredirect "?folder_id=$parent_id"
+ # HAM : added return_url
+ if { ![exists_and_not_null return_url] } {
+ #redirect back to index page with parent_id
+ ad_returnredirect "?folder_id=$parent_id"
+ } else {
+ ad_returnredirect $return_url
+ }
ad_script_abort
}
Index: www/photos-add-2.tcl
===================================================================
--- www/photos-add-2.tcl (revision 92)
+++ www/photos-add-2.tcl (working copy)
@@ -11,6 +11,7 @@
{upload_file:optional,trim ""}
upload_file.tmpfile:optional,tmpfile
album_id:integer,notnull
+ return_url:optional
} -validate {
valid_album -requires {album_id:integer} {
if [string equal [pa_is_album_p $album_id] "f"] {
@@ -37,18 +38,24 @@
[ catch {set tmp_dir [pa_expand_archive $upload_file ${upload_file.tmpfile} pa-$album_id] } errMsg] } {
ad_return_complaint 1 "Unable to expand your archive file"
ad_script_abort
-}
+}
+if { ![exists_and_not_null return_url] } {
ReturnHeaders text/html
ns_write "