2011-07-01 22:56:53 +00:00
|
|
|
|
|
|
|
if {![exists -proc require]} {
|
2011-07-05 18:38:42 +00:00
|
|
|
proc require {args} {{done {}}} {
|
2011-07-01 22:56:53 +00:00
|
|
|
foreach file $args {
|
2011-07-07 22:33:19 +00:00
|
|
|
if {$file ni $done} {
|
2012-05-21 20:23:41 +00:00
|
|
|
uplevel source "/mod/webif/lib/$file"
|
2011-07-05 18:38:42 +00:00
|
|
|
lappend $done $file
|
|
|
|
}
|
2011-07-01 22:56:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
proc httpheader {{type "text/html"} {cache 0} {extra ""}} {{done 0}} {
|
|
|
|
if {$done} return
|
|
|
|
if {!$cache} {
|
2013-02-25 22:31:54 +00:00
|
|
|
puts -nonewline "Content-Type: $type; charset=\"UTF-8\"; no-cache\r\n"
|
2013-02-09 22:46:15 +00:00
|
|
|
puts -nonewline "Expires: -1\r\n"
|
|
|
|
puts -nonewline "Pragma: no-cache\r\n"
|
|
|
|
puts -nonewline "Cache-Control: no-cache\r\n"
|
|
|
|
} else {
|
2013-02-25 22:31:54 +00:00
|
|
|
puts "Content-Type: $type; charset=\"UTF-8\"\r\n"
|
2013-02-09 22:46:15 +00:00
|
|
|
}
|
|
|
|
puts -nonewline $extra
|
|
|
|
puts -nonewline "\r\n"
|
|
|
|
set done 1
|
|
|
|
}
|
|
|
|
|
|
|
|
proc header {{type "text/html"} {cache 0}} {
|
|
|
|
httpheader $type $cache
|
2012-05-21 20:23:41 +00:00
|
|
|
uplevel source /mod/webif/html/lib/header.jim
|
2011-07-01 22:56:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc footer {} {
|
2012-05-21 20:23:41 +00:00
|
|
|
uplevel source /mod/webif/html/lib/footer.jim
|
2011-07-01 22:56:53 +00:00
|
|
|
}
|
2012-01-22 19:47:47 +00:00
|
|
|
|
2012-10-23 22:51:54 +00:00
|
|
|
proc mheader {} {
|
|
|
|
uplevel source /mod/webif/html/m/lib/header.jim
|
|
|
|
}
|
|
|
|
|
|
|
|
proc mfooter {} {
|
|
|
|
uplevel source /mod/webif/html/m/lib/footer.jim
|
|
|
|
}
|
|
|
|
|
2013-02-27 23:15:37 +00:00
|
|
|
require fileops
|
2011-07-01 22:56:53 +00:00
|
|
|
}
|
|
|
|
|