1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
-
+
+
+
+
+
|
;; Copyright 2007-2008, Matthew Welland.
;; Copyright 2007-2011, Matthew Welland.
;;
;; This program is made available under the GNU GPL version 2.0 or
;; greater. See the accompanying file COPYING for details.
;;
;; This program is distributed WITHOUT ANY WARRANTY; without even the
;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;; PURPOSE.
;; stml is a list of html strings
(declare (unit stml))
(declare (uses misc-stml))
(require-extension regex)
;; extract various tokens from the parameter list
;; 'key val => put in the params list
;; strings => maintain order and add to the datalist <<== IMPORTANT
(define (s:extract inlst)
(if (null? inlst) inlst
(let loop ((data '())
(params '())
|
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
-
+
|
(define (s:form . args)
;; create a link for calling back into the current page and calling a specified
;; function
(let* ((action (let ((v (s:find-param 'action args)))
(if v v "default")))
(id (let ((i (s:find-param 'id args)))
(if i i #f)))
(page (let ((p (slot-ref s:session 'page)))
(page (let ((p (sdat-get-page s:session)))
(if p p "home")))
;; (link (session:link-to s:session page (if id
;; (list 'action action 'id id)
;; (list 'action action)))))
(link (if (string=? (substring action 0 5) "http:") ;; if first part of string is http:
action
(session:link-to s:session
|