From 8419d427394af77cc60353efdd16e0c59892492f Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 16 Sep 2008 14:59:51 +0000 Subject: [PATCH] rfe: Town Hall: Menu title in search results --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Search.pm | 23 +++++++++-------------- lib/WebGUI/i18n/English/Asset_Search.pm | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 8e53c405a..07ce18ce1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.6.0 + - rfe: Town Hall: Menu title in search results - rewrite macro parser, improving speed and making parameter parsing more sane - Made the charset metatag the highest thing in the head block. - fixed: AssetProxy allows proxying content in the trash or clipboard diff --git a/lib/WebGUI/Asset/Wobject/Search.pm b/lib/WebGUI/Asset/Wobject/Search.pm index 231d60912..27a9bb4e0 100644 --- a/lib/WebGUI/Asset/Wobject/Search.pm +++ b/lib/WebGUI/Asset/Wobject/Search.pm @@ -163,20 +163,15 @@ sub view { my $rs = $search->getResultSet; while (my $data = $rs->hashRef) { if ($self->session->user->userId eq $data->{ownerUserId} || $self->session->user->isInGroup($data->{groupIdView}) || $self->session->user->isInGroup($data->{groupIdEdit})) { - my $url = $data->{url}; - if ($self->get("useContainers")) { - my $asset = WebGUI::Asset->new($self->session, $data->{assetId}, $data->{className}); - if (defined $asset) { - $url = $asset->getContainer->get("url"); - } - } - push(@results, { - url => $url, - title => $data->{title}, - synopsis => $data->{synopsis}, - assetId => $data->{assetId}, - }); - $var{results_found} = 1; + my $asset = WebGUI::Asset->new($self->session, $data->{assetId}, $data->{className}); + if (defined $asset) { + my $properties = $asset->get; + if ($self->get("useContainers")) { + $properties->{url} = $asset->getContainer->get("url"); + } + push(@results, $properties); + $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')))); diff --git a/lib/WebGUI/i18n/English/Asset_Search.pm b/lib/WebGUI/i18n/English/Asset_Search.pm index 71fa4cd08..a5675fdcb 100644 --- a/lib/WebGUI/i18n/English/Asset_Search.pm +++ b/lib/WebGUI/i18n/English/Asset_Search.pm @@ -83,7 +83,7 @@ our $I18N = { ##hashref of hashes }, 'result_set' => { - message => q|Paginated search results with pagination controls.|, + message => q|Paginated search results with pagination controls. The list of variables below are the main ones used, however every property of each asset in the result set is exposed and is usable in the template.|, lastUpdated => 1149567859, },