diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-03-29 06:05:27 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-03-29 06:05:27 +0000 |
commit | 95772e05a2f8248159c4fc0a640fa6cdaeb476ba (patch) | |
tree | f02e9b393ab0d36c1eb0a4c73364738e141730cd /cgi-bin | |
parent | 8f563016cd7114f74d6895a4061382905a7a9276 (diff) | |
download | ellinika-95772e05a2f8248159c4fc0a640fa6cdaeb476ba.tar.gz ellinika-95772e05a2f8248159c4fc0a640fa6cdaeb476ba.tar.bz2 |
Lots of changes
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@65 941c8c0f-9102-463b-b60b-cd22ce0e6858
Diffstat (limited to 'cgi-bin')
-rw-r--r-- | cgi-bin/dict.cgi.in | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/cgi-bin/dict.cgi.in b/cgi-bin/dict.cgi.in index 510ceba..f0e2cfd 100644 --- a/cgi-bin/dict.cgi.in +++ b/cgi-bin/dict.cgi.in @@ -31,7 +31,8 @@ (define html-dir "=HTMLDIR=") (define sysconf-dir "=SYSCONFDIR=") (define locale-dir "=LOCALEDIR=") - +(define ref-loc #f) + (define dict-cgi-path "cgi-bin/dict.cgi") ;; Path to the cgi (relative ;; to the Base HREF) @@ -39,6 +40,8 @@ (define template-file-name "dict.html") (define target-language "el_GR") +(define word-forms-reference '()) + (define sql-iface "mysql") ;; SQL interface ("mysql" or "postgres") (define sql-host "localhost") ;; SQL server hostname or a path to the UNIX ;; socket @@ -57,14 +60,16 @@ (if (file-exists? rc-file) (load rc-file))) +(define (language-code lang) + (cond + ((string-index lang #\_) => + (lambda (len) + (substring lang 0 len))) + (else + lang))) + (define (template-file lang) - (let ((name (cond - ((string-index lang #\_) => - (lambda (len) - (substring lang 0 len))) - (else - lang)))) - (string-append html-dir "/" name "/" template-file-name))) + (string-append html-dir "/" (language-code lang) "/" template-file-name)) ;;; Load the language-specific defaults (cond @@ -536,7 +541,23 @@ (cond ((list-ref x 3) (display "<TD>") - (display (list-ref x 3)) + (let ((href (assoc (list-ref x 2) word-forms-reference))) + (cond + (href + (display "<A HREF=\"") + (cond + (ref-loc + (display ref-loc) + (display "/"))) + (display (language-code target-language)) + (display "/") + (display (cdr href)) + (display (encode-string (car x))) + (display "\">") + (display (list-ref x 3)) + (display "</A>")) + (else + (display (list-ref x 3))))) (display "</TD>"))) (display "<TD>") (display (list-ref x 2)) |