Artifact b4958eee41524b6e1b98f522ea311a68c9749251:
File
src/style.c
part of check-in
[916b6e4b3b]
- Improvements to web-based user management.
by
drh on
2007-07-21 19:32:06.
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 76 6f 69 64 29 7b 0a 20 20 63 eader(void){. c
07d0: 6f 6e 73 74 20 63 68 61 72 20 2a 7a 4c 6f 67 49 onst char *zLogI
07e0: 6e 4f 75 74 20 3d 20 22 4c 6f 67 6f 75 74 22 3b nOut = "Logout";
07f0: 0a 20 20 6c 6f 67 69 6e 5f 63 68 65 63 6b 5f 63 . login_check_c
0800: 72 65 64 65 6e 74 69 61 6c 73 28 29 3b 0a 20 20 redentials();.
0810: 40 20 3c 68 74 6d 6c 3e 0a 20 20 40 20 3c 62 6f @ <html>. @ <bo
0820: 64 79 20 62 67 63 6f 6c 6f 72 3d 22 77 68 69 74 dy bgcolor="whit
0830: 65 22 3e 0a 20 20 40 20 3c 68 72 20 73 69 7a 65 e">. @ <hr size
0840: 3d 22 31 22 3e 0a 20 20 40 20 3c 74 61 62 6c 65 ="1">. @ <table
0850: 20 62 6f 72 64 65 72 3d 22 30 22 20 63 65 6c 6c border="0" cell
0860: 70 61 64 64 69 6e 67 3d 22 30 22 20 63 65 6c 6c padding="0" cell
0870: 73 70 61 63 69 6e 67 3d 22 30 22 20 77 69 64 74 spacing="0" widt
0880: 68 3d 22 31 30 30 25 25 22 3e 0a 20 20 40 20 3c h="100%%">. @ <
0890: 74 72 3e 3c 74 64 20 76 61 6c 69 67 6e 3d 22 74 tr><td valign="t
08a0: 6f 70 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 op" align="left"
08b0: 3e 0a 20 20 40 20 3c 62 69 67 3e 3c 62 69 67 3e >. @ <big><big>
08c0: 3c 62 3e 46 6f 73 73 69 6c 20 53 43 4d 3c 2f 62 <b>Fossil SCM</b
08d0: 3e 3c 2f 62 69 67 3e 3c 2f 62 69 67 3e 3c 62 72 ></big></big><br
08e0: 3e 0a 20 20 69 66 28 20 67 2e 7a 4c 6f 67 69 6e >. if( g.zLogin
08f0: 3d 3d 30 20 7c 7c 20 67 2e 7a 4c 6f 67 69 6e 5b ==0 || g.zLogin[
0900: 30 5d 3d 3d 30 20 29 7b 0a 20 20 20 20 40 20 3c 0]==0 ){. @ <
0910: 73 6d 61 6c 6c 3e 6e 6f 74 20 6c 6f 67 67 65 64 small>not logged
0920: 20 69 6e 3c 2f 73 6d 61 6c 6c 3e 0a 20 20 20 20 in</small>.
0930: 7a 4c 6f 67 49 6e 4f 75 74 20 3d 20 22 4c 6f 67 zLogInOut = "Log
0940: 69 6e 22 3b 0a 20 20 7d 65 6c 73 65 7b 0a 20 20 in";. }else{.
0950: 20 20 40 20 3c 73 6d 61 6c 6c 3e 6c 6f 67 67 65 @ <small>logge
0960: 64 20 69 6e 20 61 73 20 25 68 28 67 2e 7a 4c 6f d in as %h(g.zLo
0970: 67 69 6e 29 3c 2f 73 6d 61 6c 6c 3e 0a 20 20 7d gin)</small>. }
0980: 0a 20 20 40 20 3c 2f 74 64 3e 3c 74 64 20 76 61 . @ </td><td va
0990: 6c 69 67 6e 3d 22 74 6f 70 22 20 61 6c 69 67 6e lign="top" align
09a0: 3d 22 72 69 67 68 74 22 3e 0a 20 20 40 20 3c 61 ="right">. @ <a
09b0: 20 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 href="%s(g.zBas
09c0: 65 55 52 4c 29 2f 69 6e 64 65 78 22 3e 48 6f 6d eURL)/index">Hom
09d0: 65 3c 2f 61 3e 0a 20 20 40 20 7c 20 3c 61 20 68 e</a>. @ | <a h
09e0: 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 ref="%s(g.zBaseU
09f0: 52 4c 29 2f 74 69 6d 65 6c 69 6e 65 22 3e 54 69 RL)/timeline">Ti
0a00: 6d 65 6c 69 6e 65 3c 2f 61 3e 0a 20 20 40 20 7c meline</a>. @ |
0a10: 20 3c 66 6f 6e 74 20 63 6f 6c 6f 72 3d 22 23 38 <font color="#8
0a20: 38 38 38 38 38 22 3e 53 65 61 72 63 68 3c 2f 66 88888">Search</f
0a30: 6f 6e 74 3e 0a 20 20 40 20 7c 20 3c 66 6f 6e 74 ont>. @ | <font
0a40: 20 63 6f 6c 6f 72 3d 22 23 38 38 38 38 38 38 22 color="#888888"
0a50: 3e 54 69 63 6b 65 74 3c 2f 66 6f 6e 74 3e 0a 20 >Ticket</font>.
0a60: 20 40 20 7c 20 3c 66 6f 6e 74 20 63 6f 6c 6f 72 @ | <font color
0a70: 3d 22 23 38 38 38 38 38 38 22 3e 52 65 70 6f 72 ="#888888">Repor
0a80: 74 73 3c 2f 66 6f 6e 74 3e 0a 20 20 69 66 28 20 ts</font>. if(
0a90: 67 2e 6f 6b 53 65 74 75 70 20 29 7b 0a 20 20 20 g.okSetup ){.
0aa0: 20 40 20 7c 20 3c 61 20 68 72 65 66 3d 22 25 73 @ | <a href="%s
0ab0: 28 67 2e 7a 42 61 73 65 55 52 4c 29 2f 73 65 74 (g.zBaseURL)/set
0ac0: 75 70 22 3e 53 65 74 75 70 3c 2f 61 3e 0a 20 20 up">Setup</a>.
0ad0: 7d 0a 20 20 69 66 28 20 21 67 2e 6e 6f 50 73 77 }. if( !g.noPsw
0ae0: 64 20 29 7b 0a 20 20 20 20 40 20 7c 20 3c 61 20 d ){. @ | <a
0af0: 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 65 href="%s(g.zBase
0b00: 55 52 4c 29 2f 6c 6f 67 69 6e 22 3e 25 73 28 7a URL)/login">%s(z
0b10: 4c 6f 67 49 6e 4f 75 74 29 3c 2f 61 3e 0a 20 20 LogInOut)</a>.
0b20: 7d 0a 20 20 69 66 28 20 6e 53 75 62 6d 65 6e 75 }. if( nSubmenu
0b30: 3e 30 20 29 7b 0a 20 20 20 20 69 6e 74 20 69 3b >0 ){. int i;
0b40: 0a 20 20 20 20 40 20 3c 62 72 3e 0a 20 20 20 20 . @ <br>.
0b50: 71 73 6f 72 74 28 61 53 75 62 6d 65 6e 75 2c 20 qsort(aSubmenu,
0b60: 6e 53 75 62 6d 65 6e 75 2c 20 73 69 7a 65 6f 66 nSubmenu, sizeof
0b70: 28 61 53 75 62 6d 65 6e 75 5b 30 5d 29 2c 20 73 (aSubmenu[0]), s
0b80: 75 62 6d 65 6e 75 43 6f 6d 70 61 72 65 29 3b 0a ubmenuCompare);.
0b90: 20 20 20 20 66 6f 72 28 69 3d 30 3b 20 69 3c 6e for(i=0; i<n
0ba0: 53 75 62 6d 65 6e 75 3b 20 69 2b 2b 29 7b 0a 20 Submenu; i++){.
0bb0: 20 20 20 20 20 73 74 72 75 63 74 20 53 75 62 6d struct Subm
0bc0: 65 6e 75 20 2a 70 20 3d 20 26 61 53 75 62 6d 65 enu *p = &aSubme
0bd0: 6e 75 5b 69 5d 3b 0a 20 20 20 20 20 20 63 68 61 nu[i];. cha
0be0: 72 20 2a 7a 54 61 69 6c 20 3d 20 69 3c 6e 53 75 r *zTail = i<nSu
0bf0: 62 6d 65 6e 75 2d 31 20 3f 20 22 20 7c 20 22 20 bmenu-1 ? " | "
0c00: 3a 20 22 22 3b 0a 20 20 20 20 20 20 69 66 28 20 : "";. if(
0c10: 70 2d 3e 7a 4c 69 6e 6b 3d 3d 30 20 29 7b 0a 20 p->zLink==0 ){.
0c20: 20 20 20 20 20 20 20 40 20 3c 66 6f 6e 74 20 63 @ <font c
0c30: 6f 6c 6f 72 3d 22 23 38 38 38 38 38 38 22 3e 25 olor="#888888">%
0c40: 68 28 70 2d 3e 7a 4c 61 62 65 6c 29 3c 2f 66 6f h(p->zLabel)</fo
0c50: 6e 74 3e 20 25 73 28 7a 54 61 69 6c 29 0a 20 20 nt> %s(zTail).
0c60: 20 20 20 20 7d 65 6c 73 65 7b 0a 20 20 20 20 20 }else{.
0c70: 20 20 20 40 20 3c 61 20 68 72 65 66 3d 22 25 54 @ <a href="%T
0c80: 28 70 2d 3e 7a 4c 69 6e 6b 29 22 3e 25 68 28 70 (p->zLink)">%h(p
0c90: 2d 3e 7a 4c 61 62 65 6c 29 3c 2f 61 3e 20 25 73 ->zLabel)</a> %s
0ca0: 28 7a 54 61 69 6c 29 0a 20 20 20 20 20 20 7d 0a (zTail). }.
0cb0: 20 20 20 20 7d 0a 20 20 7d 0a 20 20 40 20 3c 2f }. }. @ </
0cc0: 74 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e td></tr></table>
0cd0: 0a 20 20 40 20 3c 68 72 20 73 69 7a 65 3d 22 31 . @ <hr size="1
0ce0: 22 3e 0a 20 20 67 2e 63 67 69 50 61 6e 69 63 20 ">. g.cgiPanic
0cf0: 3d 20 31 3b 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 44 72 = 1;.}../*.** Dr
0d00: 61 77 20 74 68 65 20 66 6f 6f 74 65 72 20 61 74 aw the footer at
0d10: 20 74 68 65 20 62 6f 74 74 6f 6d 20 6f 66 20 74 the bottom of t
0d20: 68 65 20 70 61 67 65 2e 0a 2a 2f 0a 76 6f 69 64 he page..*/.void
0d30: 20 73 74 79 6c 65 5f 66 6f 6f 74 65 72 28 76 6f style_footer(vo
0d40: 69 64 29 7b 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 57 45 id){.}../*.** WE
0d50: 42 50 41 47 45 3a 20 69 6e 64 65 78 0a 2a 2a 20 BPAGE: index.**
0d60: 57 45 42 50 41 47 45 3a 20 68 6f 6d 65 0a 2a 2a WEBPAGE: home.**
0d70: 20 57 45 42 50 41 47 45 3a 20 6e 6f 74 5f 66 6f WEBPAGE: not_fo
0d80: 75 6e 64 0a 2a 2f 0a 76 6f 69 64 20 70 61 67 65 und.*/.void page
0d90: 5f 69 6e 64 65 78 28 76 6f 69 64 29 7b 0a 20 20 _index(void){.
0da0: 73 74 79 6c 65 5f 68 65 61 64 65 72 28 29 3b 0a style_header();.
0db0: 20 20 40 20 54 68 69 73 20 77 69 6c 6c 20 62 65 @ This will be
0dc0: 63 6f 6d 65 20 74 68 65 20 74 69 74 6c 65 20 70 come the title p
0dd0: 61 67 65 0a 20 20 73 74 79 6c 65 5f 66 6f 6f 74 age. style_foot
0de0: 65 72 28 29 3b 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 57 er();.}../*.** W
0df0: 45 42 50 41 47 45 3a 20 74 65 73 74 5f 65 6e 76 EBPAGE: test_env
0e00: 0a 2a 2f 0a 76 6f 69 64 20 70 61 67 65 5f 74 65 .*/.void page_te
0e10: 73 74 5f 65 6e 76 28 76 6f 69 64 29 7b 0a 20 20 st_env(void){.
0e20: 73 74 79 6c 65 5f 68 65 61 64 65 72 28 29 3b 0a style_header();.
0e30: 20 20 63 67 69 5f 70 72 69 6e 74 5f 61 6c 6c 28 cgi_print_all(
0e40: 29 3b 0a 20 20 73 74 79 6c 65 5f 66 6f 6f 74 65 );. style_foote
0e50: 72 28 29 3b 0a 7d 0a r();.}.