[Koha-patches] [PATCH] change in yuipath management 1/2 Noupdatedatabase.pl

Henri-Damien LAURENT henridamien at koha-fr.org
Mon May 12 22:27:49 CEST 2008


now yuipath is added in C4::Output and uses themelang
In my opinion, all the general variables that are used in output should get in C4::Output (since there is theme lang computed.)
rather than in C4::Auth
---
 C4/Auth.pm   |    2 --
 C4/Output.pm |    7 ++++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/C4/Auth.pm b/C4/Auth.pm
index 279c471..0e97604 100755
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -250,7 +250,6 @@ sub get_template_and_user {
             IntranetmainUserblock   => C4::Context->preference("IntranetmainUserblock"),
             IndependantBranches     => C4::Context->preference("IndependantBranches"),
 			CircAutocompl => C4::Context->preference("CircAutocompl"),
-			yuipath => C4::Context->preference("yuipath"),
 			FRBRizeEditions => C4::Context->preference("FRBRizeEditions"),
 			AmazonSimilarItems => C4::Context->preference("AmazonSimilarItems"),
 			'item-level_itypes' => C4::Context->preference('item-level_itypes'),
@@ -315,7 +314,6 @@ sub get_template_and_user {
             OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"),
             'item-level_itypes' => C4::Context->preference('item-level_itypes'),
             'Version' => C4::Context->preference('Version'),
-			yuipath => C4::Context->preference("yuipath"),
             singleBranchMode => C4::Context->preference("singleBranchMode"),
             XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"),
             XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"),
diff --git a/C4/Output.pm b/C4/Output.pm
index 4ad79da..fc1a840 100644
--- a/C4/Output.pm
+++ b/C4/Output.pm
@@ -90,10 +90,11 @@ sub gettemplate {
         case_sensitive    => 1,
         path              => ["$htdocs/$theme/$lang/$path"]
     );
-
+    my $themelang=( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' )
+          . "/$theme/$lang";
     $template->param(
-        themelang => ( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' )
-          . "/$theme/$lang",
+        themelang => $themelang,
+        yuipath => (C4::Context->preference("yuipath") eq "local"?"$themelang/lib/yui":C4::Context->preference("yuipath")),
         interface => ( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' ),
         theme => $theme,
         opacstylesheet      => $opacstylesheet,
-- 
1.5.4.3




More information about the Koha-patches mailing list