Overview
Comment: | Cleaned up twiki, no more table based layout. Also no documentation yet... |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
3217617d70e32e678f2c0df30e5969c5 |
User & Date: | matt on 2011-09-25 03:33:10 |
Other Links: | manifest | tags |
Context
2011-10-04
| ||
14:42 | Merged changes for chicken4.7 to trunk check-in: fda7f57df0 user: mrwellan tags: trunk | |
2011-10-02
| ||
03:48 | Create new branch named "move-to-ck4.7.x" check-in: 79392b09d0 user: matt tags: move-to-ck4.7.x | |
2011-09-25
| ||
03:33 | Cleaned up twiki, no more table based layout. Also no documentation yet... check-in: 3217617d70 user: matt tags: trunk | |
2011-09-24
| ||
22:13 | Yikes. Changes sitting around on disk for long time.... s:any->pgint fix? check-in: 7807ffe39b user: matt tags: trunk | |
Changes
Modified modules/twiki/twiki-mod.scm from [8375211898] to [705f97d8d5].
︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ;; * Pics [pic X Y[picname.jpg]] ;; * Move twiki parsing/expanding to mattsutils as loadable module ;; Routines intended to be overridden by end users ;; (twiki:access keys wiki-name user-id) ;; search the code for "override" for more. ;; This is the currently supported mechanism. Postgres will be added later -mrw- 7/26/2009 ;; (define (twiki:open-db key . create-not-ok) ;; (s:log "Got to twiki:open-db with key: " key) (let* ((create-ok (if (null? create-not-ok) #t (car create-not-ok))) (fdat (twiki:key->fname key)) (basepath (slot-ref s:session 'twikidir)) | > > > > > > > > | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ;; * Pics [pic X Y[picname.jpg]] ;; * Move twiki parsing/expanding to mattsutils as loadable module ;; Routines intended to be overridden by end users ;; (twiki:access keys wiki-name user-id) ;; search the code for "override" for more. ;; twiki css ;; ========= ;; Block tag ;; ----- --- ;; twiki twiki ;; twiki body div twiki-node ;; twiki main menu twiki-main-menu ;; This is the currently supported mechanism. Postgres will be added later -mrw- 7/26/2009 ;; (define (twiki:open-db key . create-not-ok) ;; (s:log "Got to twiki:open-db with key: " key) (let* ((create-ok (if (null? create-not-ok) #t (car create-not-ok))) (fdat (twiki:key->fname key)) (basepath (slot-ref s:session 'twikidir)) |
︙ | ︙ | |||
207 208 209 210 211 212 213 214 215 216 | ;; (define-inline (twiki:tiddler-set-owner_id! vec val)(vector-set! vec 5 val)) ;;====================================================================== ;; Routines for displaying, editing, browsing etc. tiddlers ;;====================================================================== ;; should change this to take a tiddler structure? (define (twiki:view dat tkey wid tiddler wiki) ;; close, close others, edit, more (let ((is-not-main (not (equal? "MainMenu" (twiki:tiddler-get-name tiddler)))) (edit-allowed (member 'w (twiki:wiki-get-perms wiki)))) | > | < < < < < < < < < < < < | < | | | | | | < > | | | | | < < < | < < < < | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | ;; (define-inline (twiki:tiddler-set-owner_id! vec val)(vector-set! vec 5 val)) ;;====================================================================== ;; Routines for displaying, editing, browsing etc. tiddlers ;;====================================================================== ;; should change this to take a tiddler structure? ;; This is the display of a single tiddler (define (twiki:view dat tkey wid tiddler wiki) ;; close, close others, edit, more (let ((is-not-main (not (equal? "MainMenu" (twiki:tiddler-get-name tiddler)))) (edit-allowed (member 'w (twiki:wiki-get-perms wiki)))) (s:div 'class "tiddler" (s:div 'class "tiddler-menu" (if (equal? "MainMenu" (twiki:tiddler-get-name tiddler)) (if edit-allowed (list (s:a "edit" 'href (s:link-to (twiki:get-link-back-to-current) 'edit_tiddler (twiki:tiddler-get-id tiddler)))) '()) (s:div 'class "tiddler-menu-internal" (s:a "close" 'href (s:link-to (twiki:get-link-back-to-current) 'close_tiddler (twiki:tiddler-get-id tiddler))) "." (s:a "close others" 'href (s:link-to (twiki:get-link-back-to-current) 'close_other_tiddlers (twiki:tiddler-get-id tiddler))) "." (if edit-allowed (s:a "edit" 'href (s:link-to (twiki:get-link-back-to-current) 'edit_tiddler (twiki:tiddler-get-id tiddler))) '())))) (s:p (twiki:dat->html dat wiki))))) (define (twiki:view-tiddler db tkey wid tiddler wiki) (let* ((dat-id (twiki:tiddler-get-dat-id tiddler)) (dat (twiki:get-dat db dat-id)) (tnum (twiki:tiddler-get-id tiddler))) ;; (s:log "twid: " dat-id " dat: " dat) (twiki:view dat tkey wid tiddler wiki))) |
︙ | ︙ | |||
390 391 392 393 394 395 396 | (else (vector-ref res 0))) #f))) #f)) (define (twiki:maint_area tdb wid tkey wiki) (let ((maint (s:get-param 'twiki_maint)) (write-perm (member 'w (twiki:wiki-get-perms wiki)))) | | | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | (else (vector-ref res 0))) #f))) #f)) (define (twiki:maint_area tdb wid tkey wiki) (let ((maint (s:get-param 'twiki_maint)) (write-perm (member 'w (twiki:wiki-get-perms wiki)))) (s:div 'class "twiki-menu-internal" (if write-perm (list (s:a "Orphans" 'href (s:link-to (twiki:get-link-back-to-current) 'twiki_maint 1))(s:br) (s:a "Pics" 'href (s:link-to (twiki:get-link-back-to-current) 'twiki_maint 2))(s:br) (s:a "Help" 'href (s:link-to (twiki:get-link-back-to-current) 'twiki_maint 4))(s:br)) '()) (s:a "Search" 'href (s:link-to (twiki:get-link-back-to-current) 'twiki_maint 3))(s:br) (case maint |
︙ | ︙ | |||
679 680 681 682 683 684 685 | (if (null? lmenu) (begin (twiki:save-tiddler tdb "MainMenu" "" "" wid (twiki:get-id)) (set! lmenu (twiki:get-tiddlers tdb wid (list "MainMenu"))))) ;; get the tiddlers from the db now (set! result | | < | < | < < < < < < < < | < < < | | | | | | | | | | | | | | | | < | 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | (if (null? lmenu) (begin (twiki:save-tiddler tdb "MainMenu" "" "" wid (twiki:get-id)) (set! lmenu (twiki:get-tiddlers tdb wid (list "MainMenu"))))) ;; get the tiddlers from the db now (set! result (s:div 'class "twiki" ;; float to the right the control menu (s:div 'class "twiki-main-menu" (twiki:maint_area tdb wid tkey wikidat)) (twiki:view-tiddler tdb tkey wid (car lmenu) wikidat) ;; this is probably not needed as there is no reason to create tiddlers this way ;; (if (eq? tnumedit -1)(twiki:edit-tiddler tdb tkey wid tnumedit) '()) ;; insert the picture editor window if enabled (if (equal? (s:get-param "twiki_maint") "2")(twiki:pic_mgmt tdb wid tkey) '()) (if (equal? (s:get-param "twiki_maint") "4")(twiki:help 1) '()) (if (not (null? tdlrs)) (map (lambda (tdlr) (let ((tnum (twiki:tiddler-get-id tdlr))) (s:log "tnum: " tnum " tnumedit: " tnumedit) (if (and tnumedit (not tedited) (equal? tnumedit tnum)) (begin (set! tedited #t) ;; only allow editing one tiddler at a time (twiki:edit-tiddler tdb tkey wid tnum)) (twiki:view-tiddler tdb tkey wid tdlr wikidat)))) tdlrs) '()))) (dbi:close tdb) result)) ;; should do a single more efficient query but this is good enough (define (twiki:get-tiddlers db wid tnames) (apply twiki:get-tiddlers-by-name db wid tnames)) ;; (let* ((tdlrs '()) |
︙ | ︙ |