Search form for StoryArchive view form.

This commit is contained in:
Colin Kuskie 2009-03-07 04:16:29 +00:00
parent 9368a5dbcf
commit c12e1b3758
4 changed files with 42 additions and 3 deletions

View file

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

View file

@ -34,6 +34,10 @@ our $HELP = {
},
]
},
{ 'name' => 'searchHeader' },
{ 'name' => 'searchForm' },
{ 'name' => 'searchButton' },
{ 'name' => 'searchFooter' },
],
related => []
},

View file

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