3 import CGI hiding (div, head, map, span, Text)
10 import Text.ParserCombinators.Parsec
12 testDB = createPGB "wave" "wiki" "wiki" "12wiki34db"
18 runWithHook [] (\(key:act) -> sp db key act ) $ sp db "MainPage" []
20 ps a = standardQuery "Hello" a
23 s <- io $ getCurrent db key
26 Just (x,_) -> return x
27 standardQuery key $ do
28 t <- p $ makeTextarea s' (attr_SS "rows" "10" ## attr_SS "cols" "75" ## attr_SS "colspan" "2")
31 a <- textInputField (fieldSIZE 20)
34 c <- textInputField (fieldSIZE 20)
35 --p $ submit (F2 t a) testing (attr "value" "Send")
36 p $ defaultSubmit (F3 t a c) (savePage db key) (attr "value" "Send")
37 --submit0 (sp db key []) (attr "value" "Send1")
40 s <- io $ getCurrent db key
41 standardQuery key $ showPage db key s
43 savePage db key (F3 t a c) = do
44 io $ update db key fulltext author comment
45 s <- io $ getCurrent db key
46 standardQuery key $ do
53 showPage db key s = do
55 Nothing -> text "No text added for this keyword"
56 Just (full, date) -> do
57 case parse wikiParser "" full of
63 p $ text $ "Last edited: "++date
68 submit0 (editPage db key) (attr "value" "Edit")
69 --address (hlink (URL {unURL = ("wiki?"++key++"+edit")}) (text "Edit this page")
72 ex ((Paragraph):xs) = do
78 ex ((Link l d):xs) = do
79 hlink (URL {unURL = ("wiki?"++l)}) (text d)
83 ex2 ((Paragraph):xs) = "<p>"++ex2 xs
84 ex2 ((Text s):xs) = s++ex2 xs
85 ex2 ((Link l d):xs) = "<link: "++l++" desc: "++d++">"++ex2 xs
88 test s = case parse wikiParser "" s of