%#============================================================================ %# ePortal - WEB Based daily organizer %# Author - S.Rusakov %# %# Copyright (c) 2001 Sergey Rusakov. All rights reserved. %# This program is free software; you can redistribute it %# and/or modify it under the same terms as Perl itself. %# %# $Revision: 3.2 $ %# $Date: 2003/04/24 05:36:52 $ %# $Header: /home/cvsroot/ePortal/comp_root/catalog/search.htm,v 3.2 2003/04/24 05:36:52 ras Exp $ %# %#---------------------------------------------------------------------------- %# Parameters: %# text - text to search in Catalog %#---------------------------------------------------------------------------- <% pick_lang( rus => "Результат поиска ", eng => "Search result of ") %><% $ARGS{text} |h%>

<%perl> my $text = $ARGS{text}; my $like = '%'.$text.'%'; $links_count = 0; my $catalog = new ePortal::Catalog; $catalog->restore_where( where => "(title like ? OR memo like ? OR url like ? OR (recordtype like 'text%' AND text like ?))", bind => [ $like, $like, $like, $like], order_by => "Title", skip_attributes => [qw/text/], limit_rows => 50); while($catalog->restore_next) { $links_count ++; $m->comp("links.htm:drawLink", link=> $catalog, highlight => $text); } undef $catalog;
% if ($links_count == 0) { <& /message.mc, ErrorMessage => pick_lang( rus => "Поиск не принес результатов", eng => 'Nothing found' ) &> % }

<% plink(pick_lang( rus => "Вернуться в Каталог Ресурсов", eng => "Back to Resources Catalogue"), -href => href("index.htm", group => $ARGS{group})) %>
%#=== @METAGS attr ========================================================= <%attr> Title => {rus => "Результат поиска в Каталоге ресурсов", eng => "Search results"} %#=== @METAGS once ========================================================= <%once> my $links_count = 0; %#=== @METAGS HTMLhead ==================================================== <%method HTMLhead> %#=== @METAGS onStartRequest ==================================================== <%method onStartRequest><%perl> if ( ! $ARGS{text} ) { # nothing to search return "index.htm"; }