;;; browse-config.mhtml: -*- Meta-HTML -*-  Configure the browser.
;;; 
;;;  Copyright (c) 1997 Brian J. Fox
;;;  Author: Brian J. Fox (bfox@ai.mit.edu) Wed Dec 10 02:48:31 1997.

<if <get-var-once posted::cancel>
    <redirect <get-var browser-page>>>

<set-var title="Browser Configurator">
<include header.mhtml>
<require browser>
<unset-var mhtml::cacheable>

<when <get-var-once posted::configure>>
  <when <get-var-once posted::sorton>>
    <set-session-var browser::order-by =
      "ORDER BY <downcase <get-var-once sorton>> <if
    <string-eq <get-var posted::order> DESC> DESC>">
    <unset-var posted::order posted::sorton posted::configure>
  </when>
  <session-export posted browser-window>
  <redirect <get-var browser-page>>
</when>

<session-import browser-window default>
<session-import browser browser>

<layout::page>
  <h4> Configure Browser </h4>

  <form method=post action=<thisdoc>>
    <input type=hidden name=browser-page value=<get-var browser-page>>
    <pre>
    <b> Window Parameters: </b>
    <concat
     "    "
     "Start: "
     <input type=text size=6 name=window-start value="<get-var window-start>">
     "  "
     "Length: "
     <input type=text size=6 name=window-length
	    value="<get-var window-length>">>

    <b> Sort Parameters: </b>
    <concat
     "    "
     "Field: "
     <browser::select-sort-field sorton>

     "  Order: "
     <browser::select-sort-order order>
     </select>>
    </pre>

    <center>
      <input type=submit name=configure value="Configure">
      <input type=submit name=cancel value="Cancel">
    </center>
  </form>
</layout::page>

<include footer.mhtml>

