Index: openacs-4/packages/photo-album/www/album-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-add.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/album-add.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/album-add.adp 18 Nov 2003 18:27:52 -0000 1.3 @@ -1,5 +1,6 @@ -Create a New Album +#photo-album.Create_a_New_Album# @context_list@ + Index: openacs-4/packages/photo-album/www/album-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-add.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/album-add.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/album-add.tcl 18 Nov 2003 18:27:52 -0000 1.3 @@ -12,7 +12,7 @@ } -validate { valid_parent_folder -requires {parent_id:integer} { if [string equal [pa_is_folder_p $parent_id] "f"] { - ad_complain "The specified parent folder is not valid." + ad_complain "[_ photo-album._The]" } } } -properties { @@ -21,7 +21,7 @@ ad_require_permission $parent_id "pa_create_album" -set context_list [pa_context_bar_list -final "Create a New Album" $parent_id] +set context_list [pa_context_bar_list -final "[_ photo-album._Create]" $parent_id] template::form create album_add @@ -32,16 +32,16 @@ -datatype integer -widget hidden template::element create album_add title -html { size 30 } \ - -label "Album Name" -datatype text + -label "[_ photo-album.Album_Name]" -datatype text template::element create album_add photographer -html { size 50} \ - -label "Photographer" -datatype text -optional + -label "[_ photo-album.Photographer_]" -datatype text -optional template::element create album_add description -html { size 50 } \ - -label "Album Description" -datatype text -optional + -label "[_ photo-album._Album]" -datatype text -optional template::element create album_add story -html {cols 50 rows 4 wrap soft} \ - -label "Album Story" -datatype text -widget textarea -optional + -label "[_ photo-album._Album_1]" -datatype text -widget textarea -optional if { [template::form is_request album_add] } { set album_id [db_nextval acs_object_id_seq] @@ -77,13 +77,9 @@ from cr_items where (item_id = :album_id or name = :name) and parent_id = :parent_id"] { - ad_return_complaint 1 "Either there is already an album with the name \"$name\" - or you clicked on the button more than once. You can - return to the directory listing to see if your album is there." + ad_return_complaint 1 "[_ photo-album._Either]" } else { - ad_return_complaint 1 "We got an error that we couldn't readily identify. Please let the system owner know about this. - -
$errmsg
" + ad_return_complaint 1 "[_ photo-album._We]" } ad_script_abort Index: openacs-4/packages/photo-album/www/album-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-chunk.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/photo-album/www/album-chunk.adp 17 Jun 2003 13:51:21 -0000 1.1 +++ openacs-4/packages/photo-album/www/album-chunk.adp 18 Nov 2003 18:27:52 -0000 1.2 @@ -1,7 +1,7 @@ - - + + @@ -17,3 +17,4 @@
NameDescription#photo-album.Name##photo-album.Description#
+ Index: openacs-4/packages/photo-album/www/album-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-delete.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/album-delete.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/album-delete.adp 18 Nov 2003 18:27:52 -0000 1.3 @@ -6,11 +6,12 @@ -

Are you sure you want to delete the album "@title@"? This action cannot be reversed. +

#photo-album.lt_Are_you_sure_you_want#

