Lines 51-64
my $homebranch;
Link Here
|
51 |
if (C4::Context->userenv) { |
51 |
if (C4::Context->userenv) { |
52 |
$homebranch = C4::Context->userenv->{'branch'}; |
52 |
$homebranch = C4::Context->userenv->{'branch'}; |
53 |
} |
53 |
} |
54 |
my $all_koha_news = &GetNewsToDisplay($news_lang,$homebranch); |
54 |
|
55 |
my $koha_news_count = scalar @$all_koha_news; |
55 |
my $news_id = $input->param('news_id'); |
|
|
56 |
my ($all_koha_news, $koha_news_count, $news_type); |
57 |
if (defined $news_id && length $news_id) { |
58 |
$all_koha_news = GetNewsToDisplay($news_lang, $homebranch, undef, $news_id); |
59 |
$koha_news_count = 1; |
60 |
$news_type = 'news_item'; |
61 |
} else { |
62 |
$all_koha_news = GetNewsToDisplay($news_lang, $homebranch); |
63 |
$koha_news_count = scalar @$all_koha_news; |
64 |
} |
56 |
|
65 |
|
57 |
my $quote = GetDailyQuote(); # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha |
66 |
my $quote = GetDailyQuote(); # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha |
58 |
|
67 |
|
59 |
$template->param( |
68 |
$template->param( |
60 |
koha_news => $all_koha_news, |
69 |
koha_news => $all_koha_news, |
61 |
koha_news_count => $koha_news_count, |
70 |
koha_news_count => $koha_news_count, |
|
|
71 |
news_type => $news_type, |
62 |
display_daily_quote => C4::Context->preference('QuoteOfTheDay'), |
72 |
display_daily_quote => C4::Context->preference('QuoteOfTheDay'), |
63 |
daily_quote => $quote, |
73 |
daily_quote => $quote, |
64 |
); |
74 |
); |
65 |
- |
|
|