Index: openacs-4/packages/ajax-photoalbum-ui/ajax-photoalbum-ui.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/ajax-photoalbum-ui.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/ajax-photoalbum-ui.info 11 Apr 2009 15:46:44 -0000 1.1
@@ -0,0 +1,27 @@
+
+
+
+
+ Ajax Photo-Album UI
+ Ajax Photo-Album UI
+ f
+ t
+ ajaxpa
+
+
+ hamilton chua
+ Solutiongrove
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/ajax-photoalbum-ui/catalog/ajax-photoalbum-ui.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/catalog/ajax-photoalbum-ui.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/catalog/ajax-photoalbum-ui.en_US.ISO-8859-1.xml 11 Apr 2009 15:46:44 -0000 1.1
@@ -0,0 +1,11 @@
+
+
+
+ Album
+ Delete
+ Edit
+ Folder
+ Folders & Albums
+ New
+ Photo
+
Index: openacs-4/packages/ajax-photoalbum-ui/catalog/ajax-photoalbum-ui.en_US.ISO-8859-1.xml.orig
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/catalog/ajax-photoalbum-ui.en_US.ISO-8859-1.xml.orig,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/catalog/ajax-photoalbum-ui.en_US.ISO-8859-1.xml.orig 11 Apr 2009 15:46:44 -0000 1.1
@@ -0,0 +1,9 @@
+
+
+ New
+ Edit
+ Delete
+ Folder
+ Album
+ Photo
+
Index: openacs-4/packages/ajax-photoalbum-ui/lib/ajaxpa-include.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/lib/ajaxpa-include.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/lib/ajaxpa-include.adp 11 Apr 2009 15:46:44 -0000 1.1
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/ajax-photoalbum-ui/lib/ajaxpa-include.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/lib/ajaxpa-include.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/lib/ajaxpa-include.tcl 11 Apr 2009 15:46:44 -0000 1.1
@@ -0,0 +1,56 @@
+# ajax-photoalbum-ui/lib/ajaxpa-include.tcl
+# This include should be placed on a page
+# where you wish to have an ajaxpa instance
+# this include expects the following variables
+# package_id : package_id of the file storage instance
+# container_id : the object_id of the folder or album that will be opened on load, defaults to the root folder
+# layoutdiv : the id of the div element where you want ajaxpa to be rendered, defaults to the entire page
+# theme : can be any of the following
+# - default
+# - gray
+
+if { ![exists_and_not_null theme] } {
+ set theme "gray"
+}
+
+if { [exists_and_not_null package_id] } {
+
+ set user_id [ad_conn user_id]
+ set options [list]
+ set rootfolder_id [pa_get_root_folder $package_id]
+ set instance_name [db_string "get_folder_name" "select name as instance_name from fs_folders where folder_id = :rootfolder_id"]
+
+ lappend options "package_id:$package_id"
+
+ # get the pa root folder based on package_id
+ lappend options "rootfolder_id:$rootfolder_id"
+ lappend options "rootfolder_name:\"$instance_name\""
+
+ # url to the current photo album package
+ lappend options "package_url:\"[apm_package_url_from_id $package_id]\""
+
+ # get the path to ajaxpa
+ lappend options "xmlhttpurl:\"[ajaxpa::get_url]\xmlhttp/\""
+
+ # thumbnails per page
+ lappend options "pagesize:\"[parameter::get -package_id $package_id -parameter ThumbnailsPerPage]\""
+
+ # user_id
+ lappend options "user:\"$user_id\""
+
+ # perms for the user on root
+ lappend options "root_write_p:[permission::permission_p -party_id $user_id -object_id $rootfolder_id -privilege write]"
+ lappend options "root_read_p:[permission::permission_p -party_id $user_id -object_id $rootfolder_id -privilege read]"
+
+ if { [exists_and_not_null layoutdiv] } {
+ lappend options "layoutdiv:\"$layoutdiv\""
+ }
+
+ set options [join $options ","]
+
+} else {
+
+ ad_return_complaint 1 "Package id is required."
+ ad_script_abort
+
+}
\ No newline at end of file
Index: openacs-4/packages/ajax-photoalbum-ui/tcl/ajax-photoalbum-ui-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/tcl/ajax-photoalbum-ui-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/tcl/ajax-photoalbum-ui-procs.tcl 11 Apr 2009 15:56:12 -0000 1.1
@@ -0,0 +1,63 @@
+ad_library {
+
+ Library for Ajax Photo Album UI
+ uses Ajax Helper package with ExtJS and the Yahoo User Interface Library.
+ http://developer.yahoo.net/yui/index.html
+ http://extjs.com/deploy/dev/docs/
+
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2007-11-18
+
+}
+
+
+namespace eval ajaxpa { }
+
+ad_proc -private ajaxpa::get_package_id {
+
+} {
+ Return the package_id of the installed and mounted ajax photo album ui
+
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2007-11-18
+ @return
+
+ @error
+
+} {
+ return [apm_package_id_from_key "ajax-photoalbum-ui"]
+}
+
+ad_proc -private ajaxpa::get_url {
+
+} {
+ Return the URL to the mounted ajax photo album ui instance
+
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2007-11-18
+ @return
+
+ @error
+
+} {
+ return [apm_package_url_from_id [ajaxpa::get_package_id]]
+}
+
+ad_proc -private ajaxpa::json_normalize {
+ -value
+} {
+ Normalizes text for use in a JSON attribute.
+ - escape double quotes
+ - removes line breaks
+
+ @author Hamilton Chua (ham@solutiongrove.com)
+ @creation-date 2007-11-18
+ @return
+
+ @error
+
+} {
+ regsub -all {"} $value {\"} value
+ regsub -all {\n} $value { } value
+ return $value
+}
\ No newline at end of file
Index: openacs-4/packages/ajax-photoalbum-ui/www/batchdownload/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/www/batchdownload/index.vuh,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/www/batchdownload/index.vuh 11 Apr 2009 15:56:13 -0000 1.1
@@ -0,0 +1,76 @@
+# ajax-photoalbum-ui-service/www/batchdownload/index.vuh
+
+ad_page_contract {
+
+ Batch download a set of photos.
+ - receives a list of photo ids
+ - copies them into a temporary folder
+ - zips the folder
+ - offers it up for download
+
+} {
+ photo_ids
+}
+
+set user_id [ad_conn user_id]
+set photo_id_list [split $photo_ids ","]
+
+set package_id [ad_conn package_id]
+set package_path "[acs_root_dir]/[pkg_home photo-album]"
+
+# create a name for the temporary directory
+# - use the user's name and current datetime
+set path_to_download "[ns_tmpnam]"
+
+# create the temporary directory to hold the files
+file mkdir $path_to_download
+
+# loop thru photo_id_list
+# - get a reference to the image on the cr
+# - copy to the
+foreach photo_id $photo_id_list {
+
+ photo_album::photo::get -photo_id $photo_id -array photo_arr
+
+ set revision_id $photo_arr(viewer_live_revision)
+
+ if { [db_0or1row "get_revision_info" {
+ select i.storage_type, i.storage_area_key, r.mime_type, i.item_id,
+ r.content_length
+ from cr_items i, cr_revisions r
+ where r.revision_id = :revision_id and i.item_id = r.item_id
+ }] } {
+ set path [cr_fs_path $storage_area_key]
+ set filename [db_string write_file_content {
+ select :path || content
+ from cr_revisions
+ where revision_id = :revision_id
+ }]
+ file copy -force $filename $path_to_download/$photo_arr(viewer_name)
+ if { ![db_resultrows] } {
+ set album_id $photo_arr(album_id)
+ }
+ }
+
+}
+
+
+# create the zip file
+set outpath [ns_tmpnam]
+file mkdir $outpath
+set outfile [file join ${outpath} "photos.zip"]
+
+set cmd "zip -q -1 -r $outfile *.*"
+
+set status [catch {exec bash -c "cd $path_to_download; $cmd; cd -"} result]
+
+# return the archive to the connection.
+ns_set put [ad_conn outputheaders] Content-Disposition "attachment;filename=\"photos.zip\""
+ns_set put [ad_conn outputheaders] Content-Type "application/zip"
+ns_set put [ad_conn outputheaders] Content-Size "[file size $outfile]"
+ns_returnfile 200 application/octet-stream $outfile
+
+file delete -force $path_to_download
+file delete -force $outpath
+
+
Index: openacs-4/packages/ajax-photoalbum-ui/www/doc/index.html
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/www/doc/index.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/www/doc/index.html 11 Apr 2009 15:56:13 -0000 1.1
@@ -0,0 +1,57 @@
+
+
+
+Ajax Photo Album User Interface
+
+
+
+
+Ajax Photo Album User Interface
+Hamilton G. Chua (ham@solutiongrove.com)
+ April 2009
+ v0.1
+What's New :
+v0.1
+
+ Initial Release (see Features below for details)
+
+
+Description :
+Is a package that works on top of the Photo Album package. It creates a ajax powered user interface using the ExtJS javascript library.
+
+Features :
+
+User interface loaded using ajax
+ Thumbnail view of images in an album
+ Shadowbox Media Viewer integration
+Paging of photos
+ Move albums and folders from one folder to another using drag and drop on the treepanel
+ Move photos from one album to another on the treepanel using drag and drop
+
+
+Set Up :
+
+In order to use AjaxPA, some modifications are necessary on the photo album package. These modifications include :
+
+checking for return_urls
+ making some procs accept a package_id
+
+
+Download and apply this patch onto your photo-album package.
+If you downloaded the patch into your /tmp folder and your photo-album package is in a folder openacs/packages, this is how you would apply the patch.
+
+
+
+cd openacs/packages/photo-album
+patch -p0 -i /tmp/photo-album-ajaxpa.diff
+
+
+
+
+
+
+
Index: openacs-4/packages/ajax-photoalbum-ui/www/doc/photo-album-ajaxpa.diff
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/www/doc/photo-album-ajaxpa.diff,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/www/doc/photo-album-ajaxpa.diff 11 Apr 2009 15:56:13 -0000 1.1
@@ -0,0 +1,485 @@
+Index: photo-album.info
+===================================================================
+--- photo-album.info (revision 92)
++++ photo-album.info (working copy)
+@@ -14,14 +14,14 @@
+ Organization, editing and display of user uploaded photos.
+ 2006-02-18
+ OpenACS
+- A photo album application that provides photo display and grouping
+-functionality using the ACS Content Repository.
+-<p>
+-Allows users to upload photos, store and edit attributes, and group
+-photos into albums and folders. Supports permissioning, exif data, and user clipboards.
+-<p>
+-Requires installation of ImageMagick and jhead on host machine. See design doc
+-for details.
++ A photo album application that provides photo display and grouping
++functionality using the ACS Content Repository.
++<p>
++Allows users to upload photos, store and edit attributes, and group
++photos into albums and folders. Supports permissioning, exif data, and user clipboards.
++<p>
++Requires installation of ImageMagick and jhead on host machine. See design doc
++for details.
+
+ 1
+
+@@ -48,6 +48,7 @@
+
+
+
++
+
+
+
+Index: tcl/photo-album-procs.tcl
+===================================================================
+--- tcl/photo-album-procs.tcl (revision 92)
++++ tcl/photo-album-procs.tcl (working copy)
+@@ -347,6 +347,7 @@
+ }
+
+ ad_proc -public pa_make_new_image {
++ {-package_id {}}
+ base_image
+ new_image
+ geometry
+@@ -370,8 +371,9 @@
+ if {[regexp {^[0-9]+$} $geometry]} {
+ set geometry ${geometry}x${geometry}
+ }
++ if { ![exists_and_not_null package_id] } { set package_id [ad_conn package_id] }
+ ns_log debug "pa_make_new_image: Start convert, making $new_image geometry $geometry"
+- exec [ad_parameter ImageMagickPath]/convert -geometry $geometry -interlace None -sharpen 1x2 $base_image $new_image
++ exec [parameter::get -parameter ImageMagickPath -package_id $package_id]/convert -geometry $geometry -interlace None -sharpen 1x2 $base_image $new_image
+ if {[catch {exec jhead -dt $new_image} errmsg]} {
+ ns_log Warning "pa_make_new_image: jhead failed with error - $errmsg"
+ }
+@@ -705,15 +707,17 @@
+ }
+
+ ad_proc -public pa_file_info {
++ {-package_id {}}
+ file
+ } {
+ return the image information from a given file
+ } {
+ set info [list]
++ if { ![exists_and_not_null package_id] } { set package_id [ad_conn package_id] }
+ if { [catch {set size [file size $file]} errMsg] } {
+ return -code error $errMsg
+ }
+- if { [ catch {set out [exec [ad_parameter ImageMagickPath]/identify -format "%w %h %m %k %q %#" $file]} errMsg]} {
++ if { [ catch {set out [exec [parameter::get -parameter ImageMagickPath -package_id $package_id]/identify -format "%w %h %m %k %q %#" $file]} errMsg]} {
+ return -code error $errMsg
+ }
+
+@@ -826,7 +830,7 @@
+ set client_filename $upload_name
+ }
+
+- if {[catch {set base_info [pa_file_info $image_file]} errMsg]} {
++ if {[catch {set base_info [pa_file_info -package_id $package_id $image_file]} errMsg]} {
+ ns_log Warning "pa_load_images: error parsing file data $image_file Error: $errMsg"
+ error "pa_load_images: error parsing file data $image_file Error: $errMsg"
+ continue
+@@ -840,7 +844,7 @@
+ set new_image [file join $tmp_path "tmp-[file rootname [file tail $image_file]]"]
+ if {![empty_string_p $base_colors] && $base_colors < 257} {
+ # convert it to a png
+- if {[catch {exec [ad_parameter ImageMagickPath]/convert $image_file PNG:$new_image.png} errMsg]} {
++ if {[catch {exec [parameter::get -parameter ImageMagickPath -package_id $package_id]/convert $image_file PNG:$new_image.png} errMsg]} {
+ ns_log Warning "pa_load_images: Failed convert to PNG for $image_file (magicktype $base_type)"
+ }
+ if { $remove } {
+@@ -850,7 +854,7 @@
+ set remove 1
+ } elseif {![empty_string_p $base_colors] && $base_colors > 256} {
+ # convert it to a jpg
+- if {[catch {exec [ad_parameter ImageMagickPath]/convert $image_file JPG:$new_image.jpg} errMsg]} {
++ if {[catch {exec [parameter::get -parameter ImageMagickPath -package_id $package_id]/convert $image_file JPG:$new_image.jpg} errMsg]} {
+ ns_log Warning "pa_load_images: failed convert to JPG for $image_file (magicktype $base_type)"
+ }
+ if { $remove } {
+@@ -863,7 +867,7 @@
+ }
+
+ # get info again
+- foreach {base_bytes base_width base_height base_type base_mime base_colors base_quantum base_sha256} [pa_file_info $image_file] { break }
++ foreach {base_bytes base_width base_height base_type base_mime base_colors base_quantum base_sha256} [pa_file_info -package_id $package_id $image_file] { break }
+ }
+
+ if {[string equal $base_mime image/jpeg]} {
+@@ -898,16 +902,16 @@
+ set viewer_size [parameter::get -parameter ViewerSize -package_id $package_id]
+ set viewer_filename [pa_make_file_name -ext $BaseExt $viewer_rev_id]
+ set full_viewer_filename [file join ${tmp_path} ${viewer_filename}]
+- pa_make_new_image $image_file ${full_viewer_filename} $viewer_size
+- foreach {viewer_bytes viewer_width viewer_height viewer_type viewer_mime viewer_colors viewer_quantum viewer_sha256} [pa_file_info $full_viewer_filename] {}
++ pa_make_new_image -package_id $package_id $image_file ${full_viewer_filename} $viewer_size
++ foreach {viewer_bytes viewer_width viewer_height viewer_type viewer_mime viewer_colors viewer_quantum viewer_sha256} [pa_file_info -package_id $package_id $full_viewer_filename] {}
+
+ # Handle thumb file
+ #
+ set thumb_size [parameter::get -parameter ThumbnailSize -package_id $package_id]
+ set thumb_filename [pa_make_file_name -ext $BaseExt $thumb_rev_id]
+ set full_thumb_filename [file join $tmp_path $thumb_filename]
+- pa_make_new_image ${full_viewer_filename} ${full_thumb_filename} $thumb_size
+- foreach {thumb_bytes thumb_width thumb_height thumb_type thumb_mime thumb_colors thumb_quantum thumb_sha256} [pa_file_info $full_thumb_filename] {}
++ pa_make_new_image -package_id $package_id ${full_viewer_filename} ${full_thumb_filename} $thumb_size
++ foreach {thumb_bytes thumb_width thumb_height thumb_type thumb_mime thumb_colors thumb_quantum thumb_sha256} [pa_file_info -package_id $package_id $full_thumb_filename] {}
+
+ # copy the tmp file to the cr's file-system
+ set thumb_filename_relative [cr_create_content_file -move $thumb_item_id $thumb_rev_id ${full_thumb_filename}]
+Index: www/index.tcl
+===================================================================
+--- www/index.tcl (revision 92)
++++ www/index.tcl (working copy)
+@@ -33,6 +33,12 @@
+ # check for read permission on folder
+ ad_require_permission $folder_id read
+
++# HAM : AjaxPA
++# - we need to pass package_id to ajaxpa-include
++# - turn ajaxpa on/off with a parameter, default to 1 for now
++set package_id [ad_conn package_id]
++set use_ajaxpa_p [parameter::get -parameter UseAjaxPa -default 1]
++
+ set user_id [ad_conn user_id]
+ set context [pa_context_bar_list $folder_id]
+
+@@ -40,7 +46,7 @@
+ db_1row get_folder_info {}
+
+ set root_folder_id [pa_get_root_folder]
+-set parameter_url_vars [export_url_vars package_id=[ad_conn package_id] return_url=[ad_conn url]]
++set parameter_url_vars [export_url_vars package_id=$package_id return_url=[ad_conn url]]
+
+ # to move an album need write on album and write on parent folder
+ set move_p [expr $write_p && !($folder_id == $root_folder_id) && $parent_folder_write_p]
+Index: www/folder-delete.tcl
+===================================================================
+--- www/folder-delete.tcl (revision 92)
++++ www/folder-delete.tcl (working copy)
+@@ -11,6 +11,7 @@
+ } {
+ folder_id:integer,notnull
+ {confirmed_p "f"}
++ return_url:optional
+ } -validate {
+ valid_folder -requires {folder_id:integer} {
+ if [string equal [pa_is_folder_p $folder_id] "f"] {
+@@ -50,7 +51,14 @@
+ content_folder.del(:folder_id);
+ end;"
+
+- ad_returnredirect "?folder_id=$parent_folder_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_folder_id"
++ } else {
++ ad_returnredirect $return_url
++ }
++
+ ad_script_abort
+ } else {
+ # they still need to confirm
+Index: www/photo-edit.tcl
+===================================================================
+--- www/photo-edit.tcl (revision 92)
++++ www/photo-edit.tcl (working copy)
+@@ -11,6 +11,7 @@
+ {hide:integer 0}
+ {photo_id:integer 0}
+ d:array,integer,optional
++ return_url:optional
+ } -properties {
+ path:onevalue
+ height:onevalue
+@@ -122,7 +123,13 @@
+ ad_script_abort
+ }
+
+- ad_returnredirect "photo?photo_id=$photo_id"
++ # HAM : added return_url
++ if { ![exists_and_not_null return_url] } {
++ ad_returnredirect "photo?photo_id=$photo_id"
++ } else {
++ ad_returnredirect $return_url
++ }
++
+ ad_script_abort
+ }
+
+Index: www/album-edit.tcl
+===================================================================
+--- www/album-edit.tcl (revision 92)
++++ www/album-edit.tcl (working copy)
+@@ -9,6 +9,7 @@
+ @cvs-id $Id: photo-album-ajaxpa.diff,v 1.1 2009/04/11 15:56:13 hamiltonc Exp $
+ } {
+ album_id:integer,notnull
++ return_url:optional
+ } -validate {
+ valid_album -requires {album_id:integer} {
+ if [string equal [pa_is_album_p $album_id] "f"] {
+@@ -90,7 +91,13 @@
+
+ ad_script_abort
+ }
+- 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
+ }
+
+Index: www/album-add.tcl
+===================================================================
+--- www/album-add.tcl (revision 92)
++++ www/album-add.tcl (working copy)
+@@ -9,6 +9,7 @@
+ @cvs-id $Id: photo-album-ajaxpa.diff,v 1.1 2009/04/11 15:56:13 hamiltonc Exp $
+ } {
+ parent_id:integer,notnull
++ return_url:optional
+ } -validate {
+ valid_parent_folder -requires {parent_id:integer} {
+ if [string equal [pa_is_folder_p $parent_id] "f"] {
+@@ -86,8 +87,13 @@
+ }
+ #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/folder-edit.tcl
+===================================================================
+--- www/folder-edit.tcl (revision 92)
++++ www/folder-edit.tcl (working copy)
+@@ -9,6 +9,7 @@
+ @cvs-id $Id: photo-album-ajaxpa.diff,v 1.1 2009/04/11 15:56:13 hamiltonc Exp $
+ } {
+ folder_id:integer,notnull
++ return_url:optional
+ } -validate {
+ valid_folder -requires {folder_id:integer} {
+ if [string equal [pa_is_folder_p $folder_id] "f"] {
+@@ -70,7 +71,13 @@
+ }
+ #redirect back to index page with parent_id
+
+- ad_returnredirect "?folder_id=$folder_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/album-delete.tcl
+===================================================================
+--- www/album-delete.tcl (revision 92)
++++ www/album-delete.tcl (working copy)
+@@ -10,6 +10,7 @@
+ } {
+ album_id:integer,notnull
+ {confirmed_p "f"}
++ return_url:optional
+ } -validate {
+ valid_album -requires {album_id:integer} {
+ if [string equal [pa_is_album_p $album_id] "f"] {
+@@ -44,7 +45,13 @@
+
+ pa_flush_photo_in_album_cache $album_id
+
+- ad_returnredirect "?folder_id=$parent_folder_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_folder_id"
++ } else {
++ ad_returnredirect $return_url
++ }
+ ad_script_abort
+
+ } else {
+Index: www/index.adp
+===================================================================
+--- www/index.adp (revision 92)
++++ www/index.adp (working copy)
+@@ -2,6 +2,11 @@
+ @folder_name;noquote@
+ @context;noquote@
+
++
++
++
++
++
+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.1 2009/04/11 15:56:13 hamiltonc 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 "Upload Log Upload Log \n"
++}
+
+ if {![empty_string_p $upload_file]} {
+- ns_write "starting to load images from file $upload_file \n"
++ if { ![exists_and_not_null return_url] } {
++ ns_write "starting to load images from file $upload_file \n"
++ }
+ ns_log Debug "made directory $tmp_dir to extract from ${upload_file.tmpfile} ($upload_file)\n"
+ set allfiles [pa_walk $tmp_dir]
+ set remove 1
+ } else {
+- ns_write "starting to load images from directory [parameter::get -parameter FullTempPhotoDir -package_id [ad_conn package_id]] \n"
++ if { ![exists_and_not_null return_url] } {
++ ns_write "starting to load images from directory [parameter::get -parameter FullTempPhotoDir -package_id [ad_conn package_id]] \n"
++ }
+ set allfiles [pa_walk [parameter::get -parameter FullTempPhotoDir -package_id [ad_conn package_id]]]
+ set remove 0
+ }
+@@ -58,10 +65,19 @@
+ pa_flush_photo_in_album_cache $album_id
+
+ set page [pa_page_of_photo_in_album [lindex $new_photo_ids 0] $album_id]
++
++if { ![exists_and_not_null return_url] } {
+ ns_write "View the images "
+ ns_write ""
++}
+
+ # Now that we are done working on the upload we delete the tmp file
+ if [info exists tmp_dir] {
+ file delete -force $tmp_dir
+ }
++
++# HAM : added return_url
++if { [exists_and_not_null return_url] } {
++ ad_returnredirect $return_url
++ ad_script_abort
++}
+Index: www/photo-add-2.tcl
+===================================================================
+--- www/photo-add-2.tcl (revision 92)
++++ www/photo-add-2.tcl (working copy)
+@@ -15,6 +15,7 @@
+ {description [db_null]}
+ {caption [db_null]}
+ {story [db_null]}
++ return_url:optional
+ } -validate {
+ valid_album -requires {album_id:integer} {
+ if [string equal [pa_is_album_p $album_id] "f"] {
+@@ -70,4 +71,12 @@
+ # page used as part of redirect so user returns to the album page containing the newly uploaded photo
+ set page [pa_page_of_photo_in_album [lindex $new_photo_ids 0] $album_id]
+
+-ad_returnredirect "album?album_id=$album_id&page=$page"
++
++# HAM : added return_url
++if { ![exists_and_not_null return_url] } {
++ ad_returnredirect "album?album_id=$album_id&page=$page"
++} else {
++ ad_returnredirect $return_url
++}
++
++
Index: openacs-4/packages/ajax-photoalbum-ui/www/download/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/www/download/index.vuh,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/www/download/index.vuh 11 Apr 2009 15:56:13 -0000 1.1
@@ -0,0 +1,26 @@
+# /packages/photo-album/www/images/index.vuh
+# @author Tom Baginski, bags@arsdigita.com
+# #cvs-id $Id: index.vuh,v 1.1 2009/04/11 15:56:13 hamiltonc Exp $
+#
+# serves images
+#
+# expecting a image_id as path_info
+
+# wtem@olywa.net, 2001-09-24
+# fully reworked
+
+regexp {^([0-9]+)} [ad_conn path_info] match image_id
+
+if {[string equal [ad_parameter CheckPermissionOnImageServeP] "t"]} {
+ ad_require_permission $image_id "read"
+}
+
+ns_set put [ad_conn outputheaders] Content-Disposition attachment
+
+if {[catch {cr_write_content -revision_id $image_id} errMsg]} {
+ if {[string equal $::errorCode NOT_FOUND]} {
+ ns_returnnotfound
+ ad_script_abort
+ }
+ error $errMsg $::errorInfo $::errorCode
+}
Index: openacs-4/packages/ajax-photoalbum-ui/www/java-upload/ThinUPload.jar
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/www/java-upload/Attic/ThinUPload.jar,v
diff -u
Binary files differ
Index: openacs-4/packages/ajax-photoalbum-ui/www/java-upload/ThinUPload.jar.bak
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-photoalbum-ui/www/java-upload/Attic/ThinUPload.jar.bak,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ajax-photoalbum-ui/www/java-upload/ThinUPload.jar.bak 11 Apr 2009 15:56:13 -0000 1.1
@@ -0,0 +1,3011 @@
+PK XO|7{y�l � META-INF/MANIFEST.MF�XI��Z�WD��\Ԣ;�L@p�"z�"� Ƞ���U�2���|ݯ�����p8��w>$;
+��(_O /�~�߰�_��O��3���K�Y���m���6v ��M����
+�'_�x��V�/R��h�$���o����|�ʒ�;��_$;H_��]/u�/x�=x/vU��.����_U{_�|�r���%����o��ˋf /P|��qk���o��/.#����e�����|ҧ�x����'����x/�`�q���Wn4l��&�u�>�M;�#X�1Q��i�)'/�ӽ[Qx��P^��
+�A�P��>�=�sA�� ;x�@�y-����n���c%�C��ɠPV��5�,��raY\�u��� =�������mS�]�ax\AY�еJ����a ���w�vϋApV*w�(D�T�����l��`�Y��K���1[��� h�50Dե�*} D��?��1.2�/ј�v"����`n��cS�����)p�^��vi����Ez�fn3-��3x��eq��O)Er� E���oH�Q�X�R��dm[9�c"�<�_�Y�r��h��w�+��z����W1��'̘�SEB�o�A<�>�v�Q���O�݊� Zp]��#��k*�L�ˆ:��;���:��M���h7��;�p���"c;���Z�:��V�cy����z^�d����S�5�e##��#�)���`�Ukhk�OՒ�~��#6sqV.N�#_V���X},�!�u�ŠQ4F�b��=��r�+�+���!���,�}@��n��v� �ˮ� ���vJ�1�}D:X�!ɥ��g_R����� �-wcZ�l0�YS�%F�w��9����{��'�M+}l��s��}��p�^���8��>�1��A�;<%�j
+�<PT��š>��ˇ������M�٠�p0e_��ED�뽺:%�װ�Ub8����O���W�T�Cv��l5�u�(�yu3e��NQ�[�����&��5�n���n
+m�%SZ����:ns�.�fpk�|5����u��x����W� �
+�y�aq���g���VRy��~�8"���e�/����9�-��UӗkΏiׯ�:Z:y������`��춋ݔO���5�$�k�Q#���| umcL�]{\�i���b(��wf-���U%��Ҧ�����iп M(T��.g�/�����D� q3�:�XE��!|M�LT���w>&�@���UђSBw����"��W�KD�i���T�+����A���:)ڜ'�!��)���L.W��k���I�H��r�P�Xכ�N�çh
+�(:^�b�πAp��R뭫�T��cN�-��_�e>ܦ����0m����nM�bܸ��0q����L�/ n��2CmC-�w�fγ�Vǜ���
+��L�iȎ�"Yu8Ώ3��:�FF׳�q%�}r^"]r���g�s,�@.�����D��F�.6����o��Pt����N�Ժq*�Y
+S���8\��U��lI�8~]�e���zPkS������IW39,oWKߵ�L�O.-�ҭ�S����߽7:#*̦1Bw6�/wἸ�n��i�|�<d��\�t�Ѧ�>V�
+WV�>���^ӻ�`ע�eWV%T�$�����w$w�$
+���5�r�8����0J�����RF�!��%��ZӶs�r��IاG�A٫��^^��˗<{���(�6��U=�Z�wK��G����p����N�*$�a^�ڨ��خ5�F�n����