Overview
Comment:Oops. missed setup.scm
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4b5ced8c71f164cd177c1f9be7e0d69ca1aa1a74
User & Date: matt on 2016-09-19 06:05:14
Other Links: manifest | tags
Context
2016-09-21
04:31
Trim \n sillyness from escaped strings check-in: 8b94f6cb84 user: matt tags: trunk
2016-09-19
06:05
Oops. missed setup.scm check-in: 4b5ced8c71 user: matt tags: trunk
05:55
Add filtering to s:get-input. Switch to dbi. check-in: e78a65d865 user: matt tags: trunk
Changes

Modified session.scm from [cfa085cc41] to [fc54694d2f].

749
750
751
752
753
754
755

756

757
758
759
760
761
762
763
			  (begin
			    (session:log self "ERROR: bad key " key)
			    #f)))))
    (case dtype
      ((raw)     res)
      ((number)  (if (string? res)(string->number res) #f))
      ((escaped) (s:html-filter res tags)) 

      (else      (s:html-filter res '())))))


;; This one will get the first value found regardless of form
(define (session:get-input-keys self)
  (let* ((formdat (sdat-get-formdat self)))
    (if (not formdat) #f
	(if (and (vector? formdat)(eq? (vector-length formdat) 1)(hash-table? (vector-ref formdat 0)))
	    (formdat:keys formdat)







>
|
>







749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
			  (begin
			    (session:log self "ERROR: bad key " key)
			    #f)))))
    (case dtype
      ((raw)     res)
      ((number)  (if (string? res)(string->number res) #f))
      ((escaped) (s:html-filter res tags)) 
      (else      (if (string? res)
		     (s:html-filter res '())
		     res)))))

;; This one will get the first value found regardless of form
(define (session:get-input-keys self)
  (let* ((formdat (sdat-get-formdat self)))
    (if (not formdat) #f
	(if (and (vector? formdat)(eq? (vector-length formdat) 1)(hash-table? (vector-ref formdat 0)))
	    (formdat:keys formdat)

Modified setup.scm from [db7a7b2e0f] to [967d19ca83].

84
85
86
87
88
89
90






91
92
93
94
95
96
97
98
99

;; utility to get all vars as hash table
(define (s:session-get-sessionvars)
  (sdat-get-sessionvars s:session))

;; inputs
;;






(define (s:get-input key)
  (session:get-input s:session key))

(define (s:get-input-keys)
  (session:get-input-keys s:session))

(define (s:load-model model)
  (session:load-model s:session model))








>
>
>
>
>
>
|
|







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

;; utility to get all vars as hash table
(define (s:session-get-sessionvars)
  (sdat-get-sessionvars s:session))

;; inputs
;;
;; param: (dtype [tag1 tag2 ...])
;; dtype:
;;    'raw     : do no conversion
;;    'number  : convert to number, return #f if fails
;;    'escaped : use html-escape to protect the input
;;
(define (s:get-input key . params)
  (session:get-input s:session key params))

(define (s:get-input-keys)
  (session:get-input-keys s:session))

(define (s:load-model model)
  (session:load-model s:session model))