added more vars to GalleryAlbum and GalleryFile. fixed some tests

This commit is contained in:
Doug Bell 2008-04-17 22:54:19 +00:00
parent 5b16fcca51
commit 4ebed16c69
10 changed files with 148 additions and 2 deletions

View file

@ -389,6 +389,17 @@ sub getTemplateVars {
$var->{ $key } = $galleryVar->{ $key };
}
# More things from Gallery, but with different names
for my $key ( qw{ title menuTitle url } ) {
$var->{ "gallery_" . $key } = $galleryVar->{ $key };
}
# Add some things from Album
my $albumVar = $self->getParent->getTemplateVars;
for my $key ( qw{ title menuTitle url thumbnailUrl } ) {
$var->{ "album_" . $key } = $albumVar->{ $key };
}
# Add the search form
$self->getGallery->appendTemplateVarsSearchForm( $var );

View file

@ -392,7 +392,7 @@ sub updateExifDataFromFile {
}
# Remove other, pointless keys
for my $key ( qw( directory ) ) {
for my $key ( qw( Directory ) ) {
delete $info->{ $key };
}

View file

@ -408,6 +408,12 @@ sub getTemplateVars {
$var->{ url_listFilesForCurrentUser } = $gallery->getUrl('func=listFilesForUser');
$var->{ url_search } = $gallery->getUrl('func=search');
# Add some specific vars from the Gallery
my $galleryVar = $gallery->getTemplateVars;
for my $key ( qw{ title menuTitle url } ) {
$var->{ "gallery_" . $key } = $galleryVar->{ $key };
}
# Friendly URLs
$var->{ url } = $self->getUrl;
$var->{ url_addArchive } = $self->getUrl('func=addArchive');

View file

@ -84,6 +84,18 @@ our $HELP = {
name => 'thumbnailUrl',
description => 'helpvar thumbnailUrl',
},
{
name => 'gallery_title',
description => 'helpvar gallery_title',
},
{
name => 'gallery_menuTitle',
description => 'helpvar gallery_menuTitle',
},
{
name => 'gallery_url',
description => 'helpvar gallery_url',
},
],
},

View file

@ -134,6 +134,34 @@ our $HELP = {
name => 'url_slideshow',
description => 'helpvar url_slideshow',
},
{
name => 'gallery_title',
description => 'helpvar gallery_title',
},
{
name => 'gallery_menuTitle',
description => 'helpvar gallery_menuTitle',
},
{
name => 'gallery_url',
description => 'helpvar gallery_url',
},
{
name => 'album_title',
description => 'helpvar album_title',
},
{
name => 'album_menuTitle',
description => 'helpvar album_menuTitle',
},
{
name => 'album_thumbnailUrl',
description => 'helpvar album_thumbnailUrl',
},
{
name => 'album_url',
description => 'helpvar album_url',
},
],
},

View file

@ -465,6 +465,25 @@ our $I18N = {
lastUpdated => 0,
context => 'Title for the list of actions a user can take after saving a Gallery Album',
},
'helpvar gallery_title' => {
message => q{The title of the Gallery containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
'helpvar gallery_menuTitle' => {
message => q{The menu title of the Gallery containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
'helpvar gallery_url' => {
message => q{The URL of the Gallery containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
};
1;

View file

@ -589,6 +589,48 @@ our $I18N = {
context => q{Description of template variable},
},
'helpvar gallery_title' => {
message => q{The title of the Gallery containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
'helpvar gallery_menuTitle' => {
message => q{The menu title of the Gallery containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
'helpvar gallery_url' => {
message => q{The URL of the Gallery containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
'helpvar album_title' => {
message => q{The title of the album containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
'helpvar album_menuTitle' => {
message => q{The menu title of the album containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
'helpvar album_url' => {
message => q{The URL of the album containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
'helpvar album_thumbnailUrl' => {
message => q{The URL for the thumbnail of the album containing this File},
lastUpdated => 0,
context => q{Description of template variable},
},
};
1;