aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-03-22 21:28:16 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-03-22 21:28:16 +0000
commit62d31cbfa9f2300da35bbf01607606d8018fa113 (patch)
treef11cc13eb9147f4a65d7be4774eb7a0e2bb44bfc
parent866caa6502f6d7af8aa767805f78b06b9af78185 (diff)
downloadellinika-62d31cbfa9f2300da35bbf01607606d8018fa113.tar.gz
ellinika-62d31cbfa9f2300da35bbf01607606d8018fa113.tar.bz2
Downcase all html tags.
(dict-html): Handle @@args@@ keyword git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@384 941c8c0f-9102-463b-b60b-cd22ce0e6858
-rw-r--r--cgi-bin/dict.cgi.in142
1 files changed, 78 insertions, 64 deletions
diff --git a/cgi-bin/dict.cgi.in b/cgi-bin/dict.cgi.in
index 361bcd1..202c379 100644
--- a/cgi-bin/dict.cgi.in
+++ b/cgi-bin/dict.cgi.in
@@ -164,33 +164,33 @@
(display "<FORM ACTION=\"")
(display (make-cgi-name dict-cgi-path))
(display "\" METHOD=POST>
-<TABLE BORDER=0>
-<TR>
- <TD>")
+<table class=\"noframe\">
+<tr>
+ <td>")
(display (_"Εισάγετε τη λέξη"))
(display "
- </TD>
- <TD>
- <INPUT size=36 NAME=\"key\" TABINDEX=\"1\"")
+ </td>
+ <td>
+ <input size=\"36\" name=\"key\" tabindex=\"1\"")
(let ((value (cgi:value "key")))
(if value
(begin
- (display "VALUE=\"")
+ (display "value=\"")
(display (protect value))
(display "\""))))
(display ">
- </TD>
-</TR>")
+ </td>
+</tr>")
- (display "<TR><TD COLSPAN=\"3\" ALIGN=\"center\">")
+ (display "<tr><td colspan=\"3\" align=\"center\">")
(display (_"Συμπληρωματικοί όροι"))
- (display "</TD></TR>")
+ (display "</td></tr>")
(display "
-<TR>
- <TD>")
+<tr>
+ <td>")
(display (_"Επιλέξτε το μέρος του λόγου"))
- (display "</TD><TD>")
+ (display "</td><td>")
(let ((selected-choice (or (let ((s (cgi:value "POS")))
(if s
@@ -199,12 +199,12 @@
0))
(index 0))
- (display "<SELECT NAME=\"POS\" TABINDEX=\"2\">")
+ (display "<select name=\"POS\" tabindex=\"2\">")
(for-each
(lambda (x)
(let ((name (car x)))
- (display "<OPTION VALUE=")
+ (display "<option value=")
(display index)
(if (= index selected-choice)
(display " selected"))
@@ -212,18 +212,18 @@
(display name)
(set! index (1+ index))))
part-of-speech)
- (display "</SELECT>"))
+ (display "</select>"))
- (display "</TD><TD>")
+ (display "</td><td>")
(join-widget "pos" "3")
- (display "</TD></TR>")
+ (display "</td></tr>")
(let ((tabindex 4))
(for-each
(lambda (category)
- (display "<TR><TD>")
+ (display "<tr><td>")
(display (list-ref category 1))
- (display "</TD><TD>")
+ (display "</td><td>")
(let ((selected-choice (or (let ((s (cgi:value (list-ref category 0))))
(if s
(string->number s)
@@ -231,45 +231,45 @@
0)))
(display (string-append
- "<SELECT NAME=\""
+ "<select name=\""
(list-ref category 0)
- "\" TABINDEX=\""
+ "\" tabindex=\""
(number->string tabindex)
"\">"))
(set! tabindex (1+ tabindex))
- (display "<OPTION VALUE=0>---")
+ (display "<option value=0>---")
(for-each
(lambda (x)
(let ((id (car x))
(name (car (cdr x))))
- (display "<OPTION VALUE=")
+ (display "<option value=")
(display id)
(if (eq? (string->number id) selected-choice)
(display " selected"))
(display ">")
(display name)
- (display "</OPTION>")))
+ (display "</option>")))
(list-ref category 3))
- (display "</SELECT>")
- (display "</TD><TD>")
+ (display "</select>")
+ (display "</td><td>")
(join-widget (list-ref category 0) (number->string tabindex))
- (display "</TD></TR>")
+ (display "</td></tr>")
(set! tabindex (1+ tabindex))))
(get-topic-list))
(display "
-<TR>
- <TD colspan=\"3\" align=center>
- <INPUT TYPE=\"submit\" NAME=\"search\" VALUE=\"")
+<tr>
+ <td colspan=\"3\" align=\"center\">
+ <input type=\"submit\" name=\"search\" value=\"")
(display (_"Αναζήτηση"))
- (display "\" TABINDEX=\"")
+ (display "\" tabindex=\"")
(display tabindex)
(display "\">
- </TD>
-</TR>
-</TABLE>
-</FORM>
-<P>")))
+ </td>
+</tr>
+</table>
+</form>
+<p>")))
;;
(define (replace-tilde word sentence)
@@ -291,17 +291,17 @@
;;
(define (display-results rlist)
(let ((x (car rlist)))
- (display "<TABLE BORDER=0>")
- (display "<TR><TD>")
+ (display "<table class=\"noframe\">")
+ (display "<tr><td>")
(display (car x))
- (display "</TD>")
+ (display "</td>")
(cond
((list-ref x 3)
- (display "<TD>")
+ (display "<td>")
(let ((href (assoc (list-ref x 2) word-forms-reference)))
(cond
(href
- (display "<A HREF=\"")
+ (display "<a href=\"")
(cond
(ref-loc
(display ref-loc)
@@ -312,30 +312,30 @@
(display (dict:encode-string (car x)))
(display "\">")
(display (list-ref x 3))
- (display "</A>"))
+ (display "</a>"))
(else
(display (list-ref x 3)))))
- (display "</TD>")))
- (display "<TD>")
+ (display "</td>")))
+ (display "<td>")
(display (list-ref x 2))
- (display "</TD></TR>"))
+ (display "</td></tr>"))
(for-each
(lambda (x)
- (display "<TR><TD>")
+ (display "<tr><td>")
(display (1+ (string->number (list-ref x 4))))
- (display "</TD><TD>")
+ (display "</td><td>")
(display (replace-tilde (car x) (list-ref x 5)))
- (display ";</TD></TR>"))
+ (display ";</td></tr>"))
rlist)
- (display "</TABLE>")
+ (display "</table>")
(newline))
(define (display-cross-reference word)
- (display "<A HREF=\"")
+ (display "<a href=\"")
(display (make-cgi-name dict-cgi-path "IDENT" (dict:encode-string word)))
(display "\">")
(display word)
- (display "</A>"))
+ (display "</a>"))
(define (display-xref rlist text)
(display text)
@@ -367,9 +367,9 @@
(define (search-failure key)
- (display "<H2>")
+ (display "<h2>")
(format #t (_"Συγγνώμη, η λέξη \"~A\" δεν βρέθηκε στο λέξικο.") key)
- (display "</H2>"))
+ (display "</h2>"))
(define (my-sql-query conn query)
(catch #t
@@ -457,19 +457,19 @@
((null? result)
(search-failure key))
(else
- (display "<TABLE WIDTH=\"100%\">")
+ (display "<table width=\"100%\" class=\"noframe\">")
(let* ((result-length (length result))
(lim (1+ (inexact->exact (/ result-length match-list-columns)))))
(do ((i 0 (1+ i)))
((= i lim) #f)
- (display "<TR>")
+ (display "<tr>")
(do ((j i (+ j lim)))
((>= j result-length) #f)
- (display "<TD>")
+ (display "<td>")
(display-cross-reference (car (list-ref result j)))
- (display "</TD>"))
- (display "</TR>")))
- (display "</TABLE>"))))))
+ (display "</td>"))
+ (display "</tr>")))
+ (display "</table>"))))))
(define (dict-search)
@@ -496,7 +496,7 @@
(not (string-null? keyval))
(null? theme)
(= (string->number pos) 0))
- (display "<HR>")
+ (display "<hr>")
(let* ((key (ellinika:translate-input keyval))
(result (my-sql-query
conn
@@ -525,7 +525,7 @@
(display-xref ant
(if (= (length ant) 1)
(_"Αντώνυμο: ") (_"Αντώνυμα: ")))))
- (display "<P>")
+ (display "<p>")
(let ((x (my-sql-query
conn
(string-append
@@ -536,7 +536,7 @@
(display-xref x (_"Βλέπετε επίσης ")))))
(sort-result result))))))
((or (not (null? theme)) (> (string->number pos) 0))
- (display "<HR>")
+ (display "<hr>")
(fuzzy-search conn
(ellinika:translate-input (or keyval "")) theme pos)))))))
@@ -570,6 +570,20 @@
(define (dict-html)
(let ((explist (list
+ (cons "@@args@@"
+ (lambda ()
+ (for-each
+ (lambda (name)
+ (cond
+ ((string=? name "LANG"))
+ (else
+ (let ((v (cgi:value name)))
+ (cond ((and v (not (string-null? v)))
+ (display "&")
+ (display name)
+ (display "=")
+ (display v)))))))
+ (cgi:names))))
(cons "@@dict@@"
(lambda ()
(main-form)

Return to:

Send suggestions and report system problems to the System administrator.