diff --git a/docs/upgrades/packages-7.7.0/root_import_storymanager.wgpkg b/docs/upgrades/packages-7.7.0/root_import_storymanager.wgpkg index 9fabb76e4..590d301b1 100644 Binary files a/docs/upgrades/packages-7.7.0/root_import_storymanager.wgpkg and b/docs/upgrades/packages-7.7.0/root_import_storymanager.wgpkg differ diff --git a/lib/WebGUI/Asset/Wobject/StoryArchive.pm b/lib/WebGUI/Asset/Wobject/StoryArchive.pm index f0c168e15..3d6bee608 100644 --- a/lib/WebGUI/Asset/Wobject/StoryArchive.pm +++ b/lib/WebGUI/Asset/Wobject/StoryArchive.pm @@ -266,15 +266,20 @@ sub view { #------------------------------------------------------------------- -=head2 viewTemplateVars ( ) +=head2 viewTemplateVars ( $mode ) Make template variables for the view template. +=head3 $mode + +Whether to get assets in view mode, by time, or search mode, by keywords. + =cut sub viewTemplateVariables { - my ($self) = @_; - my $session = $self->session; + my ($self) = @_; + my $session = $self->session; + my $keywords = $session->form->get('keywords'); ##Only return assetIds, we'll build data for the things that are actually displayed. my $storySql = $self->getLineageSql(['descendants'],{ excludeClasses => ['WebGUI::Asset::Wobject::Folder'], @@ -315,6 +320,12 @@ sub viewTemplateVariables { startAsset => $self, displayFunc => 'search', }); + my $i18n = WebGUI::International->new($session, 'Asset'); + $var->{searchHeader} = WebGUI::Form::formHeader($session, { action => $self->getUrl }) + . WebGUI::Form::hidden($session, { func => 'view' }); + $var->{searchFooter} = WebGUI::Form::formFooter($session); + $var->{searchButton} = WebGUI::Form::submit($session, { name => 'search', value => $i18n->get('search')}); + $var->{searchForm} = WebGUI::Form::text($session, { name => 'keywords', value => $keywords}); return $var; } diff --git a/lib/WebGUI/Help/Asset_StoryArchive.pm b/lib/WebGUI/Help/Asset_StoryArchive.pm index 11f96069c..f33148e1a 100644 --- a/lib/WebGUI/Help/Asset_StoryArchive.pm +++ b/lib/WebGUI/Help/Asset_StoryArchive.pm @@ -34,6 +34,10 @@ our $HELP = { }, ] }, + { 'name' => 'searchHeader' }, + { 'name' => 'searchForm' }, + { 'name' => 'searchButton' }, + { 'name' => 'searchFooter' }, ], related => [] }, diff --git a/lib/WebGUI/i18n/English/Asset_StoryArchive.pm b/lib/WebGUI/i18n/English/Asset_StoryArchive.pm index 88959c04d..c90989f44 100644 --- a/lib/WebGUI/i18n/English/Asset_StoryArchive.pm +++ b/lib/WebGUI/i18n/English/Asset_StoryArchive.pm @@ -171,6 +171,30 @@ our $I18N = { lastUpdated => 0, }, + 'searchHeader' => { + message => q|HTML code for beginning the search form.|, + context => q|Template variable.|, + lastUpdated => 0, + }, + + 'searchForm' => { + message => q|The text field where users can enter in keywords for the search.|, + context => q|label for the URL to add a story to the archive.|, + lastUpdated => 0, + }, + + 'searchButton' => { + message => q|Button with internationalized label for submitting the search form.|, + context => q|Template variable.|, + lastUpdated => 0, + }, + + 'searchFooter' => { + message => q|HTML code for ending the search form.|, + context => q|label for the URL to add a story to the archive.|, + lastUpdated => 0, + }, + }; 1;