diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2ef97606f..16ed80bcc 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -97,6 +97,8 @@ - fixed: Password Recovery now only works for Active users and does not allow deactivated users to log in - fixed: Gallery Search now correctly limits by class name + - added: A template variable to distinguish between Files and Albums in the Gallery + Search 7.5.10 - fix: Syntax error in GetCsMail diff --git a/lib/WebGUI/Asset/Wobject/Gallery.pm b/lib/WebGUI/Asset/Wobject/Gallery.pm index 30c367dac..6b9775f3a 100644 --- a/lib/WebGUI/Asset/Wobject/Gallery.pm +++ b/lib/WebGUI/Asset/Wobject/Gallery.pm @@ -1069,7 +1069,10 @@ sub www_search { $p->appendTemplateVars( $var ); for my $result ( @{ $p->getPageData } ) { my $asset = WebGUI::Asset->newByDynamicClass( $self->session, $result->{assetId} ); - push @{ $var->{search_results} }, $asset->getTemplateVars; + push @{ $var->{search_results} }, { + %{ $asset->getTemplateVars }, + isAlbum => $asset->isa( 'WebGUI::Asset::Wobject::GalleryAlbum' ), + }; } } diff --git a/lib/WebGUI/Help/Asset_Gallery.pm b/lib/WebGUI/Help/Asset_Gallery.pm index d449681f2..4ef482f1e 100644 --- a/lib/WebGUI/Help/Asset_Gallery.pm +++ b/lib/WebGUI/Help/Asset_Gallery.pm @@ -154,6 +154,12 @@ our $HELP = { { name => 'search_results', description => 'helpvar search_results', + variables => [ + { + name => 'isAlbum', + description => 'helpvar isAlbum', + }, + ], }, ], # All classes that can be found by a Gallery search go in here diff --git a/lib/WebGUI/i18n/English/Asset_Gallery.pm b/lib/WebGUI/i18n/English/Asset_Gallery.pm index 058f21fba..0136f7ea3 100644 --- a/lib/WebGUI/i18n/English/Asset_Gallery.pm +++ b/lib/WebGUI/i18n/English/Asset_Gallery.pm @@ -693,6 +693,12 @@ our $I18N = { lastUpdated => 0, context => q{Error message when trying to add albums to uncommitted Gallery assets}, }, + + 'helpvar isAlbum' => { + message => q{This variable is true if the current result is a GalleryAlbum.}, + lastUpdated => 0, + context => q{Description of template variable}, + }, }; 1;