More Gallery i18n

fix: Add an Album link now appears on Gallery List Albums view
This commit is contained in:
Doug Bell 2008-02-21 18:38:25 +00:00
parent 5f28ad91c3
commit ce4688310e
8 changed files with 178 additions and 5 deletions

View file

@ -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

View file

@ -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") {

View file

@ -296,7 +296,7 @@ sub definition {
push @{$definition}, {
assetName => $i18n->get('assetName'),
icon => 'newWobject.gif',
icon => 'photoGallery.gif',
autoGenerateForms => 1,
tableName => 'Gallery',
className => __PACKAGE__,

View file

@ -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<userId> 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<othersCanAdd> is true and the Gallery allows them to add files.
Users can add files to this album if they are the owner, if
C<othersCanAdd> 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__),

View file

@ -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',

View file

@ -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;

View file

@ -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;

View file

@ -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;