diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 78e2eb3d7..82446da33 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -4,6 +4,9 @@ ref. - fixed: creating new ad spaces is broken - don't write .wgaccess files for public uploads, allowing WRE optimizations + - More i18n for Gallery templates + - fix: Add an Album button now appears on Gallery List Albums view for those + authorized. 7.5.2 - add: Auth modules now accept a "returnUrl" form parameter when logging in diff --git a/lib/WebGUI/Asset/File/Image/Photo.pm b/lib/WebGUI/Asset/File/Image/Photo.pm index 58d4eca88..7373a98d1 100644 --- a/lib/WebGUI/Asset/File/Image/Photo.pm +++ b/lib/WebGUI/Asset/File/Image/Photo.pm @@ -99,7 +99,7 @@ sub definition { push @{$definition}, { assetName => $i18n->get('assetName'), autoGenerateForms => 0, - icon => 'Image.gif', + icon => 'photo.gif', tableName => 'Photo', className => 'WebGUI::Asset::File::Image::Photo', i18n => 'Asset_Photo', @@ -932,6 +932,10 @@ sub www_edit { my $var = { url_addArchive => $self->getParent->getUrl('func=addArchive'), }; + + if ( $form->get('assetId') eq "new" ) { + $var->{ isNewPhoto } = 1; + } # Generate the form if ($form->get("func") eq "add") { diff --git a/lib/WebGUI/Asset/Wobject/Gallery.pm b/lib/WebGUI/Asset/Wobject/Gallery.pm index 1ab9df3e7..4a08402b6 100644 --- a/lib/WebGUI/Asset/Wobject/Gallery.pm +++ b/lib/WebGUI/Asset/Wobject/Gallery.pm @@ -296,7 +296,7 @@ sub definition { push @{$definition}, { assetName => $i18n->get('assetName'), - icon => 'newWobject.gif', + icon => 'photoGallery.gif', autoGenerateForms => 1, tableName => 'Gallery', className => __PACKAGE__, diff --git a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm index 3a482d2c7..c7a4880e3 100644 --- a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm +++ b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm @@ -73,7 +73,7 @@ sub definition { push @{$definition}, { assetName => $i18n->get('assetName'), autoGenerateForms => 0, - icon => 'newWobject.gif', + icon => 'photoAlbum.gif', tableName => 'GalleryAlbum', className => __PACKAGE__, properties => \%properties, @@ -190,8 +190,9 @@ sub canAdd { Returns true if the user can add a file to this album. C is a WebGUI user ID. If no userId is passed, will check the current user. -Users can add files to this album if they are the owner, or if -C is true and the Gallery allows them to add files. +Users can add files to this album if they are the owner, if +C is true and the Gallery allows them to add files, or if +they are allowed to edit the parent Gallery. =cut @@ -202,6 +203,7 @@ sub canAddFile { return 1 if $userId eq $self->get("ownerUserId"); return 1 if $self->get("othersCanAdd") && $gallery->canAddFile( $userId ); + return $gallery->canEdit( $userId ); } #---------------------------------------------------------------------------- @@ -744,6 +746,7 @@ sub www_edit { # Generate the form if ($form->get("func") eq "add") { + $var->{ isNewAlbum } = 1; $var->{ form_start } = WebGUI::Form::formHeader( $session, { action => $self->getParent->getUrl('func=editSave;assetId=new;class='.__PACKAGE__), diff --git a/lib/WebGUI/Help/Asset_Photo.pm b/lib/WebGUI/Help/Asset_Photo.pm index 91c3d02ca..1744f613a 100644 --- a/lib/WebGUI/Help/Asset_Photo.pm +++ b/lib/WebGUI/Help/Asset_Photo.pm @@ -142,6 +142,10 @@ our $HELP = { title => 'help edit title', body => 'help edit body', variables => [ + { + name => 'isNewPhoto', + description => 'helpvar isNewPhoto', + }, { name => 'url_addArchive', description => 'helpvar url_addArchive', diff --git a/lib/WebGUI/i18n/English/Asset_Gallery.pm b/lib/WebGUI/i18n/English/Asset_Gallery.pm index ca472955e..1c21ad3e9 100644 --- a/lib/WebGUI/i18n/English/Asset_Gallery.pm +++ b/lib/WebGUI/i18n/English/Asset_Gallery.pm @@ -652,6 +652,11 @@ our $I18N = { context => q{Label for number of files in the Album}, }, + 'template url_addAlbum' => { + message => q{Add an Album}, + lastUpdated => 0, + context => q{Label for the link to add an Album}, + }, }; 1; diff --git a/lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm b/lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm index ced250b8b..8578ccc16 100644 --- a/lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm +++ b/lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm @@ -123,6 +123,11 @@ our $I18N = { lastUpdated => 0, }, + 'helpvar isNewAlbum' => { + message => 'This variable is true if the user is adding a new Album to the Gallery', + lastUpdated => 0, + }, + 'helpvar canAddFile' => { message => 'This variable is true if the user can add files to this Album.', lastUpdated => 0, @@ -353,6 +358,90 @@ our $I18N = { lastUpdated => 0, context => 'Label for the number of comments on the file', }, + + 'template add' => { + message => "Add", + lastUpdated => 0, + context => 'Verb shown in title when adding a new Album', + }, + + 'template edit' => { + message => "Edit", + lastUpdated => 0, + context => 'Verb shown in title when editing an existing Album', + }, + + 'template assetName' => { + message => "Album", + lastUpdated => 0, + context => "The asset's name shown in templates", + }, + + 'editForm title label' => { + message => 'Title', + lastUpdated => 0, + context => 'Label for the "Title" property of the Album asset', + }, + + 'editForm description label' => { + message => 'Description', + lastUpdated => 0, + context => 'Label for the "Description" property of the Album asset', + }, + + 'editForm assetIdThumbnail label' => { + message => 'Please select a thumbnail to represent your album.', + lastUpdated => 0, + }, + + 'template upload type' => { + message => 'Upload Type', + lastUpdated => 0, + context => 'Label for different methods of uploading', + }, + + 'template upload single' => { + message => 'Single File', + lastUpdated => 0, + context => 'Label for uploading a single file', + }, + + 'template upload archive' => { + message => 'Zip Archive', + lastUpdated => 0, + context => 'Label for uploading an archive of files', + }, + + 'addArchive file' => { + message => 'Archive', + lastUpdated => 0, + context => 'Label for the file upload control of the Add Archive page', + }, + + 'addArchive keywords' => { + message => 'Tags', + lastUpdated => 0, + context => 'Label for the "keywords" field of the Add Archive page', + }, + + 'addArchive friendsOnly' => { + message => 'Friends Only', + lastUpdated => 0, + context => 'Label for the "friends only" field of the Add Archive page', + }, + + 'template addArchive title' => { + message => "Add Zip Archive", + lastUpdated => 0, + context => 'Title for the Add Archive page', + }, + + 'template addArchive body' => { + message => 'This form accepts both "zip" and "tar/gzipped" archives', + lastUpdated => 0, + context => 'Body text explaining what kinds of archives can be submitted', + }, + }; 1; diff --git a/lib/WebGUI/i18n/English/Asset_Photo.pm b/lib/WebGUI/i18n/English/Asset_Photo.pm index 5f7bd070b..ef1df426e 100644 --- a/lib/WebGUI/i18n/English/Asset_Photo.pm +++ b/lib/WebGUI/i18n/English/Asset_Photo.pm @@ -81,6 +81,11 @@ our $I18N = { lastUpdated => 0, }, + 'helpvar isNewPhoto' => { + message => 'This variable is true if the user is adding a new Photo', + lastUpdated => 0, + }, + 'helpvar commentForm_start' => { message => 'Begin the comment form', lastUpdated => 0, @@ -398,6 +403,66 @@ our $I18N = { context => 'Label for photos that are not friends only', }, + 'template assetName' => { + message => 'Photo', + lastUpdated => 0, + context => 'Asset name for templates.', + }, + + 'editForm title label' => { + message => 'Title', + lastUpdated => 0, + context => 'Label for "title" property', + }, + + 'editForm synopsis label' => { + message => 'Description', + lastUpdated => 0, + context => 'Label for "synopsis" property', + }, + + 'editForm photo new' => { + message => 'New Photo', + lastUpdated => 0, + context => 'Label for upload field when adding a new photo', + }, + + 'editForm photo replace' => { + message => 'Replace Photo', + lastUpdated => 0, + context => 'Label for upload field when replacing an existing photo', + }, + + 'editForm keywords' => { + message => 'Tags', + lastUpdated => 0, + context => 'Label for "keywords" field', + }, + + 'editForm location' => { + message => 'Location', + lastUpdated => 0, + context => 'Label for "location" field', + }, + + 'editForm friendsOnly' => { + message => 'Friends Only', + lastUpdated => 0, + context => 'Label for "friends only" field', + }, + + 'editForm cancel' => { + message => 'Cancel', + lastUpdated => 0, + context => 'Label for "cancel" button', + }, + + 'editForm save' => { + message => 'Save', + lastUpdated => 0, + context => 'Label for "save" button', + }, + }; 1;