diff --git a/modules/search-list.pl b/modules/search-list.pl
index 676dd8ba..11b823e1 100644
--- a/modules/search-list.pl
+++ b/modules/search-list.pl
@@ -15,13 +15,13 @@
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
-
-$ModulesDescription .= '
$Id: search-list.pl,v 1.10 2007/11/13 20:24:50 sheep Exp $
';
+# syntax change by Weakish Jiang
+$ModulesDescription .= '$Id: search-list.pl,v 1.11 2008/04/25 09:48:28 weakish Exp $
';
push(@MyRules, \&SearchListRule);
sub SearchListRule {
- if ($bol && /\G(<list (.*?)>)/cgis) {
+ if ($bol && /\G(\[\[!list (.*?)\]\])/cgis) {
#
Clean(CloseHtmlEnvironments());
Dirty($1);
@@ -51,3 +51,35 @@ sub SearchListRule {
}
return undef;
}
+
+# Add a new action list
+
+$Action{list} = \&DoList;
+
+sub DoList {
+my $id = shift;
+my $search = GetParam('search', '');
+ ReportError(T('The search parameter is missing.')) unless $search;
+ print GetHeader('', Ts('Page list for %s', $search), '');
+ if (!$ListPage) {
+ $ListPage = 1;
+ # Now save information required for saving the cache of the current page.
+ local (%Page, $OpenPageName);
+ my %hash = ();
+ foreach my $id (SearchTitleAndBody($search)) {
+ $hash{$id} = 1 unless $id eq $original; # skip the page with the query
+ }
+ my @found = keys %hash;
+ if (defined &PageSort) {
+ @found = sort PageSort @found;
+ } else {
+ @found = sort(@found);
+ }
+ @found = map { $q->li(GetPageLink($_)) } @found;
+ print $q->start_div({-class=>'search list'}),
+ $q->ul(@found), $q->end_div;
+ }
+ $ListPage = 0;
+ PrintFooter();
+}
+