aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgi-bin/conj.scm49
-rw-r--r--src/cgi-bin/dict.scm428
-rw-r--r--src/cgi-bin/nea.scm422
-rw-r--r--src/ellinika/cgi.scm425
-rw-r--r--src/ellinika/i18n.scm6
5 files changed, 55 insertions, 35 deletions
diff --git a/src/cgi-bin/conj.scm4 b/src/cgi-bin/conj.scm4
index 83fb846..6a49c62 100644
--- a/src/cgi-bin/conj.scm4
+++ b/src/cgi-bin/conj.scm4
@@ -1,8 +1,8 @@
1;;;; Greek Dictionary Web Engine 1;;;; Greek Dictionary Web Engine
2;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 Sergey Poznyakoff 2;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2015 Sergey Poznyakoff
3;;;; 3;;;;
4;;;; This program is free software; you can redistribute it and/or modify 4;;;; This program is free software; you can redistribute it and/or modify
5;;;; it under the terms of the GNU General Public License as published by 5;;;; it under the terms of the GNU General Public License as published by
6;;;; the Free Software Foundation; either version 3 of the License, or 6;;;; the Free Software Foundation; either version 3 of the License, or
7;;;; (at your option) any later version. 7;;;; (at your option) any later version.
8;;;; 8;;;;
@@ -15,12 +15,13 @@
15;;;; along with this program. If not, see <http://www.gnu.org/licenses/>. 15;;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
16;;;; 16;;;;
17 17
18;;; Tailor this statement to your needs if necessary. 18;;; Tailor this statement to your needs if necessary.
19(set! %load-path (cons "GUILE_SITE" %load-path)) 19(set! %load-path (cons "GUILE_SITE" %load-path))
20 20
21(setlocale LC_ALL "")
21(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user)) 22(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user))
22 (srfi srfi-1) 23 (srfi srfi-1)
23 (ice-9 rdelim) 24 (ice-9 rdelim)
24 (ice-9 optargs) 25 (ice-9 optargs)
25 (xmltools dict) 26 (xmltools dict)
26 (ellinika config) 27 (ellinika config)
@@ -58,13 +59,13 @@ ifelse(IFACE,[CGI],(cgi:init))
58 <td>") 59 <td>")
59 (display (_"Εισάγετε το ρήμα")) 60 (display (_"Εισάγετε το ρήμα"))
60 (display " 61 (display "
61 </td> 62 </td>
62 <td> 63 <td>
63 <input size=\"36\" name=\"key\" tabindex=\"1\"") 64 <input size=\"36\" name=\"key\" tabindex=\"1\"")
64 (let ((value (cgi:value "key"))) 65 (let ((value (cgi:value-u8 "key")))
65 (if value 66 (if value
66 (begin 67 (begin
67 (display " value=\"") 68 (display " value=\"")
68 (display (cgi-protect-quotes value)) 69 (display (cgi-protect-quotes value))
69 (display "\"")))) 70 (display "\""))))
70 (display " /> 71 (display " />
@@ -347,13 +348,13 @@ ifelse(IFACE,[CGI],(cgi:init))
347 (display "</td>")) 348 (display "</td>"))
348 (display "</tr>"))) 349 (display "</tr>")))
349 (display "</table>"))))) 350 (display "</table>")))))
350 351
351 352
352(define (do-conj) 353(define (do-conj)
353 (let ((keyval (cgi:value "key"))) 354 (let ((keyval (cgi:value-u8 "key")))
354 (if (and keyval (not (string-null? keyval))) 355 (if (and keyval (not (string-null? keyval)))
355 (let ((input (ellinika:translate-input 356 (let ((input (ellinika:translate-input
356 (let ((keyval keyval)) 357 (let ((keyval keyval))
357 (cond 358 (cond
358 ((string-suffix? "o'" keyval) 359 ((string-suffix? "o'" keyval)
359 (string-set! keyval 360 (string-set! keyval
@@ -397,13 +398,13 @@ ifelse(IFACE,[CGI],(cgi:init))
397 (lambda () 398 (lambda ()
398 (for-each 399 (for-each
399 (lambda (name) 400 (lambda (name)
400 (cond 401 (cond
401 ((string=? name "lang")) 402 ((string=? name "lang"))
402 (else 403 (else
403 (let ((v (cgi:value name))) 404 (let ((v (cgi:value-u8 name)))
404 (cond ((and v (not (string-null? v))) 405 (cond ((and v (not (string-null? v)))
405 (display "&amp;") 406 (display "&amp;")
406 (display name) 407 (display name)
407 (display "=") 408 (display "=")
408 (display v))))))) 409 (display v)))))))
409 (cgi:names)))) 410 (cgi:names))))
diff --git a/src/cgi-bin/dict.scm4 b/src/cgi-bin/dict.scm4
index 77c1b3a..3b24367 100644
--- a/src/cgi-bin/dict.scm4
+++ b/src/cgi-bin/dict.scm4
@@ -1,8 +1,8 @@
1;;;; Greek Dictionary Web Engine 1;;;; Greek Dictionary Web Engine
2;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 Sergey Poznyakoff 2;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2015 Sergey Poznyakoff
3;;;; 3;;;;
4;;;; This program is free software; you can redistribute it and/or modify 4;;;; This program is free software; you can redistribute it and/or modify
5;;;; it under the terms of the GNU General Public License as published by 5;;;; it under the terms of the GNU General Public License as published by
6;;;; the Free Software Foundation; either version 3 of the License, or 6;;;; the Free Software Foundation; either version 3 of the License, or
7;;;; (at your option) any later version. 7;;;; (at your option) any later version.
8;;;; 8;;;;
@@ -15,16 +15,19 @@
15;;;; along with this program. If not, see <http://www.gnu.org/licenses/>. 15;;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
16;;;; 16;;;;
17 17
18;;; Tailor this statement to your needs if necessary. 18;;; Tailor this statement to your needs if necessary.
19(set! %load-path (cons "GUILE_SITE" %load-path)) 19(set! %load-path (cons "GUILE_SITE" %load-path))
20 20
21(setlocale LC_ALL "")
22
21(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user)) 23(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user))
22 (ice-9 rdelim) 24 (ice-9 rdelim)
23 (xmltools dict) 25 (xmltools dict)
24 (gamma sql) 26 (gamma sql)
27 (gamma syslog)
25 (ellinika elmorph) 28 (ellinika elmorph)
26 (ellinika sql) 29 (ellinika sql)
27 (ellinika i18n) 30 (ellinika i18n)
28 (ellinika xlat) 31 (ellinika xlat)
29 (ellinika cgi)) 32 (ellinika cgi))
30 33
@@ -76,13 +79,13 @@ ifelse(IFACE,[CGI],(cgi:init))
76 (if (not categories) 79 (if (not categories)
77 (set! categories (or (getcat) '()))) 80 (set! categories (or (getcat) '())))
78 categories))) 81 categories)))
79 82
80(define (join-widget widget-id tabindex) 83(define (join-widget widget-id tabindex)
81 (let* ((name (string-append "join" widget-id)) 84 (let* ((name (string-append "join" widget-id))
82 (selected-choice (or (let ((s (cgi:value name))) 85 (selected-choice (or (let ((s (cgi:value-u8 name)))
83 (if s 86 (if s
84 (string->number s) 87 (string->number s)
85 #f)) 88 #f))
86 0))) 89 0)))
87 (display (string-append "<select name=\"" 90 (display (string-append "<select name=\""
88 name 91 name
@@ -109,13 +112,13 @@ ifelse(IFACE,[CGI],(cgi:init))
109 <td>") 112 <td>")
110 (display (_"Εισάγετε τη λέξη")) 113 (display (_"Εισάγετε τη λέξη"))
111 (display " 114 (display "
112 </td> 115 </td>
113 <td> 116 <td>
114 <input size=\"36\" name=\"key\" tabindex=\"1\"") 117 <input size=\"36\" name=\"key\" tabindex=\"1\"")
115 (let ((value (cgi:value "key"))) 118 (let ((value (cgi:value-u8 "key")))
116 (if value 119 (if value
117 (begin 120 (begin
118 (display " value=\"") 121 (display " value=\"")
119 (display (cgi-protect-quotes value)) 122 (display (cgi-protect-quotes value))
120 (display "\"")))) 123 (display "\""))))
121 (display " /> 124 (display " />
@@ -129,13 +132,13 @@ ifelse(IFACE,[CGI],(cgi:init))
129 (display " 132 (display "
130<tr> 133<tr>
131 <td>") 134 <td>")
132 (display (_"Επιλέξτε το μέρος του λόγου")) 135 (display (_"Επιλέξτε το μέρος του λόγου"))
133 (display "</td><td>") 136 (display "</td><td>")
134 137
135 (let ((selected-choice (or (let ((s (cgi:value "pos"))) 138 (let ((selected-choice (or (let ((s (cgi:value-u8 "pos")))
136 (if s 139 (if s
137 (string->number s) 140 (string->number s)
138 #f)) 141 #f))
139 0)) 142 0))
140 (index 0)) 143 (index 0))
141 144
@@ -163,13 +166,13 @@ ifelse(IFACE,[CGI],(cgi:init))
163 (let ((tabindex 4)) 166 (let ((tabindex 4))
164 (for-each 167 (for-each
165 (lambda (category) 168 (lambda (category)
166 (display "<tr><td>") 169 (display "<tr><td>")
167 (display (list-ref category 1)) 170 (display (list-ref category 1))
168 (display "</td><td>") 171 (display "</td><td>")
169 (let ((selected-choice (or (let ((s (cgi:value (list-ref category 0)))) 172 (let ((selected-choice (or (let ((s (cgi:value-u8 (list-ref category 0))))
170 (if s 173 (if s
171 (string->number s) 174 (string->number s)
172 #f)) 175 #f))
173 0))) 176 0)))
174 177
175 (display (string-append 178 (display (string-append
@@ -350,13 +353,13 @@ ifelse(IFACE,[CGI],(cgi:init))
350 (cond 353 (cond
351 ((> (string->number pos) 0) 354 ((> (string->number pos) 0)
352 (let ((pos-entry 355 (let ((pos-entry
353 (list-ref part-of-speech (string->numbe