Index: doc/howto.txt ================================================================== --- doc/howto.txt +++ doc/howto.txt @@ -81,17 +81,26 @@ make a selection drop down ~~~~~~~~~~~~~~~~~~~~~~~~~~ +;; items is a hierarchial alist +;; ( (label1 value1 dispval1 #t) ;; <== this one is selected +;; (label2 (label3 value2 dispval2) +;; (label4 value3 dispval3))) + In view.scm: ;; Label Value visible-str selected (s:select '(("World" 0)("Country" 1)("State" 2 "The state" #t )("Town/City" 3)) 'name 'scope) Visible str will be shown if provided. Selected will set that entry to pre-selected. +To select a specific entry: + +(s:select '(("World" 0 "world" #f)("Country" 1 "country" #t)("State" 2 "state" #f)("Town/City" 3 "town" #f)) 'name 'scope) + In control.scm: (let ((scope (s:get-input 'scope)) (scope-num (s:get-input 'scope 'number))) ;; 'number, 'raw or 'escaped .... Index: misc-stml.scm ================================================================== --- misc-stml.scm +++ misc-stml.scm @@ -10,14 +10,13 @@ ;;====================================================================== ;; dumbobj helpers ;;====================================================================== (declare (unit misc-stml)) +(use regex (prefix dbi dbi:)) (use (prefix crypt c:)) -(use regex) (use (prefix dbi dbi:)) - ;; given a list of symbols give the count of the matching symbol ;; l => '(a b c) (dumobj:indx a 'b) => 1 (define (s:get-fieldnum lst field-name) (let loop ((head (car lst)) (tail (cdr lst)) Index: session.scm ================================================================== --- session.scm +++ session.scm @@ -6,12 +6,10 @@ ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. (declare (unit session)) -;; (require-library dbi) -;; (use dbi) (use (prefix dbi dbi:)) (require-extension regex) (declare (uses cookie)) ;; sessions table @@ -237,26 +235,26 @@ ;; (list (conc "session_key=" (sdat-get-session-key self) "; Path=/; Domain=." (sdat-get-domain self) "; Max-Age=" (* 86400 14) "; Version=1"))) ;; According to ;; http://www.codemarvels.com/2010/11/apache-rewriterule-set-a-cookie-on-localhost/ ;; Here are the 2 (often left out) requirements to set a cookie using - ;; httpd-F¢s rewrite rule (mod_rewrite), while working on localhost:-A + ;; httpd-F�s rewrite rule (mod_rewrite), while working on localhost:-A ;; ;; Use the IP 127.0.0.1 instead of localhost/machine-name as the ;; domain; e.g. [CO=someCookie:someValue:127.0.0.1:2:/], which says - ;; create a cookie -Y´someCookie¡ with value ´someValue¡ for the - ;; domain ´127.0.0.1$B!m(B having a life time of 2 mins, for any path in + ;; create a cookie -Y�someCookie� with value �someValue� for the + ;; domain �127.0.0.1$B!m(B having a life time of 2 mins, for any path in ;; the domain (path=/). (Obviously you will have to run the ;; application with this value in the URL) ;; ;; To make a session cookie, limit the flag statement to just three ;; attributes: name, value and domain. e.g ;; [CO=someCookie:someValue:127.0.0.1] %G–%@ Any further - ;; settings, apache writes an¡ expires¡ attribute for the set-cookie + ;; settings, apache writes an� expires� attribute for the set-cookie ;; header, which makes the cookie a persistent one (not really ;; persistent, as the expires value set is the current server time - ;; %G–%@ so you don-F-F¢t even get to see your cookie!)-A + ;; %G–%@ so you don-F-F�t even get to see your cookie!)-A (list (string-substitute ";" "; " (car (construct-cookie-string ;; warning! messing up this itty bitty bit of code will cost much time! `(("session_key" ,(sdat-get-session-key self)