Hex Artifact Content
Not logged in

Artifact 9a943b5a17ed58556d7836e6c79e69ac840b8cc9:

File src/style.c part of check-in [fd36718ad9] - Add the new "history" permission. Merge in changes that require permissions to view the timeline. by drh on 2007-07-31 23:33:15.

0000: 2f 2a 0a 2a 2a 20 43 6f 70 79 72 69 67 68 74 20  /*.** Copyright 
0010: 28 63 29 20 32 30 30 36 20 44 2e 20 52 69 63 68  (c) 2006 D. Rich
0020: 61 72 64 20 48 69 70 70 0a 2a 2a 0a 2a 2a 20 54  ard Hipp.**.** T
0030: 68 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 66  his program is f
0040: 72 65 65 20 73 6f 66 74 77 61 72 65 3b 20 79 6f  ree software; yo
0050: 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75  u can redistribu
0060: 74 65 20 69 74 20 61 6e 64 2f 6f 72 0a 2a 2a 20  te it and/or.** 
0070: 6d 6f 64 69 66 79 20 69 74 20 75 6e 64 65 72 20  modify it under 
0080: 74 68 65 20 74 65 72 6d 73 20 6f 66 20 74 68 65  the terms of the
0090: 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62   GNU General Pub
00a0: 6c 69 63 0a 2a 2a 20 4c 69 63 65 6e 73 65 20 76  lic.** License v
00b0: 65 72 73 69 6f 6e 20 32 20 61 73 20 70 75 62 6c  ersion 2 as publ
00c0: 69 73 68 65 64 20 62 79 20 74 68 65 20 46 72 65  ished by the Fre
00d0: 65 20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64  e Software Found
00e0: 61 74 69 6f 6e 2e 0a 2a 2a 0a 2a 2a 20 54 68 69  ation..**.** Thi
00f0: 73 20 70 72 6f 67 72 61 6d 20 69 73 20 64 69 73  s program is dis
0100: 74 72 69 62 75 74 65 64 20 69 6e 20 74 68 65 20  tributed in the 
0110: 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69 6c  hope that it wil
0120: 6c 20 62 65 20 75 73 65 66 75 6c 2c 0a 2a 2a 20  l be useful,.** 
0130: 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20  but WITHOUT ANY 
0140: 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75  WARRANTY; withou
0150: 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69  t even the impli
0160: 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 0a 2a  ed warranty of.*
0170: 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54  * MERCHANTABILIT
0180: 59 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52  Y or FITNESS FOR
0190: 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55   A PARTICULAR PU
01a0: 52 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65 20  RPOSE.  See the 
01b0: 47 4e 55 0a 2a 2a 20 47 65 6e 65 72 61 6c 20 50  GNU.** General P
01c0: 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 6f  ublic License fo
01d0: 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0a  r more details..
01e0: 2a 2a 20 0a 2a 2a 20 59 6f 75 20 73 68 6f 75 6c  ** .** You shoul
01f0: 64 20 68 61 76 65 20 72 65 63 65 69 76 65 64 20  d have received 
0200: 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47 4e  a copy of the GN
0210: 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63  U General Public
0220: 0a 2a 2a 20 4c 69 63 65 6e 73 65 20 61 6c 6f 6e  .** License alon
0230: 67 20 77 69 74 68 20 74 68 69 73 20 6c 69 62 72  g with this libr
0240: 61 72 79 3b 20 69 66 20 6e 6f 74 2c 20 77 72 69  ary; if not, wri
0250: 74 65 20 74 6f 20 74 68 65 0a 2a 2a 20 46 72 65  te to the.** Fre
0260: 65 20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64  e Software Found
0270: 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 39 20  ation, Inc., 59 
0280: 54 65 6d 70 6c 65 20 50 6c 61 63 65 20 2d 20 53  Temple Place - S
0290: 75 69 74 65 20 33 33 30 2c 0a 2a 2a 20 42 6f 73  uite 330,.** Bos
02a0: 74 6f 6e 2c 20 4d 41 20 20 30 32 31 31 31 2d 31  ton, MA  02111-1
02b0: 33 30 37 2c 20 55 53 41 2e 0a 2a 2a 0a 2a 2a 20  307, USA..**.** 
02c0: 41 75 74 68 6f 72 20 63 6f 6e 74 61 63 74 20 69  Author contact i
02d0: 6e 66 6f 72 6d 61 74 69 6f 6e 3a 0a 2a 2a 20 20  nformation:.**  
02e0: 20 64 72 68 40 68 77 61 63 69 2e 63 6f 6d 0a 2a   drh@hwaci.com.*
02f0: 2a 20 20 20 68 74 74 70 3a 2f 2f 77 77 77 2e 68  *   http://www.h
0300: 77 61 63 69 2e 63 6f 6d 2f 64 72 68 2f 0a 2a 2a  waci.com/drh/.**
0310: 0a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  .***************
0320: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0330: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0340: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0350: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0360: 0a 2a 2a 0a 2a 2a 20 54 68 69 73 20 66 69 6c 65  .**.** This file
0370: 20 63 6f 6e 74 61 69 6e 73 20 63 6f 64 65 20 74   contains code t
0380: 6f 20 69 6d 70 6c 65 6d 65 6e 74 20 74 68 65 20  o implement the 
0390: 62 61 73 69 63 20 77 65 62 20 70 61 67 65 20 6c  basic web page l
03a0: 6f 6f 6b 20 61 6e 64 20 66 65 65 6c 2e 0a 2a 2a  ook and feel..**
03b0: 0a 2a 2f 0a 23 69 6e 63 6c 75 64 65 20 22 63 6f  .*/.#include "co
03c0: 6e 66 69 67 2e 68 22 0a 23 69 6e 63 6c 75 64 65  nfig.h".#include
03d0: 20 22 73 74 79 6c 65 2e 68 22 0a 0a 0a 2f 2a 0a   "style.h".../*.
03e0: 2a 2a 20 45 6c 65 6d 65 6e 74 73 20 6f 66 20 74  ** Elements of t
03f0: 68 65 20 73 75 62 6d 65 6e 75 20 61 72 65 20 63  he submenu are c
0400: 6f 6c 6c 65 63 74 65 64 20 69 6e 74 6f 20 74 68  ollected into th
0410: 65 20 66 6f 6c 6c 6f 77 69 6e 67 0a 2a 2a 20 73  e following.** s
0420: 74 72 75 63 74 75 72 65 20 61 6e 64 20 64 69 73  tructure and dis
0430: 70 6c 61 79 65 64 20 62 65 6c 6f 77 20 74 68 65  played below the
0440: 20 6d 61 69 6e 20 6d 65 6e 75 20 62 79 20 73 74   main menu by st
0450: 79 6c 65 5f 68 65 61 64 65 72 28 29 2e 0a 2a 2a  yle_header()..**
0460: 0a 2a 2a 20 50 6f 70 75 6c 61 74 65 20 74 68 69  .** Populate thi
0470: 73 20 73 74 72 75 63 74 75 72 65 20 77 69 74 68  s structure with
0480: 20 63 61 6c 6c 73 20 74 6f 20 73 74 79 6c 65 5f   calls to style_
0490: 73 75 62 6d 65 6e 75 5f 65 6c 65 6d 65 6e 74 28  submenu_element(
04a0: 29 0a 2a 2a 20 70 72 69 6f 72 20 74 6f 20 63 61  ).** prior to ca
04b0: 6c 6c 69 6e 67 20 73 74 79 6c 65 5f 68 65 61 64  lling style_head
04c0: 65 72 28 29 2e 0a 2a 2f 0a 73 74 61 74 69 63 20  er()..*/.static 
04d0: 73 74 72 75 63 74 20 53 75 62 6d 65 6e 75 20 7b  struct Submenu {
04e0: 0a 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 7a  .  const char *z
04f0: 4c 61 62 65 6c 3b 0a 20 20 63 6f 6e 73 74 20 63  Label;.  const c
0500: 68 61 72 20 2a 7a 54 69 74 6c 65 3b 0a 20 20 63  har *zTitle;.  c
0510: 6f 6e 73 74 20 63 68 61 72 20 2a 7a 4c 69 6e 6b  onst char *zLink
0520: 3b 0a 7d 20 61 53 75 62 6d 65 6e 75 5b 33 30 5d  ;.} aSubmenu[30]
0530: 3b 0a 73 74 61 74 69 63 20 69 6e 74 20 6e 53 75  ;.static int nSu
0540: 62 6d 65 6e 75 20 3d 20 30 3b 0a 0a 2f 2a 0a 2a  bmenu = 0;../*.*
0550: 2a 20 41 64 64 20 61 20 6e 65 77 20 65 6c 65 6d  * Add a new elem
0560: 65 6e 74 20 74 6f 20 74 68 65 20 73 75 62 6d 65  ent to the subme
0570: 6e 75 0a 2a 2f 0a 76 6f 69 64 20 73 74 79 6c 65  nu.*/.void style
0580: 5f 73 75 62 6d 65 6e 75 5f 65 6c 65 6d 65 6e 74  _submenu_element
0590: 28 0a 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a  (.  const char *
05a0: 7a 4c 61 62 65 6c 2c 0a 20 20 63 6f 6e 73 74 20  zLabel,.  const 
05b0: 63 68 61 72 20 2a 7a 54 69 74 6c 65 2c 0a 20 20  char *zTitle,.  
05c0: 63 6f 6e 73 74 20 63 68 61 72 20 2a 7a 4c 69 6e  const char *zLin
05d0: 6b 0a 29 7b 0a 20 20 61 73 73 65 72 74 28 20 6e  k.){.  assert( n
05e0: 53 75 62 6d 65 6e 75 20 3c 20 73 69 7a 65 6f 66  Submenu < sizeof
05f0: 28 61 53 75 62 6d 65 6e 75 29 2f 73 69 7a 65 6f  (aSubmenu)/sizeo
0600: 66 28 61 53 75 62 6d 65 6e 75 5b 30 5d 29 20 29  f(aSubmenu[0]) )
0610: 3b 0a 20 20 61 53 75 62 6d 65 6e 75 5b 6e 53 75  ;.  aSubmenu[nSu
0620: 62 6d 65 6e 75 5d 2e 7a 4c 61 62 65 6c 20 3d 20  bmenu].zLabel = 
0630: 7a 4c 61 62 65 6c 3b 0a 20 20 61 53 75 62 6d 65  zLabel;.  aSubme
0640: 6e 75 5b 6e 53 75 62 6d 65 6e 75 5d 2e 7a 54 69  nu[nSubmenu].zTi
0650: 74 6c 65 20 3d 20 7a 54 69 74 6c 65 3b 0a 20 20  tle = zTitle;.  
0660: 61 53 75 62 6d 65 6e 75 5b 6e 53 75 62 6d 65 6e  aSubmenu[nSubmen
0670: 75 5d 2e 7a 4c 69 6e 6b 20 3d 20 7a 4c 69 6e 6b  u].zLink = zLink
0680: 3b 0a 20 20 6e 53 75 62 6d 65 6e 75 2b 2b 3b 0a  ;.  nSubmenu++;.
0690: 7d 0a 0a 2f 2a 0a 2a 2a 20 43 6f 6d 70 61 72 65  }../*.** Compare
06a0: 20 74 77 6f 20 73 75 62 6d 65 6e 75 20 69 74 65   two submenu ite
06b0: 6d 73 20 66 6f 72 20 73 6f 72 74 69 6e 67 20 70  ms for sorting p
06c0: 75 72 70 6f 73 65 73 0a 2a 2f 0a 73 74 61 74 69  urposes.*/.stati
06d0: 63 20 69 6e 74 20 73 75 62 6d 65 6e 75 43 6f 6d  c int submenuCom
06e0: 70 61 72 65 28 63 6f 6e 73 74 20 76 6f 69 64 20  pare(const void 
06f0: 2a 61 2c 20 63 6f 6e 73 74 20 76 6f 69 64 20 2a  *a, const void *
0700: 62 29 7b 0a 20 20 63 6f 6e 73 74 20 73 74 72 75  b){.  const stru
0710: 63 74 20 53 75 62 6d 65 6e 75 20 2a 41 20 3d 20  ct Submenu *A = 
0720: 28 63 6f 6e 73 74 20 73 74 72 75 63 74 20 53 75  (const struct Su
0730: 62 6d 65 6e 75 2a 29 61 3b 0a 20 20 63 6f 6e 73  bmenu*)a;.  cons
0740: 74 20 73 74 72 75 63 74 20 53 75 62 6d 65 6e 75  t struct Submenu
0750: 20 2a 42 20 3d 20 28 63 6f 6e 73 74 20 73 74 72   *B = (const str
0760: 75 63 74 20 53 75 62 6d 65 6e 75 2a 29 42 3b 0a  uct Submenu*)B;.
0770: 20 20 72 65 74 75 72 6e 20 73 74 72 63 6d 70 28    return strcmp(
0780: 41 2d 3e 7a 4c 61 62 65 6c 2c 20 42 2d 3e 7a 4c  A->zLabel, B->zL
0790: 61 62 65 6c 29 3b 0a 7d 0a 0a 2f 2a 0a 2a 2a 20  abel);.}../*.** 
07a0: 44 72 61 77 20 74 68 65 20 68 65 61 64 65 72 2e  Draw the header.
07b0: 0a 2a 2f 0a 76 6f 69 64 20 73 74 79 6c 65 5f 68  .*/.void style_h
07c0: 65 61 64 65 72 28 63 6f 6e 73 74 20 63 68 61 72  eader(const char
07d0: 20 2a 7a 54 69 74 6c 65 29 7b 0a 20 20 63 6f 6e   *zTitle){.  con
07e0: 73 74 20 63 68 61 72 20 2a 7a 4c 6f 67 49 6e 4f  st char *zLogInO
07f0: 75 74 20 3d 20 22 4c 6f 67 6f 75 74 22 3b 0a 20  ut = "Logout";. 
0800: 20 6c 6f 67 69 6e 5f 63 68 65 63 6b 5f 63 72 65   login_check_cre
0810: 64 65 6e 74 69 61 6c 73 28 29 3b 0a 20 20 40 20  dentials();.  @ 
0820: 3c 68 74 6d 6c 3e 0a 20 20 40 20 3c 62 6f 64 79  <html>.  @ <body
0830: 20 62 67 63 6f 6c 6f 72 3d 22 77 68 69 74 65 22   bgcolor="white"
0840: 3e 0a 20 20 40 20 3c 68 72 20 73 69 7a 65 3d 22  >.  @ <hr size="
0850: 31 22 3e 0a 20 20 40 20 3c 74 61 62 6c 65 20 62  1">.  @ <table b
0860: 6f 72 64 65 72 3d 22 30 22 20 63 65 6c 6c 70 61  order="0" cellpa
0870: 64 64 69 6e 67 3d 22 30 22 20 63 65 6c 6c 73 70  dding="0" cellsp
0880: 61 63 69 6e 67 3d 22 30 22 20 77 69 64 74 68 3d  acing="0" width=
0890: 22 31 30 30 25 25 22 3e 0a 20 20 40 20 3c 74 72  "100%%">.  @ <tr
08a0: 3e 3c 74 64 20 76 61 6c 69 67 6e 3d 22 74 6f 70  ><td valign="top
08b0: 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e 0a  " align="left">.
08c0: 20 20 40 20 3c 62 69 67 3e 3c 62 69 67 3e 3c 62    @ <big><big><b
08d0: 3e 25 73 28 7a 54 69 74 6c 65 29 3c 2f 62 3e 3c  >%s(zTitle)</b><
08e0: 2f 62 69 67 3e 3c 2f 62 69 67 3e 3c 62 72 3e 0a  /big></big><br>.
08f0: 20 20 69 66 28 20 67 2e 7a 4c 6f 67 69 6e 3d 3d    if( g.zLogin==
0900: 30 20 29 7b 0a 20 20 20 20 40 20 3c 73 6d 61 6c  0 ){.    @ <smal
0910: 6c 3e 6e 6f 74 20 6c 6f 67 67 65 64 20 69 6e 3c  l>not logged in<
0920: 2f 73 6d 61 6c 6c 3e 0a 20 20 20 20 7a 4c 6f 67  /small>.    zLog
0930: 49 6e 4f 75 74 20 3d 20 22 4c 6f 67 69 6e 22 3b  InOut = "Login";
0940: 0a 20 20 7d 65 6c 73 65 7b 0a 20 20 20 20 40 20  .  }else{.    @ 
0950: 3c 73 6d 61 6c 6c 3e 6c 6f 67 67 65 64 20 69 6e  <small>logged in
0960: 20 61 73 20 25 68 28 67 2e 7a 4c 6f 67 69 6e 29   as %h(g.zLogin)
0970: 3c 2f 73 6d 61 6c 6c 3e 0a 20 20 7d 0a 20 20 40  </small>.  }.  @
0980: 20 3c 2f 74 64 3e 3c 74 64 20 76 61 6c 69 67 6e   </td><td valign
0990: 3d 22 74 6f 70 22 20 61 6c 69 67 6e 3d 22 72 69  ="top" align="ri
09a0: 67 68 74 22 3e 0a 20 20 40 20 3c 61 20 68 72 65  ght">.  @ <a hre
09b0: 66 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 52 4c  f="%s(g.zBaseURL
09c0: 29 2f 69 6e 64 65 78 22 3e 48 6f 6d 65 3c 2f 61  )/index">Home</a
09d0: 3e 0a 20 20 69 66 28 20 67 2e 6f 6b 52 65 61 64  >.  if( g.okRead
09e0: 20 29 7b 0a 20 20 20 20 40 20 7c 20 3c 61 20 68   ){.    @ | <a h
09f0: 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 65 55  ref="%s(g.zBaseU
0a00: 52 4c 29 2f 74 69 6d 65 6c 69 6e 65 22 3e 54 69  RL)/timeline">Ti
0a10: 6d 65 6c 69 6e 65 3c 2f 61 3e 0a 20 20 7d 0a 20  meline</a>.  }. 
0a20: 20 69 66 28 20 67 2e 6f 6b 52 64 57 69 6b 69 20   if( g.okRdWiki 
0a30: 29 7b 0a 20 20 20 20 40 20 7c 20 3c 61 20 68 72  ){.    @ | <a hr
0a40: 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 52  ef="%s(g.zBaseUR
0a50: 4c 29 2f 77 69 6b 69 22 3e 57 69 6b 69 3c 2f 61  L)/wiki">Wiki</a
0a60: 3e 0a 20 20 7d 0a 23 69 66 20 30 0a 20 20 40 20  >.  }.#if 0.  @ 
0a70: 7c 20 3c 66 6f 6e 74 20 63 6f 6c 6f 72 3d 22 23  | <font color="#
0a80: 38 38 38 38 38 38 22 3e 53 65 61 72 63 68 3c 2f  888888">Search</
0a90: 66 6f 6e 74 3e 0a 20 20 40 20 7c 20 3c 66 6f 6e  font>.  @ | <fon
0aa0: 74 20 63 6f 6c 6f 72 3d 22 23 38 38 38 38 38 38  t color="#888888
0ab0: 22 3e 54 69 63 6b 65 74 3c 2f 66 6f 6e 74 3e 0a  ">Ticket</font>.
0ac0: 20 20 40 20 7c 20 3c 66 6f 6e 74 20 63 6f 6c 6f    @ | <font colo
0ad0: 72 3d 22 23 38 38 38 38 38 38 22 3e 52 65 70 6f  r="#888888">Repo
0ae0: 72 74 73 3c 2f 66 6f 6e 74 3e 0a 23 65 6e 64 69  rts</font>.#endi
0af0: 66 0a 20 20 69 66 28 20 67 2e 6f 6b 53 65 74 75  f.  if( g.okSetu
0b00: 70 20 29 7b 0a 20 20 20 20 40 20 7c 20 3c 61 20  p ){.    @ | <a 
0b10: 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 65  href="%s(g.zBase
0b20: 55 52 4c 29 2f 73 65 74 75 70 22 3e 53 65 74 75  URL)/setup">Setu
0b30: 70 3c 2f 61 3e 0a 20 20 7d 0a 20 20 69 66 28 20  p</a>.  }.  if( 
0b40: 21 67 2e 6e 6f 50 73 77 64 20 29 7b 0a 20 20 20  !g.noPswd ){.   
0b50: 20 40 20 7c 20 3c 61 20 68 72 65 66 3d 22 25 73   @ | <a href="%s
0b60: 28 67 2e 7a 42 61 73 65 55 52 4c 29 2f 6c 6f 67  (g.zBaseURL)/log
0b70: 69 6e 22 3e 25 73 28 7a 4c 6f 67 49 6e 4f 75 74  in">%s(zLogInOut
0b80: 29 3c 2f 61 3e 0a 20 20 7d 0a 20 20 69 66 28 20  )</a>.  }.  if( 
0b90: 6e 53 75 62 6d 65 6e 75 3e 30 20 29 7b 0a 20 20  nSubmenu>0 ){.  
0ba0: 20 20 69 6e 74 20 69 3b 0a 20 20 20 20 40 20 3c    int i;.    @ <
0bb0: 62 72 3e 0a 20 20 20 20 71 73 6f 72 74 28 61 53  br>.    qsort(aS
0bc0: 75 62 6d 65 6e 75 2c 20 6e 53 75 62 6d 65 6e 75  ubmenu, nSubmenu
0bd0: 2c 20 73 69 7a 65 6f 66 28 61 53 75 62 6d 65 6e  , sizeof(aSubmen
0be0: 75 5b 30 5d 29 2c 20 73 75 62 6d 65 6e 75 43 6f  u[0]), submenuCo
0bf0: 6d 70 61 72 65 29 3b 0a 20 20 20 20 66 6f 72 28  mpare);.    for(
0c00: 69 3d 30 3b 20 69 3c 6e 53 75 62 6d 65 6e 75 3b  i=0; i<nSubmenu;
0c10: 20 69 2b 2b 29 7b 0a 20 20 20 20 20 20 73 74 72   i++){.      str
0c20: 75 63 74 20 53 75 62 6d 65 6e 75 20 2a 70 20 3d  uct Submenu *p =
0c30: 20 26 61 53 75 62 6d 65 6e 75 5b 69 5d 3b 0a 20   &aSubmenu[i];. 
0c40: 20 20 20 20 20 63 68 61 72 20 2a 7a 54 61 69 6c       char *zTail
0c50: 20 3d 20 69 3c 6e 53 75 62 6d 65 6e 75 2d 31 20   = i<nSubmenu-1 
0c60: 3f 20 22 20 7c 20 22 20 3a 20 22 22 3b 0a 20 20  ? " | " : "";.  
0c70: 20 20 20 20 69 66 28 20 70 2d 3e 7a 4c 69 6e 6b      if( p->zLink
0c80: 3d 3d 30 20 29 7b 0a 20 20 20 20 20 20 20 20 40  ==0 ){.        @
0c90: 20 3c 66 6f 6e 74 20 63 6f 6c 6f 72 3d 22 23 38   <font color="#8
0ca0: 38 38 38 38 38 22 3e 25 68 28 70 2d 3e 7a 4c 61  88888">%h(p->zLa
0cb0: 62 65 6c 29 3c 2f 66 6f 6e 74 3e 20 25 73 28 7a  bel)</font> %s(z
0cc0: 54 61 69 6c 29 0a 20 20 20 20 20 20 7d 65 6c 73  Tail).      }els
0cd0: 65 7b 0a 20 20 20 20 20 20 20 20 40 20 3c 61 20  e{.        @ <a 
0ce0: 68 72 65 66 3d 22 25 54 28 70 2d 3e 7a 4c 69 6e  href="%T(p->zLin
0cf0: 6b 29 22 3e 25 68 28 70 2d 3e 7a 4c 61 62 65 6c  k)">%h(p->zLabel
0d00: 29 3c 2f 61 3e 20 25 73 28 7a 54 61 69 6c 29 0a  )</a> %s(zTail).
0d10: 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 20 20        }.    }.  
0d20: 7d 0a 20 20 40 20 3c 2f 74 64 3e 3c 2f 74 72 3e  }.  @ </td></tr>
0d30: 3c 2f 74 61 62 6c 65 3e 0a 20 20 40 20 3c 68 72  </table>.  @ <hr
0d40: 20 73 69 7a 65 3d 22 31 22 3e 0a 20 20 67 2e 63   size="1">.  g.c
0d50: 67 69 50 61 6e 69 63 20 3d 20 31 3b 0a 7d 0a 0a  giPanic = 1;.}..
0d60: 2f 2a 0a 2a 2a 20 44 72 61 77 20 74 68 65 20 66  /*.** Draw the f
0d70: 6f 6f 74 65 72 20 61 74 20 74 68 65 20 62 6f 74  ooter at the bot
0d80: 74 6f 6d 20 6f 66 20 74 68 65 20 70 61 67 65 2e  tom of the page.
0d90: 0a 2a 2f 0a 76 6f 69 64 20 73 74 79 6c 65 5f 66  .*/.void style_f
0da0: 6f 6f 74 65 72 28 76 6f 69 64 29 7b 0a 7d 0a 0a  ooter(void){.}..
0db0: 2f 2a 0a 2a 2a 20 57 45 42 50 41 47 45 3a 20 69  /*.** WEBPAGE: i
0dc0: 6e 64 65 78 0a 2a 2a 20 57 45 42 50 41 47 45 3a  ndex.** WEBPAGE:
0dd0: 20 68 6f 6d 65 0a 2a 2a 20 57 45 42 50 41 47 45   home.** WEBPAGE
0de0: 3a 20 6e 6f 74 5f 66 6f 75 6e 64 0a 2a 2f 0a 76  : not_found.*/.v
0df0: 6f 69 64 20 70 61 67 65 5f 69 6e 64 65 78 28 76  oid page_index(v
0e00: 6f 69 64 29 7b 0a 20 20 73 74 79 6c 65 5f 68 65  oid){.  style_he
0e10: 61 64 65 72 28 22 4d 61 69 6e 20 54 69 74 6c 65  ader("Main Title
0e20: 20 50 61 67 65 22 29 3b 0a 20 20 40 20 54 68 69   Page");.  @ Thi
0e30: 73 20 77 69 6c 6c 20 62 65 63 6f 6d 65 20 74 68  s will become th
0e40: 65 20 74 69 74 6c 65 20 70 61 67 65 0a 20 20 73  e title page.  s
0e50: 74 79 6c 65 5f 66 6f 6f 74 65 72 28 29 3b 0a 7d  tyle_footer();.}
0e60: 0a 0a 2f 2a 0a 2a 2a 20 57 45 42 50 41 47 45 3a  ../*.** WEBPAGE:
0e70: 20 74 65 73 74 5f 65 6e 76 0a 2a 2f 0a 76 6f 69   test_env.*/.voi
0e80: 64 20 70 61 67 65 5f 74 65 73 74 5f 65 6e 76 28  d page_test_env(
0e90: 76 6f 69 64 29 7b 0a 20 20 73 74 79 6c 65 5f 68  void){.  style_h
0ea0: 65 61 64 65 72 28 22 45 6e 76 69 72 6f 6e 6d 65  eader("Environme
0eb0: 6e 74 20 54 65 73 74 22 29 3b 0a 20 20 63 67 69  nt Test");.  cgi
0ec0: 5f 70 72 69 6e 74 5f 61 6c 6c 28 29 3b 0a 20 20  _print_all();.  
0ed0: 73 74 79 6c 65 5f 66 6f 6f 74 65 72 28 29 3b 0a  style_footer();.
0ee0: 7d 0a                                            }.