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
|
** skin then that will update the display cookie. If the skin name is
** illegal it is silently ignored.
**
** 3) Skin properties from the CONFIG db table
**
** 4) Default skin.
**
** As a special case, the name "_repo" resets zAltSkinDir and
** pAltSkin to 0 to indicate that the current config-side skin should
** be used (rank 3, above), then returns 0.
*/
char *skin_use_alternative(const char *zName, int rank){
static int currentRank = 5;
int i;
Blob err = BLOB_INITIALIZER;
if(rank > currentRank) return 0;
if( 1==rank && strchr(zName, '/')!=0 ){
zAltSkinDir = fossil_strdup(zName);
return 0;
}
if( sqlite3_strglob("draft[1-9]", zName)==0 ){
skin_use_draft(zName[5] - '0');
return 0;
}
if(zName && 0==strcmp("_repo",zName)){
pAltSkin = 0;
zAltSkinDir = 0;
return 0;
}
for(i=0; i<count(aBuiltinSkin); i++){
if( fossil_strcmp(aBuiltinSkin[i].zLabel, zName)==0 ){
pAltSkin = &aBuiltinSkin[i];
|
|
|
|
|
|
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
|
** skin then that will update the display cookie. If the skin name is
** illegal it is silently ignored.
**
** 3) Skin properties from the CONFIG db table
**
** 4) Default skin.
**
** As a special case, a NULL or empty name resets zAltSkinDir and
** pAltSkin to 0 to indicate that the current config-side skin should
** be used (rank 3, above), then returns 0.
*/
char *skin_use_alternative(const char *zName, int rank){
static int currentRank = 5;
int i;
Blob err = BLOB_INITIALIZER;
if(rank > currentRank) return 0;
if( zName && 1==rank && strchr(zName, '/')!=0 ){
zAltSkinDir = fossil_strdup(zName);
return 0;
}
if( zName && sqlite3_strglob("draft[1-9]", zName)==0 ){
skin_use_draft(zName[5] - '0');
return 0;
}
if(!zName || !*zName){
pAltSkin = 0;
zAltSkinDir = 0;
return 0;
}
for(i=0; i<count(aBuiltinSkin); i++){
if( fossil_strcmp(aBuiltinSkin[i].zLabel, zName)==0 ){
pAltSkin = &aBuiltinSkin[i];
|
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
|
@ </p>
}
@ <p>The following skins are available for this repository:</p>
@ <ul>
if( pAltSkin==0 && zAltSkinDir==0 && iDraftSkin==0 ){
@ <li> Standard skin for this repository ← <i>Currently in use</i>
}else{
@ <li> %z(href("%R/skins?skin=_repo"))Standard skin for this repository</a>
}
for(i=0; i<count(aBuiltinSkin); i++){
if( pAltSkin==&aBuiltinSkin[i] ){
@ <li> %h(aBuiltinSkin[i].zDesc) ← <i>Currently in use</i>
}else{
char *zUrl = href("%R/skins?skin=%T", aBuiltinSkin[i].zLabel);
@ <li> %z(zUrl)%h(aBuiltinSkin[i].zDesc)</a>
}
}
@ </ul>
style_finish_page();
fossil_free(zBase);
}
|
|
|
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
|
@ </p>
}
@ <p>The following skins are available for this repository:</p>
@ <ul>
if( pAltSkin==0 && zAltSkinDir==0 && iDraftSkin==0 ){
@ <li> Standard skin for this repository ← <i>Currently in use</i>
}else{
@ <li> %z(href("%R/skins?skin="))Standard skin for this repository</a>
}
for(i=0; i<count(aBuiltinSkin); i++){
if( pAltSkin==&aBuiltinSkin[i] ){
@ <li> %h(aBuiltinSkin[i].zDesc) ← <i>Currently in use</i>
}else{
char *zUrl = href("%R/skins?skin=%T", aBuiltinSkin[i].zLabel);
@ <li> %z(zUrl)%h(aBuiltinSkin[i].zDesc)</a>
}
}
@ </ul>
style_finish_page();
fossil_free(zBase);
}
|