summaryrefslogtreecommitdiffabout
path: root/src/ellinika/cgi.scm4
authorSergey Poznyakoff <gray@gnu.org.ua>2011-06-15 07:05:10 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-06-15 07:24:46 (GMT)
commitbb9dd8a54a96307aad7bf976f1736d20c70d43e3 (patch) (side-by-side diff)
treedf632e2c76facc932c4c34978eba4b9ae4cb0354 /src/ellinika/cgi.scm4
parenta27881a1c5bd7d8f8f42cd6526adf80815acfe63 (diff)
downloadellinika-bb9dd8a54a96307aad7bf976f1736d20c70d43e3.tar.gz
ellinika-bb9dd8a54a96307aad7bf976f1736d20c70d43e3.tar.bz2
Implement web conjugator.
* src/cgi-bin/.gitignore: Update. * src/cgi-bin/Makefile.am: Build conj,cgi * src/cgi-bin/conj.scm4: New file. * src/cgi-bin/dict.scm4 (protect): Move to cgi.scm, function cgi-protect-quotes. All uses updated. * src/ellinika/cgi.scm4 (cgi-protect-quotes): New function. * src/ellinika/Makefile.am (guile_DATA): Add conjugator.scm * src/ellinika/conjugator.scm: Minor fixes. * src/ellinika/sql.scm (->string): Fix typo. * src/ellinika/tenses.scm (ellinika-conjugation-term-transtab): New var. (ellinika-conjugation-term): New function. * src/ellinika/test-conjugation.scm: Use ellinika-conjugation-term instead of (term). * xml/lingua.conf.in (install-conj): New macro. * xml/pl/ellinika.xml (GUILE): Call install-conj. * xml/pl/rhmata.xml: Define conjugator template page.
Diffstat (limited to 'src/ellinika/cgi.scm4') (more/less context) (ignore whitespace changes)
-rw-r--r--src/ellinika/cgi.scm415
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ellinika/cgi.scm4 b/src/ellinika/cgi.scm4
index c7fbdb6..8cbfeca 100644
--- a/src/ellinika/cgi.scm4
+++ b/src/ellinika/cgi.scm4
@@ -165,4 +165,19 @@ THUNK.
(if x
(set! target-language x))))
+;; Protect occurences of " in a string.
+;; Usual backslash escapes do not work in INPUT widgets, so I
+;; change all quotation marks to &#34;
+;; Possibly not the better solution, though...
+(define-public (cgi-protect-quotes string)
+ (list->string
+ (apply append
+ (map
+ (lambda (x)
+ (if (eq? x #\")
+ (list #\& #\# #\3 #\4 #\;)
+ (list x)))
+ (string->list string)))))
+
+
;;; End of cgi.scmi

Return to:

Send suggestions and report system problems to the System administrator.