Add a basic, ugly language picker to the SlimPAC (another part of #1)
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 6 Oct 2008 20:49:31 +0000 (20:49 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 6 Oct 2008 20:49:31 +0000 (20:49 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10765 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/Makefile.am
Open-ILS/src/extras/locale_html_options.pl [new file with mode: 0755]
Open-ILS/web/opac/extras/slimpac/advanced.html
Open-ILS/web/opac/extras/slimpac/language.html [new file with mode: 0644]
Open-ILS/web/opac/extras/slimpac/start.html
Open-ILS/web/opac/locale/en-US/opac.dtd

index 5405942..710dbab 100644 (file)
@@ -41,6 +41,7 @@ reportsdir = $(DESTDIR)$(WEBDIR)/reports/
 # Collect files to be used by multiple targets
 
 autojsbinscripts = @srcdir@/extras/fieldmapper.pl \
+        @srcdir@/extras/locale_html_options.pl \
         @srcdir@/extras/org_tree_js.pl \
         @srcdir@/extras/org_lasso_js.pl \
         @srcdir@/extras/org_tree_html_options.pl \
@@ -240,6 +241,7 @@ webcore-install:
        ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/advanced.xml
        ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/myopac.xml
        ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/cnbrowse.xml
+       rm  $(DESTDIR)$(WEBDIR)/reports/fm_IDL.xml
        cp $(DESTDIR)@sysconfdir@/fm_IDL.xml $(DESTDIR)$(WEBDIR)/reports/
 
 
diff --git a/Open-ILS/src/extras/locale_html_options.pl b/Open-ILS/src/extras/locale_html_options.pl
new file mode 100755 (executable)
index 0000000..705ee3e
--- /dev/null
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+# Turns supported locales into a static HTML option list
+
+use OpenSRF::AppSession;
+use OpenSRF::System;
+use OpenILS::Utils::Fieldmapper;
+use OpenSRF::Utils::SettingsClient;
+use OpenILS::Application::AppUtils;
+
+die "usage: perl locale_html_options.pl <bootstrap_config> <output_file>" unless $ARGV[1];
+OpenSRF::System->bootstrap_client(config_file => $ARGV[0]);
+
+open FILE, ">$ARGV[1]";
+
+Fieldmapper->import(IDL => OpenSRF::Utils::SettingsClient->new->config_value("IDL"));
+
+my $ses = OpenSRF::AppSession->create("open-ils.cstore");
+my $locales = $ses->request("open-ils.cstore.direct.config.i18n_locale.search.atomic", {"code" => {"!=" => undef}}, {"order_by" => {"i18n_l" => "name"}})->gather();
+
+print_option($locales);
+
+$ses->disconnect();
+close FILE;
+
+
+sub print_option {
+       my $locales = shift;
+       my $count = 0;
+       my $class;
+       foreach my $locale (@$locales) {
+               my $code = OpenILS::Application::AppUtils->entityize($locale->code);
+               my $name = OpenILS::Application::AppUtils->entityize($locale->name);
+               if ($count % 2) {
+                       $class = 'greenrow';
+               } else {
+                       $class = 'bluerow';
+               }
+               print FILE "<p class='$class'><a href='/opac/$code/extras/slimpac/start.html'>$name</a></p>\n";
+               $count++;
+       }
+}
+
index 178fad2..6843361 100644 (file)
                                <span> | </span>
 
                                <span class='footer_link'>
+                                       <a class='classic_link' href='language.html'>&slimpac.language.select;</a>
+                               </span> 
+
+                               <span> | </span>
+
+                               <span class='footer_link'>
                                        <a target='_blank' class='classic_link' href='&footer.find.url;'>&footer.find.library;</a>
                                </span> 
 
diff --git a/Open-ILS/web/opac/extras/slimpac/language.html b/Open-ILS/web/opac/extras/slimpac/language.html
new file mode 100644 (file)
index 0000000..def9a86
--- /dev/null
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE html PUBLIC
+        "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
+        <!--#include virtual="/opac/locale/${locale}/opac.dtd"-->
+]>
+
+<html>
+       <head>
+               <title>&slimpac.language.select;</title>
+               <style type="text/css">
+                       .title {
+                               text-align: center;
+                               border: 3px solid #A7EA9D;
+                               padding-bottom: 0px;
+                               margin-bottom: 0px;
+                               padding-right: 5em;
+                               padding-left: 5em;
+                               margin-right: 5em;
+                               margin-left: 5em;
+                               border-collapse: collapse;
+                               border-collapse: collapse;
+                       }
+                       .switcher {
+                               padding-top: 0px;
+                               margin-top: 0px;
+                               text-align: center;
+                               padding-right: 5em;
+                               padding-left: 5em;
+                               margin-right: 5em;
+                               margin-left: 5em;
+                       }
+
+                       .greenrow {
+                               border: 1px solid #D0D0D0;
+                               background: #A7EA9D;
+                               margin-top: .5em;
+                               margin-bottom: .5em;
+                       }
+
+                       .bluerow {
+                               border: 1px solid #D0D0D0;
+                               background: #E0F6E0;
+                               margin-top: .5em;
+                               margin-bottom: .5em;
+                       }
+
+                       .bluerow a {
+                               background: white;
+                       }
+
+                       .greenrow a {
+                               background: white;
+                       }
+
+                       .rowpad {
+                               height: 20px;
+                       }
+
+                       .footer {
+                               width: 100%;
+                               text-align: center;
+                               vertical-align: bottom;
+                               margin: auto;
+                               margin-top: 20px;
+                       }
+
+                       .footer_links {
+                               width: 60%;
+                               text-align: center;
+                               padding: 10px;
+                               font-size: 8pt;
+                               margin: auto;
+                       }
+
+                       .footer_link {
+                               margin-left: 10px; 
+                               margin-right: 10px;
+                       }
+
+                       .copyright {
+                               margin-top: 4px;
+                               font-size: 7pt;
+                       }
+
+               </style>
+       </head>
+       <body>
+
+               <h1 class="title">&slimpac.language.select;</h1>
+               <div class="switcher">
+               <!--#include virtual="locales.inc"-->
+               </div>
+
+               <div class="footer">
+                       <div class="footer_links">
+
+                               <span class='footer_link'>
+                                       <a class='classic_link' href='/'>&slimpac.start.dynamic;</a>
+                               </span> 
+
+                               <span> | </span>
+
+                               <span class='footer_link'>
+                                       <a class='classic_link' href='advanced.html'>&opac.navigate.advanced;</a>
+                               </span> 
+
+                               <span> | </span>
+
+                               <span class='footer_link'>
+                                       <a target='_blank' class='classic_link' href='&footer.find.url;'>&footer.find.library;</a>
+                               </span> 
+
+                               <span> | </span>
+                               
+                               <span class='footer_link'>
+                                       <a target='_blank' class='classic_link' href='&footer.help.url;'>&footer.help;</a>
+                               </span>
+
+                               <span> | </span>
+
+                               <span class='footer_link'>
+                                       <a target='_blank' class='classic_link' href='&footer.library.url;'>&footer.library.about;</a>
+                               </span>
+
+                               <span> | </span>
+
+                               <span class='footer_link'>
+                                       <a target='' class='classic_link' id='eg_gal_link' href='&footer.union.url;'>&footer.union;</a>
+                               </span>
+                               <br/>
+                               <div class="copyright">
+                                       <span>&footer.copyright;</span>
+                               </div>
+                       </div>
+               </div>
+
+       </body>
+</html>
index 9cc06f5..2e6abc6 100644 (file)
                                <span> | </span>
 
                                <span class='footer_link'>
+                                       <a class='classic_link' href='language.html'>&slimpac.language.select;</a>
+                               </span> 
+
+                               <span> | </span>
+
+                               <span class='footer_link'>
                                        <a target='_blank' class='classic_link' href='&footer.find.url;'>&footer.find.library;</a>
                                </span> 
 
index 40f486a..5335f27 100644 (file)
@@ -628,6 +628,8 @@ Ensure Caps-Lock is off and try again or contact your local library.">
 <!--   ================================================================= 
        Slimpac Simple Search
        ================================================================= -->
+<!ENTITY slimpac.language.select "Select language">
+
 <!ENTITY slimpac.start.title "Simple Search">
 <!ENTITY slimpac.start.nowSearching "Now searching: ">
 <!ENTITY slimpac.start.dynamic "Dynamic Catalog">
@@ -643,8 +645,6 @@ Ensure Caps-Lock is off and try again or contact your local library.">
 <!ENTITY vendor.name "Amazon">
 <!ENTITY vendor.base_link "http://amazon.com/dp/">
 
-
-
 <!--   ================================================================= 
        Selfcheck
        ================================================================= -->