8 use C4::Auth; # get_template_and_user
9 use C4::Interface::CGI::Output;
15 my $kohaVersion = C4::Context->config("kohaversion");
16 my $dbh = C4::Context->dbh;
17 my $query="Select itemtype,description from itemtypes order by description";
18 my $sth=$dbh->prepare($query);
22 while (my ($value,$lib) = $sth->fetchrow_array) {
23 my %row =( value => $value,
26 push @itemtypeloop, \%row;
33 my $branches = getallbranches();
35 foreach my $thisbranch (keys %$branches) {
36 my $selected = 1 if (C4::Context->userenv && ($thisbranch eq C4::Context->userenv->{branch}));
37 my %row =(value => $thisbranch,
38 selected => $selected,
39 branchname => $branches->{$thisbranch}->{'branchname'},
41 push @branchloop, \%row;
44 my ($template, $borrowernumber, $cookie)
45 = get_template_and_user({template_name => "opac-main.tmpl",
49 flagsrequired => {borrow => 1},
51 my $borrower = getmember('',$borrowernumber);
54 foreach my $language (getalllanguages()) {
55 next if $language eq 'images';
56 next if $language eq 'CVS';
57 next if $language=~ /png$/;
58 next if $language=~ /css$/;
60 # next if $currently_selected_languages->{$language};
61 push @options, { language => $language, counter => $counter };
64 my $languages_count = @options;
66 if($languages_count > 1){
67 $template->param(languages => \@options);
69 $template->param(CGIitemtype => $CGIitemtype,
70 suggestion => C4::Context->preference("suggestion"),
71 virtualshelves => C4::Context->preference("virtualshelves"),
72 textmessaging => $borrower->{textmessaging},
73 opaclargeimage => C4::Context->preference("opaclargeimage"),
74 LibraryName => C4::Context->preference("LibraryName"),
75 OpacNav => C4::Context->preference("OpacNav"),
76 opaccredits => C4::Context->preference("opaccredits"),
77 opacreadinghistory => C4::Context->preference("opacreadinghistory"),
78 opacsmallimage => C4::Context->preference("opacsmallimage"),
79 opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
80 opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"),
81 opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
84 $template->param('Disable_Dictionary'=>C4::Context->preference("Disable_Dictionary")) if (C4::Context->preference("Disable_Dictionary"));
86 output_html_with_http_headers $input, $cookie, $template->output;