[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/C4 Koha.pm [dev_week]
From: |
Joshua Ferraro |
Subject: |
[Koha-cvs] koha/C4 Koha.pm [dev_week] |
Date: |
Thu, 07 Sep 2006 22:01:42 +0000 |
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ñol', fr => 'Français', pl => 'Polski', "zh-TW" =>
'中文', 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__
- [Koha-cvs] koha/C4 Koha.pm [dev_week],
Joshua Ferraro <=