X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=web-utils-aserve.lisp;h=6ace751136a96a65b4b326ce73d4f08272bde574;hb=20d649ec9462eab4b9fc55602308b45a59840e0e;hp=21d1b55f9c7c434c9a74f86d6f6cf434a599175e;hpb=4a7372ef4000eaaa86a987bc9668ccecf7d0489f;p=kmrcl.git diff --git a/web-utils-aserve.lisp b/web-utils-aserve.lisp index 21d1b55..6ace751 100644 --- a/web-utils-aserve.lisp +++ b/web-utils-aserve.lisp @@ -1,4 +1,3 @@ - ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION @@ -8,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: web-utils-aserve.lisp,v 1.6 2002/10/16 21:58:49 kevin Exp $ +;;;; $Id: web-utils-aserve.lisp,v 1.10 2002/10/18 07:28:57 kevin Exp $ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -61,29 +60,41 @@ (with-tag-attribute "font" (format nil "size=\"~a\"" size) (princ-http text))) -(defmacro with-link ((href xml linktype) &rest body) - (declare (ignore linktype)) +(defmacro with-link ((href &key (format :html)) &rest body) ; (format *html-stream* "Return to Home") ; (format *html-stream* "Return to Home") - `(if ,xml - (progn - (princ-http "") - ,@body - (princ-http "")) - (progn - (princ-http "") - ,@body - (princ-http "")))) - -(defun home-link (&key (xml nil) (vars nil)) - (princ-http "Return to ") - (with-link ((make-url "index.html" :vars vars) xml "homelink") - (princ-http "Browser Home")) - (princ-http "

")) + `(case ,format + (:xml + (princ-http "") + ,@body + (princ-http "")) + (:ie-xml + (princ-http "") + ,@body + (princ-http "")) + (:html + (princ-http "") + ,@body + (princ-http "")))) + +(defun home-link (&key (format :html) (vars nil)) + (case format + (:html + (princ-http "
Return to ") + (with-link ((make-url "index.html" :vars vars)) + (princ-http "Home")) + (princ-http "
")) + ((:xml :ie-xml) + (princ-http "Return to ") + (with-link ((make-url "index.html" :vars vars :format format) :format format) + (princ-http "Home")) + (princ-http "")))) (defun head (title-str &key css) (unless css @@ -97,27 +108,34 @@ ;;; Page wrappers -(defmacro with-page ((title &key css (format :html)) &rest body) +(defmacro with-page ((title &key css (format :xhtml)) &rest body) (case format - (:html + (:xhtml `(prog1 (progn (net.html.generator:html - (print-http "") - (print-http "") - (print-http "") + (print-http *standard-xhtml-header*) (print-http "") (head ,title :css ,css) (print-http "") (prog1 ,@body (print-http "")))))) + (:html + `(prog1 + (progn + (net.html.generator:html + (print-http *standard-html-header*) + (head ,title :css ,css) + (print-http "") + (prog1 + ,@body + (print-http "")))))) (:xml `(prog1 (progn (net.html.generator:html - (princ-http (std-xml-header)) + (princ-http *standard-xml-header*) (princ-http "")) (with-tag "pagetitle" (princ-http ,title)) ,@body)