sub printimgs {
say '<ul>';
for my $row (@_) {
- my ($level, $mark, $title) = split /([a-z]*):/, $row, 2;
+ my ($id, $level, $title) = split /:/, $row, 3;
my @type;
- push @type, 'parent' if defined $table->{$row};
- push @type, 'large' if $mark;
+ push @type, 'parent' if defined $table->{$id};
+ push @type, 'large' if $level =~ s/c$//;
push @type, 'level'.($level || 0);
printf '<li%s>', @type ? sprintf ' class="%s"', join ' ', @type : '';
print showimg($title) if $level <= $limit;
- printimgs(@{$_}) for $table->{$row} // ();
+ printimgs(@{$_}) for $table->{$id} // ();
print '</li>';
}
say '</ul>';
}
say '<section class="gallery">';
-printimgs(@{$table->{''}});
+printimgs($table->{''}->[0]);
say '</section>';