Artifact ad3eb27655bc349a1bb387c7aae557fbd917ffeb:
File
src/style.c
part of check-in
[5ebcedc33e]
- Require read permission (permission to read tickets and configuration histories) to view the global timeline.
by
dan on
2007-07-31 16:34:09.
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 69 66 28 20 67 2e 6f 6b 52 64 /a>. if( g.okRd
09f0: 54 6b 74 20 29 7b 0a 20 20 20 20 40 20 7c 20 3c Tkt ){. @ | <
0a00: 61 20 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 a href="%s(g.zBa
0a10: 73 65 55 52 4c 29 2f 74 69 6d 65 6c 69 6e 65 22 seURL)/timeline"
0a20: 3e 54 69 6d 65 6c 69 6e 65 3c 2f 61 3e 0a 20 20 >Timeline</a>.
0a30: 7d 0a 20 20 69 66 28 20 67 2e 6f 6b 52 64 57 69 }. if( g.okRdWi
0a40: 6b 69 20 29 7b 0a 20 20 20 20 40 20 7c 20 3c 61 ki ){. @ | <a
0a50: 20 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 href="%s(g.zBas
0a60: 65 55 52 4c 29 2f 77 69 6b 69 22 3e 57 69 6b 69 eURL)/wiki">Wiki
0a70: 3c 2f 61 3e 0a 20 20 7d 0a 23 69 66 20 30 0a 20 </a>. }.#if 0.
0a80: 20 40 20 7c 20 3c 66 6f 6e 74 20 63 6f 6c 6f 72 @ | <font color
0a90: 3d 22 23 38 38 38 38 38 38 22 3e 53 65 61 72 63 ="#888888">Searc
0aa0: 68 3c 2f 66 6f 6e 74 3e 0a 20 20 40 20 7c 20 3c h</font>. @ | <
0ab0: 66 6f 6e 74 20 63 6f 6c 6f 72 3d 22 23 38 38 38 font color="#888
0ac0: 38 38 38 22 3e 54 69 63 6b 65 74 3c 2f 66 6f 6e 888">Ticket</fon
0ad0: 74 3e 0a 20 20 40 20 7c 20 3c 66 6f 6e 74 20 63 t>. @ | <font c
0ae0: 6f 6c 6f 72 3d 22 23 38 38 38 38 38 38 22 3e 52 olor="#888888">R
0af0: 65 70 6f 72 74 73 3c 2f 66 6f 6e 74 3e 0a 23 65 eports</font>.#e
0b00: 6e 64 69 66 0a 20 20 69 66 28 20 67 2e 6f 6b 53 ndif. if( g.okS
0b10: 65 74 75 70 20 29 7b 0a 20 20 20 20 40 20 7c 20 etup ){. @ |
0b20: 3c 61 20 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 <a href="%s(g.zB
0b30: 61 73 65 55 52 4c 29 2f 73 65 74 75 70 22 3e 53 aseURL)/setup">S
0b40: 65 74 75 70 3c 2f 61 3e 0a 20 20 7d 0a 20 20 69 etup</a>. }. i
0b50: 66 28 20 21 67 2e 6e 6f 50 73 77 64 20 29 7b 0a f( !g.noPswd ){.
0b60: 20 20 20 20 40 20 7c 20 3c 61 20 68 72 65 66 3d @ | <a href=
0b70: 22 25 73 28 67 2e 7a 42 61 73 65 55 52 4c 29 2f "%s(g.zBaseURL)/
0b80: 6c 6f 67 69 6e 22 3e 25 73 28 7a 4c 6f 67 49 6e login">%s(zLogIn
0b90: 4f 75 74 29 3c 2f 61 3e 0a 20 20 7d 0a 20 20 69 Out)</a>. }. i
0ba0: 66 28 20 6e 53 75 62 6d 65 6e 75 3e 30 20 29 7b f( nSubmenu>0 ){
0bb0: 0a 20 20 20 20 69 6e 74 20 69 3b 0a 20 20 20 20 . int i;.
0bc0: 40 20 3c 62 72 3e 0a 20 20 20 20 71 73 6f 72 74 @ <br>. qsort
0bd0: 28 61 53 75 62 6d 65 6e 75 2c 20 6e 53 75 62 6d (aSubmenu, nSubm
0be0: 65 6e 75 2c 20 73 69 7a 65 6f 66 28 61 53 75 62 enu, sizeof(aSub
0bf0: 6d 65 6e 75 5b 30 5d 29 2c 20 73 75 62 6d 65 6e menu[0]), submen
0c00: 75 43 6f 6d 70 61 72 65 29 3b 0a 20 20 20 20 66 uCompare);. f
0c10: 6f 72 28 69 3d 30 3b 20 69 3c 6e 53 75 62 6d 65 or(i=0; i<nSubme
0c20: 6e 75 3b 20 69 2b 2b 29 7b 0a 20 20 20 20 20 20 nu; i++){.
0c30: 73 74 72 75 63 74 20 53 75 62 6d 65 6e 75 20 2a struct Submenu *
0c40: 70 20 3d 20 26 61 53 75 62 6d 65 6e 75 5b 69 5d p = &aSubmenu[i]
0c50: 3b 0a 20 20 20 20 20 20 63 68 61 72 20 2a 7a 54 ;. char *zT
0c60: 61 69 6c 20 3d 20 69 3c 6e 53 75 62 6d 65 6e 75 ail = i<nSubmenu
0c70: 2d 31 20 3f 20 22 20 7c 20 22 20 3a 20 22 22 3b -1 ? " | " : "";
0c80: 0a 20 20 20 20 20 20 69 66 28 20 70 2d 3e 7a 4c . if( p->zL
0c90: 69 6e 6b 3d 3d 30 20 29 7b 0a 20 20 20 20 20 20 ink==0 ){.
0ca0: 20 20 40 20 3c 66 6f 6e 74 20 63 6f 6c 6f 72 3d @ <font color=
0cb0: 22 23 38 38 38 38 38 38 22 3e 25 68 28 70 2d 3e "#888888">%h(p->
0cc0: 7a 4c 61 62 65 6c 29 3c 2f 66 6f 6e 74 3e 20 25 zLabel)</font> %
0cd0: 73 28 7a 54 61 69 6c 29 0a 20 20 20 20 20 20 7d s(zTail). }
0ce0: 65 6c 73 65 7b 0a 20 20 20 20 20 20 20 20 40 20 else{. @
0cf0: 3c 61 20 68 72 65 66 3d 22 25 54 28 70 2d 3e 7a <a href="%T(p->z
0d00: 4c 69 6e 6b 29 22 3e 25 68 28 70 2d 3e 7a 4c 61 Link)">%h(p->zLa
0d10: 62 65 6c 29 3c 2f 61 3e 20 25 73 28 7a 54 61 69 bel)</a> %s(zTai
0d20: 6c 29 0a 20 20 20 20 20 20 7d 0a 20 20 20 20 7d l). }. }
0d30: 0a 20 20 7d 0a 20 20 40 20 3c 2f 74 64 3e 3c 2f . }. @ </td></
0d40: 74 72 3e 3c 2f 74 61 62 6c 65 3e 0a 20 20 40 20 tr></table>. @
0d50: 3c 68 72 20 73 69 7a 65 3d 22 31 22 3e 0a 20 20 <hr size="1">.
0d60: 67 2e 63 67 69 50 61 6e 69 63 20 3d 20 31 3b 0a g.cgiPanic = 1;.
0d70: 7d 0a 0a 2f 2a 0a 2a 2a 20 44 72 61 77 20 74 68 }../*.** Draw th
0d80: 65 20 66 6f 6f 74 65 72 20 61 74 20 74 68 65 20 e footer at the
0d90: 62 6f 74 74 6f 6d 20 6f 66 20 74 68 65 20 70 61 bottom of the pa
0da0: 67 65 2e 0a 2a 2f 0a 76 6f 69 64 20 73 74 79 6c ge..*/.void styl
0db0: 65 5f 66 6f 6f 74 65 72 28 76 6f 69 64 29 7b 0a e_footer(void){.
0dc0: 7d 0a 0a 2f 2a 0a 2a 2a 20 57 45 42 50 41 47 45 }../*.** WEBPAGE
0dd0: 3a 20 69 6e 64 65 78 0a 2a 2a 20 57 45 42 50 41 : index.** WEBPA
0de0: 47 45 3a 20 68 6f 6d 65 0a 2a 2a 20 57 45 42 50 GE: home.** WEBP
0df0: 41 47 45 3a 20 6e 6f 74 5f 66 6f 75 6e 64 0a 2a AGE: not_found.*
0e00: 2f 0a 76 6f 69 64 20 70 61 67 65 5f 69 6e 64 65 /.void page_inde
0e10: 78 28 76 6f 69 64 29 7b 0a 20 20 73 74 79 6c 65 x(void){. style
0e20: 5f 68 65 61 64 65 72 28 22 4d 61 69 6e 20 54 69 _header("Main Ti
0e30: 74 6c 65 20 50 61 67 65 22 29 3b 0a 20 20 40 20 tle Page");. @
0e40: 54 68 69 73 20 77 69 6c 6c 20 62 65 63 6f 6d 65 This will become
0e50: 20 74 68 65 20 74 69 74 6c 65 20 70 61 67 65 0a the title page.
0e60: 20 20 73 74 79 6c 65 5f 66 6f 6f 74 65 72 28 29 style_footer()
0e70: 3b 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 57 45 42 50 41 ;.}../*.** WEBPA
0e80: 47 45 3a 20 74 65 73 74 5f 65 6e 76 0a 2a 2f 0a GE: test_env.*/.
0e90: 76 6f 69 64 20 70 61 67 65 5f 74 65 73 74 5f 65 void page_test_e
0ea0: 6e 76 28 76 6f 69 64 29 7b 0a 20 20 73 74 79 6c nv(void){. styl
0eb0: 65 5f 68 65 61 64 65 72 28 22 45 6e 76 69 72 6f e_header("Enviro
0ec0: 6e 6d 65 6e 74 20 54 65 73 74 22 29 3b 0a 20 20 nment Test");.
0ed0: 63 67 69 5f 70 72 69 6e 74 5f 61 6c 6c 28 29 3b cgi_print_all();
0ee0: 0a 20 20 73 74 79 6c 65 5f 66 6f 6f 74 65 72 28 . style_footer(
0ef0: 29 3b 0a 7d 0a );.}.