X-Git-Url: http://git.home-dn.net/?p=manu%2FRT-Extension-SearchResults-XLS.git;a=blobdiff_plain;f=html%2FCallbacks%2FResults-XLS%2FElements%2FTabs%2FPrivileged;h=75eee5ec220b015e8439100755a22a341ef46bb9;hp=30c51c19dc6ccfb8ab749e02fb63733c6218af1f;hb=88c0c6602002fc7c0bb26d6d633237286e268bb8;hpb=d1dee62ceda5c55120fc65d10447cb82834fe612 diff --git a/html/Callbacks/Results-XLS/Elements/Tabs/Privileged b/html/Callbacks/Results-XLS/Elements/Tabs/Privileged index 30c51c1..75eee5e 100644 --- a/html/Callbacks/Results-XLS/Elements/Tabs/Privileged +++ b/html/Callbacks/Results-XLS/Elements/Tabs/Privileged @@ -55,12 +55,29 @@ my $query_string = sub { return $u->query; }; -if ( $request_path =~ qr{^/Search/Results\.html} ) { - my $tabs = PageMenu; - $tabs->child( - 'xls' => title => loc('XLS'), - path => '/Search/Results.xls?' . $query_string->( %{ $m->request_args } ) - ); + +if ( + ( + $request_path =~ m{^/Search/} + && $request_path !~ m{^/Search/Simple\.html} + ) + || ( $request_path =~ m{^/Search/Simple\.html} + && $DECODED_ARGS->{'q'} ) + ) { + + my $has_query = ''; + my $current_search = $session{"CurrentSearchHash"} || {}; + $has_query = 1 if ( $DECODED_ARGS->{'Query'} or $current_search->{'Query'} ); + + if ( $has_query ) { + my $tabs = PageMenu; + my $feeds = $tabs->child('more'); + + $feeds->child( + 'xls' => title => loc('XLS'), + path => '/Search/Results.xls?' . $query_string->( %{ $m->request_args } ) + ); + } }