80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
*/
void style_header(const char *zTitle){
const char *zLogInOut = "Login";
const char *zHeader = db_get("header", (char*)zDefaultHeader);
login_check_credentials();
if( pInterp ) return;
/* Generate the header up through the main menu */
pInterp = SbS_Create();
SbS_Store(pInterp, "project_name",
db_get("project-name","Unnamed Fossil Project"), 0);
SbS_Store(pInterp, "title", zTitle, 0);
SbS_Store(pInterp, "baseurl", g.zBaseURL, 0);
SbS_Store(pInterp, "manifest_version", MANIFEST_VERSION, 0);
SbS_Store(pInterp, "manifest_date", MANIFEST_DATE, 0);
if( g.zLogin ){
SbS_Store(pInterp, "login", g.zLogin, 0);
zLogInOut = "Logout";
}
SbS_Render(pInterp, zHeader);
/* Generate the main menu and the submenu (if any) */
@ <div class="mainmenu">
@ <a href="%s(g.zBaseURL)/home">Home</a>
if( g.okRead ){
@ <a href="%s(g.zBaseURL)/leaves">Leaves</a>
@ <a href="%s(g.zBaseURL)/timeline">Timeline</a>
@ <a href="%s(g.zBaseURL)/tagview">Tags</a>
}
|
>
|
|
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
*/
void style_header(const char *zTitle){
const char *zLogInOut = "Login";
const char *zHeader = db_get("header", (char*)zDefaultHeader);
login_check_credentials();
if( pInterp ) return;
cgi_destination(CGI_HEADER);
/* Generate the header up through the main menu */
pInterp = SbS_Create();
SbS_Store(pInterp, "project_name",
db_get("project-name","Unnamed Fossil Project"), 0);
SbS_Store(pInterp, "title", zTitle, 0);
SbS_Store(pInterp, "baseurl", g.zBaseURL, 0);
SbS_Store(pInterp, "manifest_version", MANIFEST_VERSION, 0);
SbS_Store(pInterp, "manifest_date", MANIFEST_DATE, 0);
if( g.zLogin ){
SbS_Store(pInterp, "login", g.zLogin, 0);
zLogInOut = "Logout";
}
SbS_Render(pInterp, zHeader);
/* Generate the main menu */
@ <div class="mainmenu">
@ <a href="%s(g.zBaseURL)/home">Home</a>
if( g.okRead ){
@ <a href="%s(g.zBaseURL)/leaves">Leaves</a>
@ <a href="%s(g.zBaseURL)/timeline">Timeline</a>
@ <a href="%s(g.zBaseURL)/tagview">Tags</a>
}
|
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
if( g.okSetup ){
@ <a href="%s(g.zBaseURL)/setup">Setup</a>
}
if( !g.noPswd ){
@ <a href="%s(g.zBaseURL)/login">%s(zLogInOut)</a>
}
@ </div>
if( nSubmenu>0 ){
int i;
@ <div class="submenu">
qsort(aSubmenu, nSubmenu, sizeof(aSubmenu[0]), submenuCompare);
for(i=0; i<nSubmenu; i++){
struct Submenu *p = &aSubmenu[i];
if( p->zLink==0 ){
@ <span class="label">%h(p->zLabel)</span>
}else{
@ <a class="label" href="%s(p->zLink)">%h(p->zLabel)</a>
}
}
@ </div>
}
@ <div class="content">
g.cgiPanic = 1;
}
/*
** Draw the footer at the bottom of the page.
*/
void style_footer(void){
const char *zFooter;
if( pInterp==0 ) return;
zFooter = db_get("footer", (char*)zDefaultFooter);
@ </div>
SbS_Render(pInterp, zFooter);
SbS_Destroy(pInterp);
pInterp = 0;
}
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
<
<
|
|
<
|
|
<
<
|
<
|
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
if( g.okSetup ){
@ <a href="%s(g.zBaseURL)/setup">Setup</a>
}
if( !g.noPswd ){
@ <a href="%s(g.zBaseURL)/login">%s(zLogInOut)</a>
}
@ </div>
cgi_destination(CGI_BODY);
g.cgiPanic = 1;
}
/*
** Draw the footer at the bottom of the page.
*/
void style_footer(void){
const char *zFooter;
if( pInterp==0 ) return;
/* Go back and put the submenu at the top of the page. We delay the
** creation of the submenu until the end so that we can add elements
** to the submenu while generating page text.
*/
if( nSubmenu>0 ){
int i;
cgi_destination(CGI_HEADER);
@ <div class="submenu">
qsort(aSubmenu, nSubmenu, sizeof(aSubmenu[0]), submenuCompare);
for(i=0; i<nSubmenu; i++){
struct Submenu *p = &aSubmenu[i];
if( p->zLink==0 ){
@ <span class="label">%h(p->zLabel)</span>
}else{
@ <a class="label" href="%s(p->zLink)">%h(p->zLabel)</a>
}
}
@ </div>
cgi_destination(CGI_BODY);
}
/* Put the footer at the bottom of the page.
*/
@ <div class="content">
zFooter = db_get("footer", (char*)zDefaultFooter);
@ </div>
SbS_Render(pInterp, zFooter);
SbS_Destroy(pInterp);
pInterp = 0;
}
|