Permalink
Browse files

Group pages with comment pages in page index

  • Loading branch information...
AlexDaniel committed Aug 25, 2015
1 parent a000937 commit ac21a8e6a4ee614db75d06e1a80c3a3e62cd73f6
Showing with 9 additions and 1 deletion.
  1. +9 −1 wiki.pl
View
10 wiki.pl
@@ -3260,6 +3260,14 @@ sub BannedContent {
return 0;
}
sub SortIndex {
my ($A, $B) = ($a, $b);
my $aIsComment = $A =~ s/^$CommentsPrefix//;
$B =~ s/^$CommentsPrefix//;
return $aIsComment ? 1 : -1 if $A eq $B;
$A cmp $B;
}
sub DoIndex {
my $raw = GetParam('raw', 0);
my $match = GetParam('match', '');
@@ -3274,7 +3282,7 @@ sub DoIndex {
push(@menu, $q->checkbox(-name=>$option, -checked=>$value, -label=>$text));
}
@pages = grep /$match/i, @pages if $match;
@pages = sort @pages;
@pages = sort SortIndex @pages;
if ($raw) {
print GetHttpHeader('text/plain'); # and ignore @menu
} else {

0 comments on commit ac21a8e

Please sign in to comment.