Implemented a RFE for returning a message when no search

results were found.
This commit is contained in:
Colin Kuskie 2007-05-26 03:54:26 +00:00
parent 3f4a3211bd
commit 1a55630eef
4 changed files with 26 additions and 1 deletions

View file

@ -142,6 +142,7 @@ sub view {
$var{'form_footer'} = WebGUI::Form::formFooter($self->session);
$var{'form_submit'} = WebGUI::Form::submit($self->session, {value=>$i18n->get("search")});
$var{'form_keywords'} = WebGUI::Form::text($self->session, {name=>"keywords", value=>$self->session->form->get("keywords")});
$var{'no_results'} = $i18n->get("no results");
if ($self->session->form->get("doit")) {
my $search = WebGUI::Search->new($self->session);
my %rules = (
@ -160,6 +161,7 @@ sub view {
title=>$data->{title},
synopsis=>$data->{synopsis},
});
$var->{results_found} = 1;
}
}
my $p = WebGUI::Paginator->new($self->session,$self->getUrl('doit=1;keywords='.$self->session->url->escape($self->session->form->get('keywords'))));

View file

@ -93,7 +93,13 @@ our $HELP = {
'name' => 'synopsis',
},
],
}
},
{
'name' => 'results_found',
},
{
'name' => 'no_results',
},
],
related => [
{

View file

@ -132,6 +132,21 @@ be useful, others may not.|,
lastUpdated => 1169843465,
},
'results_found' => {
message => q|A conditional variable that will be true if any results were found.|,
lastUpdated => 1170549116,
},
'no results' => {
message => q|No results were found.|,
lastUpdated => 1170549113,
},
'no_results' => {
message => q|An internationalized label for telling the user that no results were found.|,
lastUpdated => 1170549119,
},
};
1;