1 $EditCluster = 'EditCluster';
4 my $printDailyTear = shift;
5 my $printRCLine = shift;
9 # note that minor edits have no effect!
10 foreach my $rcline (@outrc) {
11 my ($ts, $pagename) = split(/$FS/, $rcline);
12 $changetime{$pagename} = $ts;
15 my $all = GetParam
('all', 0);
16 my ($idOnly, $userOnly, $hostOnly, $clusterOnly, $filterOnly, $match, $lang) =
17 map { GetParam
($_, ''); }
18 ('rcidonly', 'rcuseronly', 'rchostonly', 'rcclusteronly',
19 'rcfilteronly', 'match', 'lang');
20 my @clusters = $q->param('clusters'); # the clusters the user is interested in
22 my %wanted_clusters = ();
24 if ($_ eq T
('ordinary changes')) {
27 $wanted_clusters{$_} = 1;
30 $wanted_clusters{$clusterOnly} = $clusterOnly;
31 @outrc = reverse @outrc if GetParam
('newtop', $RecentTop);
33 @filters = SearchTitleAndBody
($filterOnly) if $filterOnly;
34 foreach my $rcline (@outrc) {
35 my ($ts, $pagename, $minor, $summary, $host, $username, $revision, $languages, $cluster)
36 = split(/$FS/, $rcline);
37 next if not $all and $ts < $changetime{$pagename};
38 next if $idOnly and $idOnly ne $pagename;
39 next if $match and $pagename !~ /$match/i;
40 next if $hostOnly and $host !~ /$hostOnly/i;
41 next if $filterOnly and not grep(/^$pagename$/, @filters);
42 next if ($userOnly and $userOnly ne $username);
43 my @languages = split(/,/, $languages);
44 next if ($lang and @languages and not grep(/$lang/, @languages));
45 # meatball summary clustering
46 my %cluster = (); # the clusters of the page
47 $cluster{$cluster} = 1 if $cluster;
48 while ($summary =~ /^\[(.*)\]/g) {
50 $group = join(',', sort(split(/\s*,\s*/, $group)));
53 # user wants no cluster but page has cluster
54 next if not %wanted_clusters and %cluster;
55 # users wants clusters, so must match with clusters of the page;
56 # if page has no clusters and user wants ordinary pages, skip the
58 if ($ordinary and not %cluster) {
60 } elsif (%wanted_clusters) {
62 foreach my $cluster (keys %cluster) { # assuming "fr,CopyEdit"
63 foreach $member (split(/,/, $cluster)) { # eg. "fr"
64 if ($cluster{$cluster}) {
73 if ($date ne CalcDay
($ts)) {
75 &$printDailyTear($date);
77 &$printRCLine($pagename, $ts, $host, $username, $summary, 0, $revision,
78 \
@languages, $cluster);
82 *EditClusterOldRcHeader
= *RcHeader
;
83 *RcHeader
= *EditClusterNewRcHeader
;
85 sub EditClusterNewRcHeader
{
86 if (GetParam
('from', 0)) {
87 print $q->h2(Ts
('Updates since %s', TimeToText
(GetParam
('from', 0))));
89 print $q->h2((GetParam
('days', $RcDefault) != 1)
90 ? Ts
('Updates in the last %s days', GetParam
('days', $RcDefault))
91 : Ts
('Updates in the last %s day', GetParam
('days', $RcDefault)))
94 my ($idOnly, $userOnly, $hostOnly, $clusterOnly, $filterOnly, $match, $lang) =
96 my $val = GetParam
($_, '');
97 print $q->p($q->b('(' . Ts
('for %s only', $val) . ')')) if $val;
98 $action .= ";$_=$val" if $val; # remember these parameters later!
101 ('rcidonly', 'rcuseronly', 'rchostonly', 'rcclusteronly',
102 'rcfilteronly', 'match', 'lang');
104 $action = GetPageParameters
('browse', $clusterOnly) . $action;
106 $action = "action=rc$action";
108 my $days = GetParam
('days', $RcDefault);
109 my $all = GetParam
('all', 0);
112 push(@menu, ScriptLink
("$action;days=$days;all=0",
113 T
('List latest change per page only'),'','','','',1));
115 push(@menu, ScriptLink
("$action;days=$days;all=1",
116 T
('List all changes'),'','','','',1));
118 print $q->p((map { ScriptLink
("$action;days=$_;all=$all",
119 ($_ != 1) ? Ts
('%s days', $_) : Ts
('%s days', $_),'','','','',1);
120 } @RcDays), $q->br(), @menu, $q->br(),
121 ScriptLink
($action . ';from=' . ($LastUpdate + 1) . ";all=$all",
122 T
('List later changes')));
123 my @clusters = ((map { /\* (\S+)/; $1; }
124 grep(/^\* /, split(/\n/, GetPageContent
($EditCluster)))),
125 T
('ordinary changes'));
126 return unless @clusters;
127 my $form = GetFormStart
(undef, 'get') . $q->checkbox_group('clusters', \
@clusters);
128 $form .= $q->input({-type
=>'hidden', -name
=>'action', -value
=>'rc'});
129 $form .= $q->input({-type
=>'hidden', -name
=>'all', -value
=>1}) if $all;
130 $form .= $q->input({-type
=>'hidden', -name
=>'days', -value
=>$days}) if $days != $RcDefault;
131 $form .= $q->input({-type
=>'hidden', -name
=>'rcfilteronly', -value
=>$rcfilteronly}) if $rcfilteronly;
132 $form .= $q->input({-type
=>'hidden', -name
=>'rcuseronly', -value
=>$rcuseronly}) if $rcuseronly;
133 $form .= $q->input({-type
=>'hidden', -name
=>'rchostonly', -value
=>$rchostonly}) if $rchostonly;
134 $form .= $q->input({-type
=>'hidden', -name
=>'match', -value
=>$match}) if $match;
135 $form .= $q->input({-type
=>'hidden', -name
=>'lang', -value
=>$lang}) if $lang;
136 print $form, ' ', $q->submit(T
('Go!')), $q->end_form();