Commiting a sample change to the default template to allow users to pick
authorrangi <rangi>
Sun, 15 Aug 2004 01:50:24 +0000 (01:50 +0000)
committerrangi <rangi>
Sun, 15 Aug 2004 01:50:24 +0000 (01:50 +0000)
their language.
Just a sample template builders can look at this and make changes to their
templates

C4/Search.pm
koha-tmpl/opac-tmpl/default/en/includes/opac-top.inc
opac/opac-search.pl

index 03c150d..0d11b0e 100755 (executable)
@@ -2570,8 +2570,8 @@ sub breedingsearch {
 
 =item getalllanguages
 
-  (@languages) = &getalllanguages();
-  (@languages) = &getalllanguages($theme);
+  (@languages) = &getalllanguages($type);
+  (@languages) = &getalllanguages($type,$theme);
 
 Returns an array of all available languages.
 
index 26003c8..aa6d5f8 100644 (file)
     <p align="left"><a href="/cgi-bin/koha/opac-user.pl">Log In</a> to Koha</p>
 <!-- /TMPL_IF -->
 
+<p>
+<form action="/cgi-bin/koha/changelanguage.pl" method="post">
+<select name="language">
+<TMPL_LOOP NAME="languages">
+<option value="<TMPL_VAR NAME="language">"><TMPL_VAR NAME="language"></option>
+</TMPL_LOOP>
+</select>
+<br>
+<input type=submit value="Change Language">
+</form>
index e7c3729..d57a2b3 100755 (executable)
@@ -11,6 +11,7 @@ use HTML::Template;
 use C4::SearchMarc;
 use C4::Acquisition;
 use C4::Biblio;
+use C4::Search;
 
 my $classlist='';
 
@@ -174,10 +175,20 @@ if ($op eq "do_search") {
                                -size     => 1,
                                -multiple => 0 );
        $sth->finish;
-       
+        my @options;
+    my $counter=0;
+        foreach my $language (getalllanguages()) {
+                            next if $language eq 'images';
+                            my $selected='0';
+#                            next if $currently_selected_languages->{$language};
+                            push @options, { language => $language, counter => $counter };
+                            $counter++;
+                    }
+    
        $template->param(classlist => $classlist,
                                        CGIitemtype => $CGIitemtype,
                                        CGIbranch => $CGIbranch,
+                                       languages => \@options,
        );
 }