- + + Index: openacs-4/packages/photo-album/www/album-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-delete.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/photo-album/www/album-delete.tcl 30 Sep 2003 12:10:09 -0000 1.3 +++ openacs-4/packages/photo-album/www/album-delete.tcl 18 Nov 2003 18:27:52 -0000 1.4 @@ -13,13 +13,13 @@ } -validate { valid_album -requires {album_id:integer} { if [string equal [pa_is_album_p $album_id] "f"] { - ad_complain "The specified album is not valid." + ad_complain "[_ photo-album._The_1]" } } no_children -requires {album_id:integer} { if { [pa_count_photos_in_album $album_id] > 0 } { - ad_complain "We're sorry, but you cannot delete albums unless they are already empty." + ad_complain "<#_We're sorry, but you cannot delete albums unless they are already empty.#>" } } } -properties { Index: openacs-4/packages/photo-album/www/album-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-edit.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/album-edit.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/album-edit.adp 18 Nov 2003 18:27:52 -0000 1.3 @@ -1,5 +1,6 @@ @title@ @context_list@ -

Edit the Album: +

#photo-album.Edit_the_Album# + Index: openacs-4/packages/photo-album/www/album-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-edit.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/album-edit.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/album-edit.tcl 18 Nov 2003 18:27:52 -0000 1.3 @@ -12,7 +12,7 @@ } -validate { valid_album -requires {album_id:integer} { if [string equal [pa_is_album_p $album_id] "f"] { - ad_complain "The specified album is not valid." + ad_complain "[_ photo-album._The_1]" } } } -properties { @@ -22,7 +22,7 @@ ad_require_permission $album_id "write" set user_id [ad_conn user_id] -set context_list [pa_context_bar_list -final "Edit Album Attributes" $album_id] +set context_list [pa_context_bar_list -final "[_ photo-album._Edit]" $album_id] template::form create edit_album @@ -39,16 +39,16 @@ -datatype integer -widget hidden -optional template::element create edit_album title -html { size 30 } \ - -label "Album Name" -datatype text + -label "[_ photo-album._Album_2]" -datatype text template::element create edit_album photographer -html { size 50} \ - -label "Photographer" -datatype text -optional + -label "<#_ Photographer#>" -datatype text -optional template::element create edit_album description -html { size 50} \ - -label "Album Description" -datatype text -optional + -label "[_ photo-album._Album]" -datatype text -optional template::element create edit_album story -html { cols 50 rows 4 wrap soft } \ - -label "Album Story" -datatype text -widget textarea -optional + -label "[_ photo-album._Album_1]" -datatype text -widget textarea -optional # this needs to be outside of the s_request block so title attribute @@ -86,8 +86,7 @@ db_exec_plsql set_live_album {} } on_error { - ad_return_complaint 1 "An error occurred while processing your input. Please let the system owner know about this. -

$errmsg
" + ad_return_complaint 1 "[_ photo-album._An]" ad_script_abort } Index: openacs-4/packages/photo-album/www/album-move.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-move.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/album-move.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/album-move.adp 18 Nov 2003 18:27:52 -0000 1.3 @@ -1,5 +1,5 @@ @title@ @context_list@ -

Move Album to new folder: - \ No newline at end of file +

#photo-album.lt_Move_Album_to_new_fol# + Index: openacs-4/packages/photo-album/www/album-move.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-move.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/album-move.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/album-move.tcl 18 Nov 2003 18:27:52 -0000 1.3 @@ -11,11 +11,11 @@ } -validate { valid_album -requires {album_id:integer} { if [string equal [pa_is_album_p $album_id] "f"] { - ad_complain "The specified album is not valid." + ad_complain "[_ photo-album._The_1]" } } } -set context_list [pa_context_bar_list -final "Move Album" $album_id] +set context_list [pa_context_bar_list -final "[_ photo-album._Move]" $album_id] set user_id [ad_conn user_id] # to move an album need write on album, and old parent folder @@ -38,7 +38,7 @@ # options query retreive all folders in package that user can add an album to set root_folder_id [pa_get_root_folder] -template::element create move_album new_folder_id -label "Choose New Folder for Album" \ +template::element create move_album new_folder_id -label "[_ photo-album._Choose]" \ -datatype integer -widget select \ -options [db_list_of_lists get_folders "select lpad ('   ',((level - 1) * 18),'   ') || content_folder.get_label(ci.item_id) as padded_name, @@ -96,11 +96,9 @@ from cr_items where name = :folder_name and parent_id = :new_folder_id"] { - ad_return_complaint 1 "Either there is already an album in the specified folder with the name \"$folder_name\" or you clicked on the button more than once. You can return to the new folder to see if your album is there." + ad_return_complaint 1 "[_ photo-album._Either_1]" } else { - ad_return_complaint 1 "We got an error that we couldn't readily identify. Please let the system owner know about this. - -

$errmsg
" + ad_return_complaint 1 "[_ photo-album._We]" } ad_script_abort Index: openacs-4/packages/photo-album/www/album-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/photo-album/www/album-oracle.xql 12 Jun 2003 06:55:45 -0000 1.1 +++ openacs-4/packages/photo-album/www/album-oracle.xql 18 Nov 2003 18:27:52 -0000 1.2 @@ -8,6 +8,7 @@ select cr.title, cr.description, + pa.photographer, pa.story, ci.parent_id as parent_folder_id, case when acs_permission.permission_p(ci.item_id, :user_id, 'admin') = 't' then 1 else 0 end as admin_p, Index: openacs-4/packages/photo-album/www/album-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/photo-album/www/album-postgresql.xql 12 Jun 2003 06:55:45 -0000 1.1 +++ openacs-4/packages/photo-album/www/album-postgresql.xql 18 Nov 2003 18:27:52 -0000 1.2 @@ -9,6 +9,7 @@ select cr.title, cr.description, pa.story, + pa.photographer, ci.parent_id as parent_folder_id, case when acs_permission__permission_p(ci.item_id, :user_id, 'admin') = 't' then 1 else 0 end as admin_p, case when acs_permission__permission_p(ci.item_id, :user_id, 'pa_create_photo') = 't' then 1 else 0 end as photo_p, Index: openacs-4/packages/photo-album/www/album.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/album.adp 9 Oct 2003 10:01:09 -0000 1.2 +++ openacs-4/packages/photo-album/www/album.adp 18 Nov 2003 18:27:52 -0000 1.3 @@ -3,8 +3,8 @@ @context@ 1 @page_nav;noquote@ -@message@ -

@title@

+@message;noquote@ +

@photographer@

@description@

@@ -32,32 +32,30 @@ @page_nav;noquote@ -

This album does not contain anything.

+

#photo-album.lt_This_album_does_not_c#

-

Click on the small photos to see a bigger -version, the numbers to see different pages, or the Next or Previous -page links to move back and forth. You can also pick photos for -printing or emailing on the individual photo display page. +

#photo-album.lt_Click_on_the_small_ph#

-

View all of your clipboards.

+

#photo-album.lt_View_all_of_your_clip#.

+ Index: openacs-4/packages/photo-album/www/album.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/album.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/album.tcl 18 Nov 2003 18:27:52 -0000 1.3 @@ -14,12 +14,13 @@ } -validate { valid_album -requires {album_id:integer} { if [string equal [pa_is_album_p $album_id] "f"] { - ad_complain "The specified album is not valid." + ad_complain "[_ photo-album._The_1]" } } } -properties { album_id:onevalue title:onevalue + photographer:onevalue description:onevalue story:onevalue context:onevalue @@ -38,6 +39,14 @@ # check for read permission on album ad_require_permission $album_id read +# These lines are to uncache the image in Netscape, Mozilla. +# IE6 & Safari (mac) have a bug with the images cache +ns_set put [ns_conn outputheaders] "Expires" "-" +ns_set put [ns_conn outputheaders] "Last-Modified" "-" +ns_set put [ns_conn outputheaders] "Pragma" "no-cache" +ns_set put [ns_conn outputheaders] "Cache-Control" "no-cache" + + set context [pa_context_bar_list $album_id] db_1row get_album_info {} Index: openacs-4/packages/photo-album/www/base-photo.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/base-photo.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/base-photo.adp 9 Oct 2003 10:01:09 -0000 1.2 +++ openacs-4/packages/photo-album/www/base-photo.adp 18 Nov 2003 18:27:52 -0000 1.3 @@ -12,9 +12,10 @@

@description@

-

Story: @story@

+

#photo-album.Story_story#

@photo_nav_html;noquote@
-Image thumbnail index -| Smaller image
+#photo-album.lt_Imagenbspthumbnailnbs# +| #photo-album.Smallernbspimage# + Index: openacs-4/packages/photo-album/www/base-photo.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/base-photo.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/base-photo.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/base-photo.tcl 18 Nov 2003 18:27:52 -0000 1.3 @@ -13,7 +13,7 @@ } -validate { valid_photo -requires {photo_id:integer} { if [string equal [pa_is_photo_p $photo_id] "f"] { - ad_complain "The specified photo is not valid." + ad_complain "[_ photo-album._The_2]" } } } -properties { @@ -28,14 +28,14 @@ } if {![string equal [ad_parameter AllowBasePhotoAccessP] "t"]} { - ad_return_forbidden "No Access" "The Administrator of this sub-site has restricted access base photos." + ad_return_forbidden "[_ photo-album._No]" ad_script_abort } ad_require_permission $photo_id "read" set user_id [ad_conn user_id] -set context [pa_context_bar_list -final "Full Size Image" $photo_id] +set context [pa_context_bar_list -final "[_ photo-album._Full]" $photo_id] # query all the photo and permission info with a single trip to database db_1row get_photo_info {select Index: openacs-4/packages/photo-album/www/clipboard-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/clipboard-ae.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/clipboard-ae.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/clipboard-ae.adp 18 Nov 2003 18:27:52 -0000 1.3 @@ -1,5 +1,6 @@ -Photo clipboard -"Clipboard add/edit" +#photo-album.Photo_clipboard# +#photo-album.Clipboard_addedit# + Index: openacs-4/packages/photo-album/www/clipboard-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/clipboard-ae.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/clipboard-ae.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/clipboard-ae.tcl 18 Nov 2003 18:27:52 -0000 1.3 @@ -19,14 +19,14 @@ ad_form -name clip_ae -export {photo_id} -form { collection_id:key(acs_object_id_seq) - {title:text(text) {label "Clipboard name"} + {title:text(text) {label "[_ photo-album._Clipboard]"} {html {size 60}}} } -select_query { select title from pa_collections where collection_id = :collection_id } -validate { {title {![string is space $title]} - "You must provide a non-empty name for the clipboard" + "[_ photo-album._You]" } } -new_data { db_exec_plsql new_collection {} Index: openacs-4/packages/photo-album/www/clipboard-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/clipboard-view.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/clipboard-view.adp 26 Sep 2003 14:25:22 -0000 1.2 +++ openacs-4/packages/photo-album/www/clipboard-view.adp 18 Nov 2003 18:27:53 -0000 1.3 @@ -4,7 +4,7 @@

- Clipboard: @title@ @title@ (@owner_name@)

@@ -33,7 +33,7 @@

-

No photos in the clipboard.

+

#photo-album.lt_No_photos_in_the_clip#

@@ -45,3 +45,4 @@ + Index: openacs-4/packages/photo-album/www/clipboard-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/clipboard-view.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/photo-album/www/clipboard-view.tcl 26 Sep 2003 14:25:22 -0000 1.4 +++ openacs-4/packages/photo-album/www/clipboard-view.tcl 18 Nov 2003 18:27:53 -0000 1.5 @@ -20,7 +20,7 @@ set user_id [ad_conn user_id] if {![db_0or1row collection {select first_names || ' ' || last_name as owner_name, owner_id, title from pa_collections, cc_users where collection_id = :collection_id and owner_id = user_id}] } { - ad_return_complaint 1 "
  • invalid clipboard" + ad_return_complaint 1 "<#_
  • invalid clipboard#>" ad_script_abort } Index: openacs-4/packages/photo-album/www/clipboards.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/clipboards.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/clipboards.adp 30 Jun 2003 07:50:59 -0000 1.2 +++ openacs-4/packages/photo-album/www/clipboards.adp 18 Nov 2003 18:27:53 -0000 1.3 @@ -1,25 +1,21 @@ - Your clipboards - Clipboards + #photo-album.Your_clipboards# + #photo-album.Clipboards# - You will have to log in or - register - in order to manage clipboards. + #photo-album.You_will_have_to# #photo-album.log_in# #photo-album.or# + #photo-album.register# + #photo-album.lt_in_order_to_manage_cl# - You do not currently have any clipboards defined. You will - need to browse the photos and add them to a clipboard to use - this part of the site. + #photo-album.lt_You_do_not_currently_# #photo-album.photos# #photo-album.lt_and_add_them_to_a_cli# - \ No newline at end of file + Index: openacs-4/packages/photo-album/www/folder-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-add.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/folder-add.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/folder-add.adp 18 Nov 2003 18:27:53 -0000 1.3 @@ -1,5 +1,6 @@ -Create a New Folder +#photo-album.Create_a_New_Folder# @context_list@ + Index: openacs-4/packages/photo-album/www/folder-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-add.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/folder-add.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/folder-add.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -12,7 +12,7 @@ } -validate { valid_parent -requires {parent_id:integer} { if [string equal [pa_is_folder_p $parent_id] "f"] { - ad_complain "The specified parent folder is not valid." + ad_complain "[_ photo-album._The]" } } } -properties { @@ -23,7 +23,7 @@ ad_require_permission $parent_id pa_create_folder -set context_list [pa_context_bar_list -final "Create New Folder" $parent_id] +set context_list [pa_context_bar_list -final "[_ photo-album._Create_1]" $parent_id] template::form create folder_add @@ -34,10 +34,10 @@ -datatype integer -widget hidden template::element create folder_add label -html { size 30 } \ - -label "Folder Name" -datatype text + -label "[_ photo-album._Folder]" -datatype text template::element create folder_add description -html { size 50 } \ - -label "Folder Description" -optional -datatype text + -label "[_ photo-album._Folder_1]" -optional -datatype text if { [template::form is_request folder_add] } { @@ -96,13 +96,9 @@ from cr_items where (item_id = :folder_id or name = :name) and parent_id = :parent_id"] { - ad_return_complaint 1 "Either there is already a folder with the name \"$name\" - or you clicked on the button more than once. You can - return to the directory listing to see if your folder is there." + ad_return_complaint 1 "[_ photo-album._Either_2]" } else { - ad_return_complaint 1 "We got an error that we couldn't readily identify. Please let the system owner know about this. - -
    $errmsg
    " + ad_return_complaint 1 "[_ photo-album._We]" } ad_script_abort Index: openacs-4/packages/photo-album/www/folder-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-delete.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/folder-delete.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/folder-delete.adp 18 Nov 2003 18:27:53 -0000 1.3 @@ -6,11 +6,12 @@ -

    Are you sure you want to delete the folder "@title@"? This action cannot be reversed. +

    #photo-album.lt_Are_you_sure_you_want_1#

    - +
    + Index: openacs-4/packages/photo-album/www/folder-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-delete.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/photo-album/www/folder-delete.tcl 30 Sep 2003 12:10:09 -0000 1.3 +++ openacs-4/packages/photo-album/www/folder-delete.tcl 18 Nov 2003 18:27:53 -0000 1.4 @@ -14,20 +14,20 @@ } -validate { valid_folder -requires {folder_id:integer} { if [string equal [pa_is_folder_p $folder_id] "f"] { - ad_complain "The specified folder is not valid." + ad_complain "[_ photo-album._The_3]" } } not_root_folder -requires {folder_id} { if { $folder_id == [pa_get_root_folder] } { - ad_complain "You may not delete the root folder." + ad_complain "[_ photo-album._You_1]" } } no_children -requires {not_root_folder} { if { [db_string child_count " select count(*) from cr_items where parent_id = :folder_id"] > 0 } { - ad_complain "We're sorry, but you cannot delete folders unless they are already empty." + ad_complain "<#_We're sorry, but you cannot delete folders unless they are already empty.#>" } } } -properties { @@ -58,6 +58,6 @@ set title [db_string folder_name " select label from cr_folders where folder_id = :folder_id"] - set context_list [pa_context_bar_list -final "Delete Folder" $folder_id] + set context_list [pa_context_bar_list -final "[_ photo-album._Delete]" $folder_id] } Index: openacs-4/packages/photo-album/www/folder-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-edit.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/folder-edit.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/folder-edit.adp 18 Nov 2003 18:27:53 -0000 1.3 @@ -1,5 +1,6 @@ @title@ @context_list@ -

    Edit the Folder: +

    #photo-album.Edit_the_Folder# + Index: openacs-4/packages/photo-album/www/folder-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-edit.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/folder-edit.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/folder-edit.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -12,7 +12,7 @@ } -validate { valid_folder -requires {folder_id:integer} { if [string equal [pa_is_folder_p $folder_id] "f"] { - ad_complain "The specified folder is not valid." + ad_complain "[_ photo-album._The_3]" } } } -properties { @@ -22,18 +22,18 @@ # check for permission ad_require_permission $folder_id write -set context_list [pa_context_bar_list -final "Edit Folder Attributes" $folder_id] +set context_list [pa_context_bar_list -final "[_ photo-album._Edit_1]" $folder_id] template::form create folder_edit template::element create folder_edit folder_id -label "Folder ID" \ -datatype integer -widget hidden template::element create folder_edit label -html { size 30 } \ - -label "Folder Name" -datatype text + -label "<_#Folder Name#>" -datatype text template::element create folder_edit description -html { size 50 } \ - -label "Folder Description" -optional -datatype text + -label "<_#Folder Description#>" -optional -datatype text set title [pa_get_folder_name $folder_id] @@ -64,8 +64,7 @@ } } on_error { - ad_return_complaint 1 "An error occurred while processing your input. Please let the system owner know about this. -

    $errmsg
    " + ad_return_complaint 1 "[_ photo-album._An]" ad_script_abort } Index: openacs-4/packages/photo-album/www/folder-move.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-move.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/photo-album/www/folder-move.adp 30 Jun 2003 07:53:56 -0000 1.3 +++ openacs-4/packages/photo-album/www/folder-move.adp 18 Nov 2003 18:27:53 -0000 1.4 @@ -1,5 +1,5 @@ @title@ @context_list@ -

    Move folder to new folder: - \ No newline at end of file +

    #photo-album.lt_Move_folder_to_new_fo# + Index: openacs-4/packages/photo-album/www/folder-move.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-move.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/folder-move.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/folder-move.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -11,18 +11,18 @@ } -validate { valid_folder -requires {folder_id:integer} { if [string equal [pa_is_folder_p $folder_id] "f"] { - ad_complain "The specified folder is not valid." + ad_complain "[_ photo-album._The_3]" } } not_root_folder -requires {folder_id} { if { $folder_id == [pa_get_root_folder] } { - ad_complain "You may not move the root folder." + ad_complain "[_ photo-album._You_2]" } } } -set context_list [pa_context_bar_list -final "Move Folder" $folder_id] +set context_list [pa_context_bar_list -final "[_ photo-album._Move_1]" $folder_id] set user_id [ad_conn user_id] # to move an folder need write on folder, and old parent folder @@ -45,7 +45,7 @@ # options query retreive all folders in package that user can add an folder to set root_folder_id [pa_get_root_folder] -template::element create move_folder new_folder_id -label "Choose New Folder for Folder" \ +template::element create move_folder new_folder_id -label "[_ photo-album._Choose_1]" \ -datatype integer -widget select \ -options [db_list_of_lists get_folders "select padded_name, folder_id from (select ci.item_id, @@ -104,11 +104,9 @@ from cr_items where name = :folder_name and parent_id = :new_folder_id"] { - ad_return_complaint 1 "Either there is already an folder in the specified folder with the name \"$folder_name\" or you clicked on the button more than once. You can return to the new folder to see if your folder is there." + ad_return_complaint 1 "[_ photo-album._Either_3]" } else { - ad_return_complaint 1 "We got an error that we couldn't readily identify. Please let the system owner know about this. - -

    $errmsg
    " + ad_return_complaint 1 "[_ photo-album._We]" } ad_script_abort Index: openacs-4/packages/photo-album/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/index.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/photo-album/www/index.adp 9 Oct 2003 10:01:09 -0000 1.3 +++ openacs-4/packages/photo-album/www/index.adp 18 Nov 2003 18:27:53 -0000 1.4 @@ -7,35 +7,36 @@ - - - - +
    NameDescription
    + + + - + @@ -49,19 +50,17 @@
    #photo-album.Name##photo-album.Description#
    @child.name@
    -

    There are no items in this folder.

    +

    #photo-album.lt_There_are_no_items_in#

    -

    View all of your clipboards.

    +

    #photo-album.lt_View_all_of_your_clip#.

    - To order prints of these photos you will first need to add them - to a clipboard (you can do this when viewing an individual - photo). Once they are in a clipboard you can send them off to - shutterfly.com for - printing from a clipboard screen. + #photo-album.lt_To_order_prints_of_th# + #photo-album.shutterflycom# #photo-album.lt_for______printing_fro# #photo-album.clipboard# #photo-album.screen#

    + Index: openacs-4/packages/photo-album/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/index.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/photo-album/www/index.tcl 26 Sep 2003 14:25:22 -0000 1.4 +++ openacs-4/packages/photo-album/www/index.tcl 18 Nov 2003 18:27:53 -0000 1.5 @@ -11,7 +11,7 @@ } -validate { valid_folder -requires {folder_id:integer} { if [string equal [pa_is_folder_p $folder_id] "f"] { - ad_complain "The specified folder is not valid." + ad_complain "[_ photo-album._The_3]" } } } -properties { @@ -40,6 +40,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]] # 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: openacs-4/packages/photo-album/www/pa_master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/pa_master.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/photo-album/www/pa_master.adp 10 Jun 2003 10:07:11 -0000 1.1 +++ openacs-4/packages/photo-album/www/pa_master.adp 18 Nov 2003 18:27:53 -0000 1.2 @@ -1,5 +1,5 @@ -Photo Album System : @title@ +#photo-album.lt_Photo_Album_System__t#

    @title@

    @@ -8,3 +8,4 @@
    + Index: openacs-4/packages/photo-album/www/photo-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add-2.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photo-add-2.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/photo-add-2.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -21,6 +21,27 @@ ad_complain "The specified album is not valid." } } + valid_mime_type { + + if ![parameter::get -parameter ConverttoJpgorPng -package_id [ad_conn package_id]] { + + if { [catch {set photo_info [pa_file_info ${upload_file.tmpfile}]} errMsg] } { + ns_log Warning "Error parsing file data Error: $errMsg" + ad_complain "error" + } + + foreach {base_bytes base_width base_height base_type base_mime base_colors base_quantum base_sha256} $photo_info { break } + + if [empty_string_p $base_mime] { + set base_mime invalid + } + + if ![regexp $base_mime [parameter::get -parameter AcceptableUploadMIMETypes -package_id [ad_conn package_id]]] { + ad_complain "The parameter AcceptableUploadMIMETypes is not satisfied" + ad_complain "The parameter ConverttoJpgorPng is not in automatic mode" + } + } + } valid_photo_id -requires {photo_id:integer} { # supplied photo_id must not already exist if {[db_string check_photo_id {}]} { Index: openacs-4/packages/photo-album/www/photo-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photo-add.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/photo-add.adp 18 Nov 2003 18:27:53 -0000 1.3 @@ -1,5 +1,5 @@ -Upload a Photo +#photo-album.Upload_a_Photo# @context_list@ - \ No newline at end of file + Index: openacs-4/packages/photo-album/www/photo-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photo-add.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/photo-add.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -12,7 +12,7 @@ } -validate { valid_album -requires {album_id:integer} { if [string equal [pa_is_album_p $album_id] "f"] { - ad_complain "The specified album is not valid." + ad_complain "[_ photo-album._The_4]" } } } -properties { @@ -23,7 +23,7 @@ # check for read permission on folder ad_require_permission $album_id pa_create_photo -set context_list [pa_context_bar_list -final "Upload photos" $album_id] +set context_list [pa_context_bar_list -final "[_ photo-album._Upload]" $album_id] set photo_id [db_string get_next_object_id "select acs_object_id_seq.nextval from dual"] @@ -36,16 +36,16 @@ -label "photo_id" -datatype integer -widget hidden template::element create photo_upload upload_file \ - -label "Choose a Photo to Upload" -help_text "Use the \"Browse...\" button find a file" -datatype text -widget file + -label "[_ photo-album._Choose_2]" -help_text "[_ photo-album._Use]" -datatype text -widget file template::element create photo_upload caption -html { size 30 } \ - -label "Caption" -optional -help_text "OPTIONAL, Displayed on the thumbnail page" -datatype text + -label "<#_Caption#>" -optional -help_text "[_ photo-album.lt_OPTIONAL_Displayed_on]" -datatype text template::element create photo_upload description -html { size 50} \ - -label "Photo Description" -optional -help_text "OPTIONAL, Displayed when viewing the photo" -datatype text + -label "[_ photo-album._Photo]" -optional -help_text "[_ photo-album.lt_OPTIONAL_Displayed_wh]" -datatype text template::element create photo_upload story -html { cols 50 rows 4 wrap soft } \ - -label "Photo Story" -optional -help_text "OPTIONAL" -datatype text -widget textarea + -label "[_ photo-album._Photo_1]" -optional -help_text "[_ photo-album.OPTIONAL]" -datatype text -widget textarea template::element set_properties photo_upload album_id -value $album_id template::element set_properties photo_upload photo_id -value $photo_id Index: openacs-4/packages/photo-album/www/photo-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-delete.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photo-delete.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/photo-delete.adp 18 Nov 2003 18:27:53 -0000 1.3 @@ -7,10 +7,11 @@ -

    Are you sure you want to delete the photo "@title@"? This action cannot be undone. +

    #photo-album.lt_Are_you_sure_you_want_2#

    - +
    + Index: openacs-4/packages/photo-album/www/photo-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-delete.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/photo-album/www/photo-delete.tcl 30 Sep 2003 12:10:09 -0000 1.3 +++ openacs-4/packages/photo-album/www/photo-delete.tcl 18 Nov 2003 18:27:53 -0000 1.4 @@ -16,7 +16,7 @@ } -validate { valid_photo -requires {photo_id:integer} { if [string equal [pa_is_photo_p $photo_id] "f"] { - ad_complain "The specified photo is not valid." + ad_complain "[_ photo-album._The_2]" } } } -properties { @@ -50,7 +50,7 @@ } else { # they still need to confirm - set context_list [pa_context_bar_list -final "Delete Photo" $photo_id] + set context_list [pa_context_bar_list -final "[_ photo-album._Delete_1]" $photo_id] db_1row get_photo_info {select cr.title, i.height as height, Index: openacs-4/packages/photo-album/www/photo-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-edit.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photo-edit.adp 30 Jun 2003 07:53:56 -0000 1.2 +++ openacs-4/packages/photo-album/www/photo-edit.adp 18 Nov 2003 18:27:53 -0000 1.3 @@ -3,5 +3,70 @@ @context_list@

    - + + + + + + + + + + + + + + + + + + +
      + +   + + + + + + + + + + + + + + + + +
    + #photo-album.Hide#: +
    + #photo-album.Title#: +
    + #photo-album.Caption#: +
    + #photo-album.Descriptio#: +
    + #photo-album.Story#: +
    +
    + + + + + +
    +   + + + +   +
    + + + + +
    Index: openacs-4/packages/photo-album/www/photo-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-edit.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photo-edit.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/photo-edit.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -8,24 +8,37 @@ @creation-date 12/11/2000 @cvs-id $Id$ } { - photo_id:integer,notnull -} -validate { - valid_photo -requires {photo_id:integer} { - if [string equal [pa_is_photo_p $photo_id] "f"] { - ad_complain "The specified photo is not valid." - } - } + {hide:integer 0} + {photo_id:integer 0} + d:array,integer,optional } -properties { path:onevalue height:onevalue width:onevalue } +# -validate { +# valid_photo -requires {photo_id:integer} { +# if [string equal [pa_is_photo_p $photo_id] "f"] { +# ad_complain "[_ photo-album._The_2]" +# } +# } +# } + ad_require_permission $photo_id "write" set user_id [ad_conn user_id] -set context_list [pa_context_bar_list -final "Edit Photo Attributes" $photo_id] +set context_list [pa_context_bar_list -final "[_ photo-album._Edit_2]" $photo_id] +#clear the cached value +util_memoize_flush $photo_id + +foreach id [array names d] { + if { $d($id) > 0 } { + pa_rotate $photo_id $d($photo_id) + } +} + template::form create edit_photo template::element create edit_photo photo_id -label "photo ID" \ @@ -38,21 +51,32 @@ -datatype integer -widget hidden template::element create edit_photo title -html { size 30 } \ - -label "Photo Title" -optional -datatype text + -label "<#_Title#>" -optional -datatype text template::element create edit_photo caption -html { size 30 } \ - -label "Caption" -help_text "Displayed on the thumbnail page" -optional -datatype text + -label "<#_Caption#>" -help_text "Displayed on the thumbnail page" -optional -datatype text template::element create edit_photo description -html { size 50} \ - -label "Photo Description" -help_text "Displayed when viewing the photo" -optional -datatype text + -label "<#_Description#>" -help_text "Displayed when viewing the photo" -optional -datatype text template::element create edit_photo story -html { cols 50 rows 4 wrap soft } \ - -label "Photo Story" -optional -datatype text -help_text "Displayed when viewing the photo" -widget textarea + -label "<#_Story#>" -optional -datatype text -help_text "Displayed when viewing the photo" -widget textarea +template::element create edit_photo submit_b -widget submit \ + -label submit -optional -datatype text + # moved outside is_request_block so that vars exist during form error reply -db_1row get_photo_info {} +db_1row get_photo_info { *SQL* } +db_1row get_thumbnail_info { *SQL* } + +if [empty_string_p $live_revision] { + set checked_string "checked" +} else { + set checked_string "" +} +#ad_return_error $checked_string "$live_revision" set path $image_id if { [template::form is_request edit_photo] } { @@ -78,26 +102,35 @@ db_transaction { db_exec_plsql update_photo_attributes {} + db_dml insert_photo_attributes { *SQL* } - db_dml insert_photo_attributes {} - # for now all the attributes about the specific binary file stay the same # not allowing users to modify the binary yet # will need to modify thumb and view binaries when photo binary is changed # db_dml update_photo_user_filename {} db_exec_plsql set_live_revision {} - + + if $hide { + db_dml update_hides { *SQL* } + } } on_error { - ad_return_complaint 1 "An error occurred while processing your input. Please let the system owner know about this. + ad_return_complaint 1 "[_ photo-album._An_1]

    $errmsg
    " ad_script_abort } - + ad_returnredirect "photo?photo_id=$photo_id" ad_script_abort } +# These lines are to uncache the image in Netscape, Mozilla. +# IE6 & Safari (mac) have a bug with the images cache +ns_set put [ns_conn outputheaders] "Expires" "-" +ns_set put [ns_conn outputheaders] "Last-Modified" "-" +ns_set put [ns_conn outputheaders] "Pragma" "no-cache" +ns_set put [ns_conn outputheaders] "Cache-Control" "no-cache" + ad_return_template Index: openacs-4/packages/photo-album/www/photo-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-edit.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photo-edit.xql 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/photo-edit.xql 18 Nov 2003 18:27:53 -0000 1.3 @@ -1,10 +1,31 @@ + + + select + i.image_id as thumb_path, + i.height as thumb_height, + i.width as thumb_width + from cr_items ci, + cr_items ci2, + cr_child_rels ccr2, + images i + where ccr2.relation_tag = 'thumb' + and ci.item_id = ccr2.parent_id + and ccr2.child_id = ci2.item_id + and ci2.latest_revision = i.image_id + and ci.latest_revision is not null + and ci.item_id = :photo_id + + + select - ci.live_revision as previous_revision, + ci.item_id, + ci.live_revision, + ci.latest_revision as previous_revision, pp.caption, pp.story, cr.title, @@ -18,17 +39,24 @@ cr_items ci2, cr_child_rels ccr2, images i - where ci.live_revision = pp.pa_photo_id - and ci.live_revision = cr.revision_id + where ci.latest_revision = pp.pa_photo_id + and ci.latest_revision = cr.revision_id and ci.item_id = ccr2.parent_id and ccr2.child_id = ci2.item_id and ccr2.relation_tag = 'viewer' - and ci2.live_revision = i.image_id + and ci2.latest_revision = i.image_id and ci.item_id = :photo_id + + + + update cr_items set live_revision = null where item_id = :photo_id + + + insert into pa_photos Index: openacs-4/packages/photo-album/www/photo-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/photo-album/www/photo-postgresql.xql 12 Jun 2003 06:55:45 -0000 1.1 +++ openacs-4/packages/photo-album/www/photo-postgresql.xql 18 Nov 2003 18:27:53 -0000 1.2 @@ -34,5 +34,20 @@ + + + + select r.title as name, i.item_id + from cr_items i, cr_revisions r, cr_items i2 + where i.live_revision = r.revision_id + and acs_permission__permission_p(i.item_id, :user_id, 'pa_create_photo') = 't' + and i.content_type = 'pa_album' + and i.item_id != :old_album_id + and i.tree_sortkey between i2.tree_sortkey and tree_right(i2.tree_sortkey) + and i2.item_id = :root_folder_id + order by i.tree_sortkey + + + Index: openacs-4/packages/photo-album/www/photo.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photo.adp 9 Oct 2003 10:01:09 -0000 1.2 +++ openacs-4/packages/photo-album/www/photo.adp 18 Nov 2003 18:27:53 -0000 1.3 @@ -10,6 +10,12 @@ @title@ + +
    + <img src="images/@path@/@title@" height="@height@" width="@width@" alt="@title@"/> +
    +
    +

    @caption@

    @@ -18,18 +24,33 @@

    @description@

    -

    Story: @story@

    +

    #photo-album.Story_story#

    @@ -38,42 +59,43 @@ @photo_nav_html;noquote@ - Save this photo to print or view later + #photo-album.lt_Save_this_photo_to_pr#
    - Image saved to clipboard. + #photo-album.lt_Image_saved_to_clipbo# - Image removed from clipboard. + #photo-album.lt_Image_removed_from_cl# - Save this photo to print or view later. Place in folder + #photo-album.lt_Save_this_photo_to_pr_1# - +
    - This photo clipped to: + #photo-album.lt_This_photo_clipped_to# - @clipped.title@ [remove]  + @clipped.title@ [#photo-album.remove# -
    View all your clipboards +
    #photo-album.lt_View_all_your_clipboa#
    + Index: openacs-4/packages/photo-album/www/photo.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photo.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/photo.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -2,20 +2,16 @@ ad_page_contract { - Photo display page. + Photo display page and allows user to move a photo from one album to another album in the same folder @author Tom Baginski (bags@arsdigita.com) @creation-date 12/10/2000 @cvs-id $Id$ } { - photo_id:integer,notnull + {latest_revision 0} + {photo_id:integer 0} {collection_id:integer,optional {}} -} -validate { - valid_photo -requires {photo_id:integer} { - if [string equal [pa_is_photo_p $photo_id] "f"] { - ad_complain "The specified photo is not valid." - } - } + {show_html_p 0"} } -properties { context:onevalue title:onevalue @@ -32,30 +28,135 @@ page_num:onevalue show_base_link:onevalue clipboards:multirow +} -validate { + valid_photo -requires {photo_id:integer} { + if { [string equal $photo_id 0] && ![string equal $latest_revision 0] } { + set photo_id $latest_revision + } + if [string equal [pa_is_photo_p $photo_id] "f"] { + ad_complain "The specified photo is not valid." + } + } } ad_require_permission $photo_id "read" - set user_id [ad_conn user_id] set context [pa_context_bar_list $photo_id] +set root_folder_id [pa_get_root_folder] +# to move a photo need write on photo, and old parent album +# and pa_create_photo on new parent album (which is check in the is_valid block) + + +set old_album_id [db_string get_parent_album {}] + +ad_require_permission $photo_id write +ad_require_permission $old_album_id write + + +# These lines are to uncache the image in Netscape, Mozilla. +# IE6 & Safari (mac) have a bug with the images cache +ns_set put [ns_conn outputheaders] "Expires" "-" +ns_set put [ns_conn outputheaders] "Last-Modified" "-" +ns_set put [ns_conn outputheaders] "Pragma" "no-cache" +ns_set put [ns_conn outputheaders] "Cache-Control" "no-cache" + + # this is handled with a parameter rather than a permission on the # individual photo so admin can turn access on and off for entire # subsite at once. A permission would allow greater flexability, but # to shut down access to base photos an admin would need to search through # database and revoke all such permissions. + set show_base_link [ad_parameter AllowBasePhotoAccessP] # query all the photo and permission info with a single trip to database -if {![db_0or1row get_photo_info {}]} { - ad_return_complaint 1 "
  • photo not found" +if {![db_0or1row get_photo_info { *SQL* }]} { + ad_return_complaint 1 "
  • <#_This photo couldn't be showed because : #> +
    • <#_Photo not found or photo is hidden #>
    • +
    • <#_For show this foto edit the attributes an uncheck the option hide#>
    • +
    • <#_Your can click here to view all photos of the album #>
    • +
    " } + set path $image_id # to move a photo need write on photo and write on parent album set move_p [expr $write_p && $album_write_p] +# build form to move the photo if move_p is 1 +if $move_p { + + template::form create move_photo + + template::element create move_photo photo_id -label "photo ID" \ + -datatype integer -widget hidden + + template::element create move_photo new_album_id -label "[_ photo-album._Please]" \ + -datatype integer -widget select \ + -options [db_list_of_lists get_albums {}] + + + if { [template::form is_request move_photo] } { + template::element set_properties move_photo photo_id -value $photo_id + template::element create move_photo move_button -widget submit -label "[_ photo-album.Move]" + } + + + if { [template::form is_valid move_photo] } { + set new_album_id [template::element::get_value move_photo new_album_id] + + ad_require_permission $new_album_id "pa_create_photo" + + if [string equal [pa_is_album_p $new_album_id] "f"] { + # may add some sort of error message + # but this case only happens due to url hacking + # (or coding errors, which never happen) + ad_script_abort + } + + db_transaction { + + # not using content_item move because is only accepts + # a folder_id as target not another content_item + + set rel_id [db_string photo_rel_id {}] + + db_dml photo_move {} + + db_dml photo_move2 {} + + db_dml context_update {} + + } on_error { + # most likely a duplicate name or a double click + + set filename [db_string filename {}] + + if [db_string duplicate_check {}] { + ad_return_complaint 1 "[_ photo-album._Either_4]" + } else { + ad_return_complaint 1 "[_ photo-album._We_1]" + +
    $errmsg
    " + } + + ad_script_abort + } + pa_flush_photo_in_album_cache $old_album_id + pa_flush_photo_in_album_cache $new_album_id + + + #page used to redirect user to the page of new album containing moved photos + set page [pa_page_of_photo_in_album $photo_id $new_album_id] + + ad_returnredirect "album?album_id=$new_album_id&page=$page" + ad_script_abort + + } +} + # to delete a photo need delete on photo and write on parent album set delete_p [expr $photo_delete_p && $album_write_p] @@ -68,11 +169,5 @@ #proc pa_clipboards_get -photo_id $photo_id -multirow clipped -db_multirow clipped get_clips { -SELECT c.collection_id, c.title - FROM pa_collections c, pa_collection_photo_map m - WHERE m.photo_id = :photo_id - and m.collection_id = c.collection_id - and owner_id = :user_id - ORDER BY c.title -} +db_multirow clipped get_clips { *SQL* } + Index: openacs-4/packages/photo-album/www/photos-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-add-2.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/photo-album/www/photos-add-2.tcl 12 Jun 2003 18:05:05 -0000 1.3 +++ openacs-4/packages/photo-album/www/photos-add-2.tcl 18 Nov 2003 18:27:53 -0000 1.4 @@ -10,7 +10,6 @@ } { upload_file:trim,optional upload_file.tmpfile:optional,tmpfile - directory:trim,optional album_id:integer,notnull } -validate { valid_album -requires {album_id:integer} { @@ -23,24 +22,13 @@ ad_complain "The upload failed or the file was empty" } } - directory_exists -requires {directory:notnull} { - if {![empty_string_p $directory] && ![file isdirectory $directory]} { + directory_exists { + if {([info exists $upload_file] && ![empty_string_p $upload_file]) && ![file isdirectory [parameter::get -parameter FullTempPhotoDir -package_id [ad_conn package_id]]]} { ad_complain "The directory file does not exist" } } - directory_tmp -requires {directory:notnull} { - if {![empty_string_p $directory] && !([ad_conn user_id] == 287 || [ad_conn user_id] == 2601) && ( ![string match "/tmp/pa-tmp" $directory ] || [string match ".." $directory]) } { - ad_complain "You can currently only load images from /tmp/pa-tmp for security" - } - } - one_or_other { - if {[empty_string_p $upload_file] && [empty_string_p $directory]} { - ad_complain "Either upload a file or specify a directory to load" - } - } } - #check permission set user_id [ad_conn user_id] ad_require_permission $album_id "pa_create_photo" @@ -55,20 +43,17 @@ ns_write "Upload Log

    Upload Log


    \n" if {![empty_string_p $upload_file]} { - if {[info exists directory] && ![empty_string_p $directory]} { - ns_write "Uploading file only...please submit your directory-based upload separately
    " - } 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 $directory
    \n" - set allfiles [pa_walk $directory] + 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 } -set new_photo_ids [pa_load_images -remove $remove $allfiles $album_id $user_id] +set new_photo_ids [pa_load_images -feedback_mode 1 -remove $remove $allfiles $album_id $user_id] pa_flush_photo_in_album_cache $album_id Index: openacs-4/packages/photo-album/www/photos-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-add.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/photo-album/www/photos-add.adp 10 Jun 2003 10:07:11 -0000 1.1 +++ openacs-4/packages/photo-album/www/photos-add.adp 18 Nov 2003 18:27:53 -0000 1.2 @@ -1,5 +1,5 @@ -Upload a Photo collection +#photo-album.lt_Upload_a_Photo_collec# @context@ - \ No newline at end of file + Index: openacs-4/packages/photo-album/www/photos-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-add.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photos-add.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/photos-add.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -12,7 +12,7 @@ } -validate { valid_album -requires {album_id:integer} { if [string equal [pa_is_album_p $album_id] "f"] { - ad_complain "The specified album is not valid." + ad_complain "[_ photo-album._The_1]" } } } -properties { @@ -23,7 +23,7 @@ # check for read permission on folder ad_require_permission $album_id pa_create_photo -set context [pa_context_bar_list -final "Upload photos" $album_id] +set context [pa_context_bar_list -final "[_ photo-album._Upload]" $album_id] set photo_id [db_string get_next_object_id "select acs_object_id_seq.nextval from dual"] @@ -35,12 +35,12 @@ template::form::section photos_upload Either template::element create photos_upload upload_file \ - -label "Choose a tar or zip file to upload" -help_text "Use the \"Browse...\" button to locate your file, then click \"Open\"" -datatype text -widget file + -label "[_ photo-album._Choose_3]" -help_text "[_ photo-album._Use_1]" -datatype text -widget file template::form::section photos_upload Or template::element create photos_upload directory -html { size 50} \ - -label "Or choose a server directory to upload" -help_text "the directory must exist on server and be readable by the server process" -datatype text -widget text + -label "upload photos from the server directory" -help_text "[_ photo-album._the]" -datatype text -value "[parameter::get -parameter FullTempPhotoDir -package_id [ad_conn package_id]]" -widget text -mode display template::element set_properties photos_upload album_id -value $album_id Index: openacs-4/packages/photo-album/www/photos-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-edit-2.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photos-edit-2.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/photos-edit-2.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -6,7 +6,9 @@ d:array,integer,optional hide:array,optional caption:array - story:array + photo_story:array + photo_description:array + photo_title:array } -validate { valid_album -requires {album_id:integer} { if [string equal [pa_is_album_p $album_id] "f"] { @@ -15,6 +17,12 @@ } } +# These lines are to uncache the image in Netscape, Mozilla. +# IE6 & Safari (mac) have a bug with the images cache +ns_set put [ns_conn outputheaders] "Expires" "-" +ns_set put [ns_conn outputheaders] "Last-Modified" "-" +ns_set put [ns_conn outputheaders] "Cache-Control" "no-cache" + set context_list [pa_context_bar_list -final "Edit page $page" $album_id] set hides [list] @@ -28,12 +36,21 @@ } set acaption $caption($id) - set astory $story($id) + set aphoto_story $photo_story($id) + set aphoto_description $photo_description($id) + set aphoto_title $photo_title($id) + set aphoto_id $id + set arevision_id [db_string get_rev_id "select coalesce(live_revision,latest_revision) from cr_items where item_id = :id"] + set auser_id [ad_conn user_id] + set apeeraddr [ad_conn peeraddr] + + db_dml update_photo_attributes { *SQL* } + db_dml update_photo { update pa_photos set caption = :acaption, - story = :astory + story = :aphoto_story where pa_photo_id = (select latest_revision from cr_items where item_id = :id) } @@ -46,14 +63,18 @@ } -pa_flush_photo_in_album_cache $album_id -ad_returnredirect "album?album_id=$album_id&page=$page&msg=1" foreach id [array names d] { if { $d($id) > 0 } { pa_rotate $id $d($id) } } + +pa_flush_photo_in_album_cache $album_id + +ad_returnredirect "album?album_id=$album_id&page=$page&msg=1" + + ad_script_abort Index: openacs-4/packages/photo-album/www/photos-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-edit.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/photo-album/www/photos-edit.adp 9 Oct 2003 10:01:09 -0000 1.3 +++ openacs-4/packages/photo-album/www/photos-edit.adp 18 Nov 2003 18:27:53 -0000 1.4 @@ -43,9 +43,12 @@   - + - + + + +
    Hide:
    Hide:
    Caption:
    Story:
    Title:
    Story:
    Description:
    Taken: @child_photo.datetaken@ @child_photo.camera_model@ @child_photo.focal_length@mm @child_photo.aperture@ Flash
    Index: openacs-4/packages/photo-album/www/photos-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-edit.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/photo-album/www/photos-edit.tcl 12 Jun 2003 06:55:45 -0000 1.2 +++ openacs-4/packages/photo-album/www/photos-edit.tcl 18 Nov 2003 18:27:53 -0000 1.3 @@ -30,13 +30,20 @@ delete_p:onevalue } +# These lines are to uncache the image in Netscape, Mozilla. +# IE6 & Safari (mac) have a bug with the images cache +ns_set put [ns_conn outputheaders] "Expires" "-" +ns_set put [ns_conn outputheaders] "Last-Modified" "-" +ns_set put [ns_conn outputheaders] "Cache-Control" "no-cache" + set user_id [ad_conn user_id] # check for read permission on album ad_require_permission $album_id read set context_list [pa_context_bar_list -final "Edit page $page" $album_id] + db_1row get_album_info { select cr.title, cr.description, @@ -71,10 +78,13 @@ # query tuning showed that the order by doubled the query time while sorting a few rows in tcl was fast # wtem@olywa.net, 2001-09-24 + + set photo_sql " - select ci.item_id as photo_id, + select coalesce(ci.live_revision,0) as hide_p, + ci.item_id as photo_id, pp.caption, - pp.story, + pp.story as photo_story, to_char(pp.date_taken, 'MM/DD/YYYY HH:MI') as datetaken, pp.camera_model, pp.focal_length, @@ -86,31 +96,39 @@ it.width as thumb_width, iv.image_id as viewer_path, iv.height as viewer_height, - iv.width as viewer_width + iv.width as viewer_width, + cr.title as photo_title, + cr.description as photo_description from cr_items ci, cr_items cit, cr_child_rels ccrt, images it, cr_items civ, cr_child_rels ccrv, images iv, - pa_photos pp + pa_photos pp, + cr_revisions cr where ccrt.relation_tag = 'thumb' + and cr.revision_id = ci.latest_revision + and cr.item_id = ci.item_id and ci.item_id = ccrt.parent_id and ccrt.child_id = cit.item_id - and cit.live_revision = it.image_id + and cit.latest_revision = it.image_id and ccrv.relation_tag = 'viewer' and ci.item_id = ccrv.parent_id and ccrv.child_id = civ.item_id - and civ.live_revision = iv.image_id - and pp.pa_photo_id = ci.live_revision + and civ.latest_revision = iv.image_id + and pp.pa_photo_id = ci.latest_revision and ci.item_id in ([join $photos_on_page ","])" db_foreach get_child_photos $photo_sql { - set val(photo_id) $photo_id + set val(hide_p) $hide_p + set val(photo_id) $photo_id set val(caption) $caption - set val(story) $story + set val(photo_story) $photo_story + set val(photo_description) $photo_description + set val(photo_title) $photo_title set val(datetaken) $datetaken set val(camera_model) $camera_model set val(focal_length) $focal_length