removing old search system

This commit is contained in:
JT Smith 2004-02-29 14:37:13 +00:00
parent aa59f59f7a
commit 6cae343978
9 changed files with 17 additions and 104 deletions

View file

@ -1,30 +0,0 @@
package WebGUI::Macro::Question_search;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2003 Plain Black LLC.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use strict;
use WebGUI::HTMLForm;
use WebGUI::International;
use WebGUI::Session;
use WebGUI::URL;
#-------------------------------------------------------------------
sub process {
my ($f);
$f = WebGUI::HTMLForm->new(1);
$f->hidden("op","search");
$f->text("atLeastOne",'',$session{form}{atLeastOne});
$f->submit(WebGUI::International::get(364));
return $f->print;
}
1;

View file

@ -27,7 +27,6 @@ use WebGUI::Operation::ProfileSettings;
use WebGUI::Operation::Replacements;
use WebGUI::Operation::Root;
use WebGUI::Operation::Scratch;
use WebGUI::Operation::Search;
use WebGUI::Operation::Settings;
use WebGUI::Operation::Statistics;
use WebGUI::Operation::Style;

View file

@ -1,66 +0,0 @@
package WebGUI::Operation::Search;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2003 Plain Black LLC.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use Exporter;
use strict;
use WebGUI::HTMLForm;
use WebGUI::International;
use WebGUI::Paginator;
use WebGUI::Privilege;
use WebGUI::Search;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::URL;
our @ISA = qw(Exporter);
our @EXPORT = qw(&www_search);
#-------------------------------------------------------------------
sub www_search {
my ($constraints, $p, $output, %page, $sth, @row, $i, $url);
$url = WebGUI::URL::page('op=search');
$url = WebGUI::URL::append($url,'all='.$session{form}{all}) if ($session{form}{all} ne "");
$url = WebGUI::URL::append($url,'exactPhrase='.$session{form}{exactPhrase}) if ($session{form}{exactPhrase} ne "");
$url = WebGUI::URL::append($url,'atLeastOne='.$session{form}{atLeastOne}) if ($session{form}{atLeastOne} ne "");
$url = WebGUI::URL::append($url,'without='.$session{form}{without}) if ($session{form}{without} ne "");
$output = WebGUI::Search::form({op=>'search'});
$constraints = WebGUI::Search::buildConstraints([qw(page.synopsis page.title page.menuTitle page.metaTags
page.urlizedTitle wobject.description wobject.title wobject.namespace)]);
if ($constraints ne "") {
tie %page, 'Tie::CPHash';
$sth = WebGUI::SQL->read("select page.urlizedTitle,page.title,wobject.wobjectId,page.pageId from page,wobject where $constraints
and page.pageId=wobject.pageId and (page.pageId > 999 or page.pageId<=1)
and page.pageId<>$session{page}{pageId} order by lastEdited");
while (%page = $sth->hash) {
if (WebGUI::Privilege::canViewPage($page{pageId})) {
$row[$i] = '<li><a href="'.WebGUI::URL::gateway($page{urlizedTitle}).'#'.$page{wobjectId}.'">'.$page{title}.'</a>';
$i++;
}
}
$sth->finish;
}
if ($row[0] ne "") {
$p = WebGUI::Paginator->new($url,$session{scratch}{numResults});
$p->setDataByArrayRef(\@row);
$output .= '<p/>'.WebGUI::International::get(365).'<p><ul>';
$output .= $p->getPage($session{form}{pn});
$output .= '</ul>'.$p->getBarTraditional($session{form}{pn});
} elsif ($session{form}{exactPhrase} ne "" || $session{form}{all} ne "" || $session{form}{without} ne "" || $session{form}{atLeastOne} ne "") {
$output .= '<p/>'.WebGUI::International::get(366).'<p/>';
}
return $output;
}
1;