aboutsummaryrefslogtreecommitdiff
path: root/cgi-bin
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-02-15 12:31:40 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-02-15 12:31:40 +0000
commitbe9343816946d88f80e558b27730c832a78be321 (patch)
treea5853e841eea536f44ba56e41c343a6894183c86 /cgi-bin
parent68af947661f1db1e51d3a14ccd018f4bf75ec076 (diff)
downloadellinika-be9343816946d88f80e558b27730c832a78be321.tar.gz
ellinika-be9343816946d88f80e558b27730c832a78be321.tar.bz2
(dict-html): Rewritten using (expand-template)
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@313 941c8c0f-9102-463b-b60b-cd22ce0e6858
Diffstat (limited to 'cgi-bin')
-rw-r--r--cgi-bin/dict.cgi.in40
1 files changed, 22 insertions, 18 deletions
diff --git a/cgi-bin/dict.cgi.in b/cgi-bin/dict.cgi.in
index cbe2646..04eccd1 100644
--- a/cgi-bin/dict.cgi.in
+++ b/cgi-bin/dict.cgi.in
@@ -515,24 +515,28 @@
;;;
(define (dict-html)
- (do ((line (read-line) (read-line)))
- ((eof-object? line) #f)
- (cond
- ((string=? line "@@dict@@")
- (main-form)
- (dict-search))
- ((string=? line "@@stat_updated@@")
- (display (stat #:updated)))
- ((string=? line "@@stat_count@@")
- (display
- (let ((s (stat #:count)))
- (if (string=? s "<>")
- s
- (let ((n (string->number s)))
- (string-append s " " (ngettext "λέξη" "λέξεις" n)))))))
- (else
- (display line)
- (newline)))))
+ (let ((explist (list
+ (cons "@@dict@@"
+ (lambda ()
+ (main-form)
+ (dict-search)))
+ (cons "@@stat_updated@@"
+ (lambda ()
+ (display (stat #:updated))))
+ (cons "@@stat_count@@"
+ (lambda ()
+ (display
+ (let ((s (stat #:count)))
+ (if (string=? s "<>")
+ s
+ (let ((n (string->number s)))
+ (string-append s " "
+ (ngettext "λέξη" "λέξεις"
+ n)))))))))))
+ (do ((line (read-line) (read-line)))
+ ((eof-object? line) #f)
+ (expand-template explist line)
+ (newline))))
;;; Main
(display "Content-type: text/html; charset=utf-8\r\n\r\n")

Return to:

Send suggestions and report system problems to the System administrator.