koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/C4 Output.pm,1.25,1.26


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/C4 Output.pm,1.25,1.26
Date: Thu, 10 Oct 2002 20:14:05 -0700

Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv29195

Modified Files:
        Output.pm 
Log Message:
Use C4::Context->preference instead of &systemprefs or explicit SQL
calls to get an entry from the systempreferences table.


Index: Output.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Output.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** Output.pm   10 Oct 2002 05:32:20 -0000      1.25
--- Output.pm   11 Oct 2002 03:14:03 -0000      1.26
***************
*** 126,147 ****
    my ($htdocs, $tmpl) = @_;
  
- # language preferences....
    my $dbh = C4::Context->dbh;
!   my $sth=$dbh->prepare("SELECT value FROM systempreferences WHERE 
variable='opaclanguages'");
!   $sth->execute;
!   my ($lang) = $sth->fetchrow;
!   $sth->finish;
!   my @languages = split " ", $lang;
! 
! # theme preferences....
!   # FIXME - There's already a $sth in this scope
!   my $sth=$dbh->prepare("SELECT value FROM systempreferences WHERE 
variable='opacthemes'");
!   $sth->execute;
!   my ($theme) = $sth->fetchrow;
!   $sth->finish;
!   my @themes = split " ", $theme;
  
    my ($theme, $lang);
-   # FIXME - There are already $theme and $lang in this scope
  # searches through the themes and languages. First template it find it 
returns.
  # Priority is for getting the theme right.
--- 126,136 ----
    my ($htdocs, $tmpl) = @_;
  
    my $dbh = C4::Context->dbh;
!   my @languages = split " ", C4::Context->preference("opaclanguages");
!                       # language preference
!   my @themes = split " ", C4::Context->preference("opacthemes");
!                       # theme preferences
  
    my ($theme, $lang);
  # searches through the themes and languages. First template it find it 
returns.
  # Priority is for getting the theme right.
***************
*** 248,254 ****
  
    my %returns;
!   my %prefs= systemprefs();
!   my $theme= $prefs{'theme'} || 'default';
!   if ($themeor and ($prefs{'allowthemeoverride'} =~ qr/$themeor/i )) {$theme 
= $themeor;}
    my @languageorder = getlanguageorder();
    my $language = $languageor || shift(@languageorder);
--- 237,246 ----
  
    my %returns;
!   my $theme = C4::Context->preference("theme") || "default";
!   if ($themeor and
!       C4::Context->preference("allowthemeoverride") =~ qr/$themeor/i)
!   {
!     $theme = $themeor;
!   }
    my @languageorder = getlanguageorder();
    my $language = $languageor || shift(@languageorder);
***************
*** 310,319 ****
  sub getlanguageorder () {
    my @languageorder;
-   my %prefs = systemprefs();
  
    if ($ENV{'HTTP_ACCEPT_LANGUAGE'}) {
      @languageorder = split (/\s*,\s*/ ,lc($ENV{'HTTP_ACCEPT_LANGUAGE'}));
!   } elsif ($prefs{'languageorder'}) {
!     @languageorder = split (/\s*,\s*/ ,lc($prefs{'languageorder'}));
    } else { # here should be another elsif checking for apache's languageorder
      @languageorder = ('en');
--- 302,310 ----
  sub getlanguageorder () {
    my @languageorder;
  
    if ($ENV{'HTTP_ACCEPT_LANGUAGE'}) {
      @languageorder = split (/\s*,\s*/ ,lc($ENV{'HTTP_ACCEPT_LANGUAGE'}));
!   } elsif (my $order = C4::Context->preference("languageorder")) {
!     @languageorder = split (/\s*,\s*/ ,lc($order));
    } else { # here should be another elsif checking for apache's languageorder
      @languageorder = ('en');




reply via email to

[Prev in Thread] Current Thread [Next in Thread]