[Koha-cvs] koha/C4 Koha.pm [dev_week]

Joshua Ferraro jmf at kados.org
Fri Sep 8 00:01:42 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Joshua Ferraro <kados>	06/09/07 22:01:42

Modified files:
	C4             : Koha.pm 

Log message:
	adding displayLanguages routine

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.22.2.4.2.1&r2=1.22.2.4.2.2

Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.22.2.4.2.1
retrieving revision 1.22.2.4.2.2
diff -u -b -r1.22.2.4.2.1 -r1.22.2.4.2.2
--- Koha.pm	10 Aug 2006 02:10:21 -0000	1.22.2.4.2.1
+++ Koha.pm	7 Sep 2006 22:01:42 -0000	1.22.2.4.2.2
@@ -18,9 +18,10 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use warnings; no warnings 'uninitialized';
 require Exporter;
 use C4::Context;
-
+use C4::Output;
 use vars qw($VERSION @ISA @EXPORT);
 
 $VERSION = 0.01;
@@ -62,6 +63,7 @@
 			&getauthtypes &getauthtype
 			&getallthemes &getalllanguages
 			&getallbranches 
+			&displayLanguages
 			$DEBUG);
 
 use vars qw();
@@ -653,6 +655,29 @@
 }
 
 
+sub displayLanguages {
+	my ($cgi) = @_;
+    my @languages_options;
+    my $languages_hash = {de => 'Deutsch', en => 'English', es => 'Espa&ntilde;ol', fr => 'Fran&ccedil;ais', pl => 'Polski', "zh-TW" => '&#20013;&#25991;', it => 'Italiano',};
+    my $counter=0;
+    foreach my $language (getalllanguages()) {
+        next if $language eq 'images';
+        next if $language eq 'itemtypeimg';
+        next if $language eq 'CVS';
+        next if $language=~ /png$/;
+        next if $language=~ /css$/;
+        my $label = $languages_hash->{$language};
+        my $selected='0';
+		my $htdocs = C4::Context->config('opacdocs');
+		my ($current_theme,$current_language) = themelanguage("opachtdocs", "default", "opac", $cgi);
+		my $current=1 if $current_language eq $language;
+#                            next if $currently_selected_languages->{$language};
+        push @languages_options, { label => $label, language => $language, counter => $counter, current => $current};
+        $counter++;
+    }
+    return @languages_options;
+}
+
 1;
 __END__
 





More information about the Koha-cvs mailing list