1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
-
+
+
-
+
-
+
-
+
-
+
|
;; Copyright 2007-2008, 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.
;;
(define s:session (make <session>))
(define s:session (make-sdat))
(initialize s:session)
;; use this for getting data from page to page when scope and evals
;; get in the way
(define s:local-vars (make-hash-table))
(define (s:local-set! k v)
(hash-table-set! s:local-vars k v))
(define (s:local-get k)
(hash-table-ref/default s:local-vars k #f))
(session:setup s:session)
(define (s:log . msg)
(apply session:log s:session msg))
(session:get-vars s:session)
(define (s:set-err . args)
(slot-set! s:session 'curr-err args))
(sdat-set-curr-err s:session args))
;; Usage: (s:get-err s:big)
(define (s:get-err wrapperfunc)
(let ((errmsg (slot-ref s:session 'curr-err)))
(let ((errmsg (sdat-get-curr-err s:session)))
(if errmsg ((if wrapperfunc
wrapperfunc
s:strong) errmsg) '())))
(define (s:current-page)
(slot-ref s:session 'page))
(sdat-get-page s:session))
(define (s:delete-session)
(session:delete-session s:session (slot-ref s:session 'session-key)))
(session:delete-session s:session (sdat-get-sesson-key s:session)))
(define (s:call page . partsl)
(if (null? partsl)
(session:call s:session page)
(session:call s:session page (car partsl))))
(define (s:link-to page . params)
|
91
92
93
94
95
96
97
98
99
100
101
102
|
92
93
94
95
96
97
98
99
100
101
102
103
|
-
+
|
(define (s:load-model model)
(session:load-model s:session model))
(define (s:model-path model)
(session:model-path s:session model))
(define (s:db)
(slot-ref s:session 'conn))
(sdat-get-conn s:session))
(define (s:never-called-page? page)
(session:never-called-page? s:session page))
|