+ push @{$self->{errors}->{$name}}, $token->{_lc} if $attr->{'[%'} or $attr->{'[%-'};
+ },
+ errors => {},
+ },
+ {
+ description => '<body> tag with id and class attributes',
+ check => sub {
+ my ($self, $name, $token) = @_;
+ return if $name =~ /bodytag\.inc/;
+ my $tag = $token->{_string};
+ push @{$self->{errors}->{$name}}, $token->{_lc}
+ if $tag =~ /^<body/ &&
+ ($tag !~ /id=".+"/ || $tag !~ /class=".+"/);
+ },
+ errors => {},
+ },
+];
+find( sub {
+ my $dir = getcwd();
+ return if $dir =~ /blib/;
+ return unless /\.(tt|inc)$/;
+ ($dir) = $dir =~ /koha-tmpl\/(.*)$/;
+ my $name = $_;
+ my $parser = C4::TTParser->new;
+ $parser->build_tokens( $name );
+ while ( my $token = $parser->next_token ) {
+ my $attr = $token->{_attr};
+ next unless $attr;
+ for my $checker (@$checkers) {
+ $checker->{check}->($checker, "$dir/$name", $token);