]>
Commit | Line | Data |
---|---|---|
37dd20ad TC |
1 | package BSE::Generate::Seminar; |
2 | use strict; | |
3 | use base 'Generate::Product'; | |
4 | use BSE::TB::Seminars; | |
3f9c8a96 | 5 | use BSE::Util::HTML; |
c76e86ea | 6 | use BSE::Util::Tags qw(tag_article); |
718a070d | 7 | use BSE::Util::Iterate; |
37dd20ad | 8 | |
cb7fd78d TC |
9 | our $VERSION = "1.000"; |
10 | ||
37dd20ad TC |
11 | sub baseActs { |
12 | my ($self, $articles, $acts, $seminar, $embedded) = @_; | |
13 | ||
14 | unless ($seminar->isa('BSE::TB::Seminar')) { | |
15 | $seminar = BSE::TB::Seminars->getByPkey($seminar->{id}); | |
16 | } | |
718a070d TC |
17 | my $it = BSE::Util::Iterate->new; |
18 | my $location; | |
37dd20ad TC |
19 | return |
20 | ( | |
21 | $self->SUPER::baseActs($articles, $acts, $seminar, $embedded), | |
706b12a2 | 22 | seminar => [ \&tag_article, $seminar, $self->{cfg} ], |
37dd20ad | 23 | admin => [ tag_admin => $self, $seminar, 'seminar', $embedded ], |
718a070d TC |
24 | $it->make_iterator([ \&iter_sessions, $seminar ], 'session', 'sessions'), |
25 | $it->make_iterator | |
26 | ([ \&iter_locations, $seminar ], 'location', 'locations', | |
27 | undef, undef, undef, \$location), | |
28 | $it->make_iterator | |
29 | ([ \&iter_location_sessions, $seminar, \$location ], 'location_session', | |
30 | 'location_sessions', undef, undef, 'nocache'), | |
37dd20ad TC |
31 | ); |
32 | } | |
33 | ||
718a070d TC |
34 | sub iter_sessions { |
35 | my ($seminar) = @_; | |
36 | ||
37 | $seminar->future_session_info; | |
38 | } | |
39 | ||
40 | sub iter_locations { | |
41 | my ($seminar) = @_; | |
42 | ||
43 | $seminar->future_locations; | |
44 | } | |
45 | ||
46 | sub iter_location_sessions { | |
47 | my ($seminar, $rlocation) = @_; | |
48 | ||
49 | $$rlocation or return; | |
50 | ||
51 | $seminar->future_location_sessions($$rlocation); | |
52 | } | |
53 | ||
74b21f6d TC |
54 | sub get_real_article { |
55 | my ($self, $article) = @_; | |
56 | ||
57 | return BSE::TB::Seminars->getByPkey($article->{id}); | |
58 | } | |
59 | ||
37dd20ad | 60 | 1; |