Artifact 7b2fdcfed55fadf4e9b1a8f0b190accf6952a40f:
File
src/style.c
part of check-in
[66f4caa379]
- Improvements to the WWW interface.
by
drh on
2007-07-23 19:52:51.
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 7c 7c 20 67 2e 7a 4c 6f 67 69 6e 5b 30 5d 0 || g.zLogin[0]
0910: 3d 3d 30 20 29 7b 0a 20 20 20 20 40 20 3c 73 6d ==0 ){. @ <sm
0920: 61 6c 6c 3e 6e 6f 74 20 6c 6f 67 67 65 64 20 69 all>not logged i
0930: 6e 3c 2f 73 6d 61 6c 6c 3e 0a 20 20 20 20 7a 4c n</small>. zL
0940: 6f 67 49 6e 4f 75 74 20 3d 20 22 4c 6f 67 69 6e ogInOut = "Login
0950: 22 3b 0a 20 20 7d 65 6c 73 65 7b 0a 20 20 20 20 ";. }else{.
0960: 40 20 3c 73 6d 61 6c 6c 3e 6c 6f 67 67 65 64 20 @ <small>logged
0970: 69 6e 20 61 73 20 25 68 28 67 2e 7a 4c 6f 67 69 in as %h(g.zLogi
0980: 6e 29 3c 2f 73 6d 61 6c 6c 3e 0a 20 20 7d 0a 20 n)</small>. }.
0990: 20 40 20 3c 2f 74 64 3e 3c 74 64 20 76 61 6c 69 @ </td><td vali
09a0: 67 6e 3d 22 74 6f 70 22 20 61 6c 69 67 6e 3d 22 gn="top" align="
09b0: 72 69 67 68 74 22 3e 0a 20 20 40 20 3c 61 20 68 right">. @ <a h
09c0: 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 ref="%s(g.zBaseU
09d0: 52 4c 29 2f 69 6e 64 65 78 22 3e 48 6f 6d 65 3c RL)/index">Home<
09e0: 2f 61 3e 0a 20 20 40 20 7c 20 3c 61 20 68 72 65 /a>. @ | <a hre
09f0: 66 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 52 4c f="%s(g.zBaseURL
0a00: 29 2f 74 69 6d 65 6c 69 6e 65 22 3e 54 69 6d 65 )/timeline">Time
0a10: 6c 69 6e 65 3c 2f 61 3e 0a 20 20 69 66 28 20 67 line</a>. if( g
0a20: 2e 6f 6b 52 64 57 69 6b 69 20 29 7b 0a 20 20 20 .okRdWiki ){.
0a30: 20 40 20 7c 20 3c 61 20 68 72 65 66 3d 22 25 73 @ | <a href="%s
0a40: 28 67 2e 7a 42 61 73 65 55 52 4c 29 2f 77 69 6b (g.zBaseURL)/wik
0a50: 69 22 3e 57 69 6b 69 3c 2f 61 3e 0a 20 20 7d 0a i">Wiki</a>. }.
0a60: 23 69 66 20 30 0a 20 20 40 20 7c 20 3c 66 6f 6e #if 0. @ | <fon
0a70: 74 20 63 6f 6c 6f 72 3d 22 23 38 38 38 38 38 38 t color="#888888
0a80: 22 3e 53 65 61 72 63 68 3c 2f 66 6f 6e 74 3e 0a ">Search</font>.
0a90: 20 20 40 20 7c 20 3c 66 6f 6e 74 20 63 6f 6c 6f @ | <font colo
0aa0: 72 3d 22 23 38 38 38 38 38 38 22 3e 54 69 63 6b r="#888888">Tick
0ab0: 65 74 3c 2f 66 6f 6e 74 3e 0a 20 20 40 20 7c 20 et</font>. @ |
0ac0: 3c 66 6f 6e 74 20 63 6f 6c 6f 72 3d 22 23 38 38 <font color="#88
0ad0: 38 38 38 38 22 3e 52 65 70 6f 72 74 73 3c 2f 66 8888">Reports</f
0ae0: 6f 6e 74 3e 0a 23 65 6e 64 69 66 0a 20 20 69 66 ont>.#endif. if
0af0: 28 20 67 2e 6f 6b 53 65 74 75 70 20 29 7b 0a 20 ( g.okSetup ){.
0b00: 20 20 20 40 20 7c 20 3c 61 20 68 72 65 66 3d 22 @ | <a href="
0b10: 25 73 28 67 2e 7a 42 61 73 65 55 52 4c 29 2f 73 %s(g.zBaseURL)/s
0b20: 65 74 75 70 22 3e 53 65 74 75 70 3c 2f 61 3e 0a etup">Setup</a>.
0b30: 20 20 7d 0a 20 20 69 66 28 20 21 67 2e 6e 6f 50 }. if( !g.noP
0b40: 73 77 64 20 29 7b 0a 20 20 20 20 40 20 7c 20 3c swd ){. @ | <
0b50: 61 20 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 a href="%s(g.zBa
0b60: 73 65 55 52 4c 29 2f 6c 6f 67 69 6e 22 3e 25 73 seURL)/login">%s
0b70: 28 7a 4c 6f 67 49 6e 4f 75 74 29 3c 2f 61 3e 0a (zLogInOut)</a>.
0b80: 20 20 7d 0a 20 20 69 66 28 20 6e 53 75 62 6d 65 }. if( nSubme
0b90: 6e 75 3e 30 20 29 7b 0a 20 20 20 20 69 6e 74 20 nu>0 ){. int
0ba0: 69 3b 0a 20 20 20 20 40 20 3c 62 72 3e 0a 20 20 i;. @ <br>.
0bb0: 20 20 71 73 6f 72 74 28 61 53 75 62 6d 65 6e 75 qsort(aSubmenu
0bc0: 2c 20 6e 53 75 62 6d 65 6e 75 2c 20 73 69 7a 65 , nSubmenu, size
0bd0: 6f 66 28 61 53 75 62 6d 65 6e 75 5b 30 5d 29 2c of(aSubmenu[0]),
0be0: 20 73 75 62 6d 65 6e 75 43 6f 6d 70 61 72 65 29 submenuCompare)
0bf0: 3b 0a 20 20 20 20 66 6f 72 28 69 3d 30 3b 20 69 ;. for(i=0; i
0c00: 3c 6e 53 75 62 6d 65 6e 75 3b 20 69 2b 2b 29 7b <nSubmenu; i++){
0c10: 0a 20 20 20 20 20 20 73 74 72 75 63 74 20 53 75 . struct Su
0c20: 62 6d 65 6e 75 20 2a 70 20 3d 20 26 61 53 75 62 bmenu *p = &aSub
0c30: 6d 65 6e 75 5b 69 5d 3b 0a 20 20 20 20 20 20 63 menu[i];. c
0c40: 68 61 72 20 2a 7a 54 61 69 6c 20 3d 20 69 3c 6e har *zTail = i<n
0c50: 53 75 62 6d 65 6e 75 2d 31 20 3f 20 22 20 7c 20 Submenu-1 ? " |
0c60: 22 20 3a 20 22 22 3b 0a 20 20 20 20 20 20 69 66 " : "";. if
0c70: 28 20 70 2d 3e 7a 4c 69 6e 6b 3d 3d 30 20 29 7b ( p->zLink==0 ){
0c80: 0a 20 20 20 20 20 20 20 20 40 20 3c 66 6f 6e 74 . @ <font
0c90: 20 63 6f 6c 6f 72 3d 22 23 38 38 38 38 38 38 22 color="#888888"
0ca0: 3e 25 68 28 70 2d 3e 7a 4c 61 62 65 6c 29 3c 2f >%h(p->zLabel)</
0cb0: 66 6f 6e 74 3e 20 25 73 28 7a 54 61 69 6c 29 0a font> %s(zTail).
0cc0: 20 20 20 20 20 20 7d 65 6c 73 65 7b 0a 20 20 20 }else{.
0cd0: 20 20 20 20 20 40 20 3c 61 20 68 72 65 66 3d 22 @ <a href="
0ce0: 25 54 28 70 2d 3e 7a 4c 69 6e 6b 29 22 3e 25 68 %T(p->zLink)">%h
0cf0: 28 70 2d 3e 7a 4c 61 62 65 6c 29 3c 2f 61 3e 20 (p->zLabel)</a>
0d00: 25 73 28 7a 54 61 69 6c 29 0a 20 20 20 20 20 20 %s(zTail).
0d10: 7d 0a 20 20 20 20 7d 0a 20 20 7d 0a 20 20 40 20 }. }. }. @
0d20: 3c 2f 74 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c </td></tr></tabl
0d30: 65 3e 0a 20 20 40 20 3c 68 72 20 73 69 7a 65 3d e>. @ <hr size=
0d40: 22 31 22 3e 0a 20 20 67 2e 63 67 69 50 61 6e 69 "1">. g.cgiPani
0d50: 63 20 3d 20 31 3b 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 c = 1;.}../*.**
0d60: 44 72 61 77 20 74 68 65 20 66 6f 6f 74 65 72 20 Draw the footer
0d70: 61 74 20 74 68 65 20 62 6f 74 74 6f 6d 20 6f 66 at the bottom of
0d80: 20 74 68 65 20 70 61 67 65 2e 0a 2a 2f 0a 76 6f the page..*/.vo
0d90: 69 64 20 73 74 79 6c 65 5f 66 6f 6f 74 65 72 28 id style_footer(
0da0: 76 6f 69 64 29 7b 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 void){.}../*.**
0db0: 57 45 42 50 41 47 45 3a 20 69 6e 64 65 78 0a 2a WEBPAGE: index.*
0dc0: 2a 20 57 45 42 50 41 47 45 3a 20 68 6f 6d 65 0a * WEBPAGE: home.
0dd0: 2a 2a 20 57 45 42 50 41 47 45 3a 20 6e 6f 74 5f ** WEBPAGE: not_
0de0: 66 6f 75 6e 64 0a 2a 2f 0a 76 6f 69 64 20 70 61 found.*/.void pa
0df0: 67 65 5f 69 6e 64 65 78 28 76 6f 69 64 29 7b 0a ge_index(void){.
0e00: 20 20 73 74 79 6c 65 5f 68 65 61 64 65 72 28 22 style_header("
0e10: 4d 61 69 6e 20 54 69 74 6c 65 20 50 61 67 65 22 Main Title Page"
0e20: 29 3b 0a 20 20 40 20 54 68 69 73 20 77 69 6c 6c );. @ This will
0e30: 20 62 65 63 6f 6d 65 20 74 68 65 20 74 69 74 6c become the titl
0e40: 65 20 70 61 67 65 0a 20 20 73 74 79 6c 65 5f 66 e page. style_f
0e50: 6f 6f 74 65 72 28 29 3b 0a 7d 0a 0a 2f 2a 0a 2a ooter();.}../*.*
0e60: 2a 20 57 45 42 50 41 47 45 3a 20 74 65 73 74 5f * WEBPAGE: test_
0e70: 65 6e 76 0a 2a 2f 0a 76 6f 69 64 20 70 61 67 65 env.*/.void page
0e80: 5f 74 65 73 74 5f 65 6e 76 28 76 6f 69 64 29 7b _test_env(void){
0e90: 0a 20 20 73 74 79 6c 65 5f 68 65 61 64 65 72 28 . style_header(
0ea0: 22 45 6e 76 69 72 6f 6e 6d 65 6e 74 20 54 65 73 "Environment Tes
0eb0: 74 22 29 3b 0a 20 20 63 67 69 5f 70 72 69 6e 74 t");. cgi_print
0ec0: 5f 61 6c 6c 28 29 3b 0a 20 20 73 74 79 6c 65 5f _all();. style_
0ed0: 66 6f 6f 74 65 72 28 29 3b 0a 7d 0a footer();.}.