| 47 | | $ArchiveTypes{$_} = $types->{$_} for keys %$types; |
|---|
| | 47 | my $mt = MT->instance; |
|---|
| | 48 | while (my ($type, $typedata) = each %$types) { |
|---|
| | 49 | if ('HASH' eq ref $typedata) { |
|---|
| | 50 | $typedata = { %$typedata }; # don't edit registry |
|---|
| | 51 | $typedata->{$_} = $mt->handler_to_coderef($typedata->{$_}) |
|---|
| | 52 | for qw( archive_label archive_file archive_title date_range |
|---|
| | 53 | archive_group_iter archive_group_entries |
|---|
| | 54 | archive_entries_count ); |
|---|
| | 55 | $typedata->{default_archive_templates} = [ |
|---|
| | 56 | map { ArchiveFileTemplate(%$_) } |
|---|
| | 57 | @{ $typedata->{default_archive_templates} || [] } |
|---|
| | 58 | ]; |
|---|
| | 59 | $typedata = ArchiveType(%$typedata); |
|---|
| | 60 | } |
|---|
| | 61 | $ArchiveTypes{$type} = $typedata; |
|---|
| | 62 | } |
|---|