| 100 |
let fun protect_quote (s : String) : String = |
let fun protect_quote (s : String) : String = |
| 101 |
transform s with '"' -> [ '\\"' ] | c -> [c];; |
transform s with '"' -> [ '\\"' ] | c -> [c];; |
| 102 |
|
|
| 103 |
let php_css : String = |
let php_css : Latin1 = |
| 104 |
[' <?php |
[' <?php |
| 105 |
$browser = getenv("HTTP_USER_AGENT"); |
$browser = getenv("HTTP_USER_AGENT"); |
| 106 |
if (preg_match("/MSIE/i", "$browser")) { |
if (preg_match("/MSIE/i", "$browser")) { |
| 132 |
else css;; |
else css;; |
| 133 |
**) |
**) |
| 134 |
|
|
| 135 |
let fun patch_css (String -> String) |
let fun patch_css (Latin1 -> Latin1) |
| 136 |
| [ a::_*? '<meta content="css"/>'; rem ] -> a @ php_css @ rem |
| [ a::_*? '<meta content="css"/>'; rem ] -> a @ php_css @ rem |
| 137 |
| s -> s;; |
| s -> s;; |
| 138 |
|
|
| 263 |
let navig : Flow = transform items with |
let navig : Flow = transform items with |
| 264 |
| <left>c -> [<div class="box">(content c)] |
| <left>c -> [<div class="box">(content c)] |
| 265 |
in |
in |
| 266 |
let navig = match navig with |
let left = match navig with |
| 267 |
| [] -> [<div class="box">(content [<boxes-toc>[]])] |
| [] -> [<div class="box">(content [<boxes-toc>[]])] |
| 268 |
| n -> n in |
| n -> n in |
| 269 |
let dpath : Inlines = transform path with |
let dpath : Inlines = transform path with |
| 270 |
| { url = f; title = t } -> [ <a href=f>t ' :: '] |
| { url = f; title = t } -> [ <a href=f>t ': '] |
| 271 |
in |
in |
| 272 |
let npath = path @ [ { url = url_of_name name; title = title } ] in |
let npath = path @ [ { url = url_of_name name; title = title } ] in |
| 273 |
let subpages = transform items with p & Page -> [ p ] in |
let subpages = transform items with p & Page -> [ p ] in |
| 274 |
let (next,last) = gen_page_seq (page, subpages, next, npath, sitemap) in |
let (next,last) = gen_page_seq (page, subpages, next, npath, sitemap) in |
| 275 |
let next = match next with [] -> [] | p -> [' Next : ' (link_to p)] in |
let next = match next with [] -> [] |
| 276 |
let prev = match prev with [] -> [] | p -> [' Prev : ' (link_to p)] in |
| <page name=n>[ <title>t; _ ] -> |
| 277 |
|
[ <a href=(url_of_name n)>[ |
| 278 |
|
<img width="16"; height="16"; class="icon"; alt="Next page"; src="img/right.gif">[] |
| 279 |
|
' ' !t |
| 280 |
|
] ] in |
| 281 |
|
let prev = match prev with [] -> [] |
| 282 |
|
| <page name=n>[ <title>t; _ ] -> |
| 283 |
|
[ <a href=(url_of_name n)>[ |
| 284 |
|
<img width="16"; height="16"; class="icon"; alt="Previous page"; src="img/left.gif">[] |
| 285 |
|
' ' !t |
| 286 |
|
] ] in |
| 287 |
|
let navig : [ Xdiv* ] = |
| 288 |
|
if prev = [] then [] else |
| 289 |
|
[ <div class="box">[ |
| 290 |
|
<p>[ !dpath !title ] |
| 291 |
|
<p>[ !prev ' ' !next ] ] ] in |
| 292 |
let html : Xhtml = |
let html : Xhtml = |
| 293 |
<html>[ |
<html>[ |
| 294 |
<head>[ |
<head>[ |
| 297 |
<meta content="css">[] (* Placeholder for PHP code *) |
<meta content="css">[] (* Placeholder for PHP code *) |
| 298 |
] |
] |
| 299 |
<body>[ |
<body>[ |
| 300 |
<div class="title">[ |
<div class="title">[ <h1>(text banner) ] |
| 301 |
<h1>(text banner) |
<div id="Sidelog">left |
| 302 |
<p>[ <b>"You're here: " !dpath !title ] |
<div id="Content">( navig @ main @ navig ) |
|
<p>[ !prev !next ] |
|
|
] |
|
|
<div id="Sidelog">navig |
|
|
<div id="Content">main |
|
| 303 |
] |
] |
| 304 |
] |
] |
| 305 |
in |
in |
| 306 |
let txt : String = |
let txt : Latin1 = |
| 307 |
[ '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' |
[ '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' |
| 308 |
' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' |
' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' |
| 309 |
!(patch_css (print_xml html)) ] in |
!(patch_css (print_xml html)) ] in |