Fossil SCM

Backout [5c5aa19cc5098ac2] - we want words for the menu items, not obscure unicode symbols. I'm not sure what that check-in was all about.

drh 2021-04-08 00:55 trunk
Commit 1a1c0ebe3cf992b82b65f839bf5bca19c1183be4390606987a7e44114d4ee25c
+4 -25
--- src/report.c
+++ src/report.c
@@ -972,18 +972,14 @@
972972
}
973973
974974
/*
975975
** WEBPAGE: rptview
976976
**
977
-** Generate a report. The "rn" query parameter is the report number
978
-** corresponding to REPORTFMT.RN. If the "tablist" query parameter exists,
977
+** Generate a report. The rn query parameter is the report number
978
+** corresponding to REPORTFMT.RN. If the tablist query parameter exists,
979979
** then the output consists of lines of tab-separated fields instead of
980
-** an HTML table. If the "rvsmpl" query parameter is set then report's
981
-** submenu will contain an extra hyperlink that have a value-driven
982
-** label and target.
983
-**
984
-** "rvsmpl" stands for Report View SubMenu's Parametric Link.
980
+** an HTML table.
985981
*/
986982
void rptview_page(void){
987983
int count = 0;
988984
int rn, rc;
989985
char *zSql;
@@ -1037,31 +1033,14 @@
10371033
}
10381034
10391035
count = 0;
10401036
if( !tabs ){
10411037
struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1042
- const char *zQS = PD("QUERY_STRING","");
10431038
10441039
db_multi_exec("PRAGMA empty_result_callbacks=ON");
10451040
style_set_current_feature("report");
1046
- /*
1047
- ** Lets use a funcy button for /reportlist since that page may be
1048
- ** heavily customized by the user. Some variants: ⊚ ⦾ ❊ ⊛ ⚛ ⸎ ð’’ 
1049
- ** Enclosing it inside of square brackets makes its position
1050
- ** determenistic and clearly distincts regular submenu links from
1051
- ** those that are induced by the query string parameters.
1052
- */
1053
- if( zQS[0] ){
1054
- style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS);
1055
- style_submenu_element("[⊚]","%R/reportlist?%s",zQS);
1056
- } else {
1057
- style_submenu_element("Raw","%R/%s?tablist=1",g.zPath);
1058
- style_submenu_element("[⊚]","%R/reportlist");
1059
- }
1060
- style_submenu_parametric("rptview_",5);
1061
- style_submenu_parametric("rv",5);
1062
-
1041
+ style_submenu_element("Raw", "rptview?tablist=1&rn=%d&%h", rn, PD("QUERY_STRING","") );
10631042
if( g.perm.Admin
10641043
|| (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
10651044
style_submenu_element("Edit", "rptedit?rn=%d", rn);
10661045
}
10671046
if( g.perm.TktFmt ){
10681047
--- src/report.c
+++ src/report.c
@@ -972,18 +972,14 @@
972 }
973
974 /*
975 ** WEBPAGE: rptview
976 **
977 ** Generate a report. The "rn" query parameter is the report number
978 ** corresponding to REPORTFMT.RN. If the "tablist" query parameter exists,
979 ** then the output consists of lines of tab-separated fields instead of
980 ** an HTML table. If the "rvsmpl" query parameter is set then report's
981 ** submenu will contain an extra hyperlink that have a value-driven
982 ** label and target.
983 **
984 ** "rvsmpl" stands for Report View SubMenu's Parametric Link.
985 */
986 void rptview_page(void){
987 int count = 0;
988 int rn, rc;
989 char *zSql;
@@ -1037,31 +1033,14 @@
1037 }
1038
1039 count = 0;
1040 if( !tabs ){
1041 struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1042 const char *zQS = PD("QUERY_STRING","");
1043
1044 db_multi_exec("PRAGMA empty_result_callbacks=ON");
1045 style_set_current_feature("report");
1046 /*
1047 ** Lets use a funcy button for /reportlist since that page may be
1048 ** heavily customized by the user. Some variants: ⊚ ⦾ ❊ ⊛ ⚛ ⸎ ð’’ 
1049 ** Enclosing it inside of square brackets makes its position
1050 ** determenistic and clearly distincts regular submenu links from
1051 ** those that are induced by the query string parameters.
1052 */
1053 if( zQS[0] ){
1054 style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS);
1055 style_submenu_element("[⊚]","%R/reportlist?%s",zQS);
1056 } else {
1057 style_submenu_element("Raw","%R/%s?tablist=1",g.zPath);
1058 style_submenu_element("[⊚]","%R/reportlist");
1059 }
1060 style_submenu_parametric("rptview_",5);
1061 style_submenu_parametric("rv",5);
1062
1063 if( g.perm.Admin
1064 || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
1065 style_submenu_element("Edit", "rptedit?rn=%d", rn);
1066 }
1067 if( g.perm.TktFmt ){
1068
--- src/report.c
+++ src/report.c
@@ -972,18 +972,14 @@
972 }
973
974 /*
975 ** WEBPAGE: rptview
976 **
977 ** Generate a report. The rn query parameter is the report number
978 ** corresponding to REPORTFMT.RN. If the tablist query parameter exists,
979 ** then the output consists of lines of tab-separated fields instead of
980 ** an HTML table.
 
 
 
 
981 */
982 void rptview_page(void){
983 int count = 0;
984 int rn, rc;
985 char *zSql;
@@ -1037,31 +1033,14 @@
1033 }
1034
1035 count = 0;
1036 if( !tabs ){
1037 struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
1038
1039 db_multi_exec("PRAGMA empty_result_callbacks=ON");
1040 style_set_current_feature("report");
1041 style_submenu_element("Raw", "rptview?tablist=1&rn=%d&%h", rn, PD("QUERY_STRING","") );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1042 if( g.perm.Admin
1043 || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
1044 style_submenu_element("Edit", "rptedit?rn=%d", rn);
1045 }
1046 if( g.perm.TktFmt ){
1047
-62
--- src/style.c
+++ src/style.c
@@ -330,72 +330,10 @@
330330
aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
331331
nSubmenuCtrl++;
332332
}
333333
}
334334
335
-/* Add hyperlinks depending on the existence and values of special
336
-** parameters in the request's query string. The names of these
337
-** parameters that are investigated are obtainted by concatenation
338
-** of zPrefix with suffix "smplX", where X is either nothing or
339
-** a positive digit <= nMaxDigit. zPrefix must start with a lowercase
340
-** letter, be short and have no strange characters. A value is
341
-** well-formed if its first filepath segment (separated by '/')
342
-** has no strange characters. The labels of the resulting submenu items
343
-** are equal to the well-formed values that are prepended by "✧"
344
-** unless a value starts with a lowercase letter.
345
-** Malformed values are silently ignored.
346
-*/
347
-void style_submenu_parametric(
348
- const char *zPrefix, /* common prefix of the query parameters names */
349
- const int nMaxDigit /* maximal digit on the end of param names */
350
-){
351
- const char *zQS; /* QUERY_STRING */
352
- const char *suffix = "smpl"; /* common suffix for all parameters */
353
- const short sfxlen = 4; /* length of the above suffix */
354
- char zN[32]; /* short names => no dynamic allocations */
355
- short i,l;
356
-
357
- /* zPrefix must be tidy and short; also filter out ENV/CGI variables */
358
- assert( zPrefix != 0 && fossil_islower(zPrefix[0]) );
359
- l = strnlen( zPrefix, sizeof(zN) );
360
- assert( l+sfxlen+2 <= sizeof(zN) );
361
- assert( fossil_no_strange_characters(zPrefix) );
362
- /* concatenate zPrefix and suffix */
363
- strcpy( zN, zPrefix );
364
- strcpy( zN + l, suffix );
365
- l += sfxlen;
366
- zN[l+1] = 0; /* nul-terminator after digit's placeholder (if any) */
367
- zQS = PD("QUERY_STRING","");
368
- for( i = 0; i <= 9 && i <= nMaxDigit; i++ ){
369
- const char *zV, *z;
370
- zN[l] = ( i == 0 ? 0 : '0' + i ); /* ...smpl instead of ...smpl0 */
371
- zV = PD(zN,"");
372
- if( zV[0] == 0 || zV[0] == '/' ){
373
- continue;
374
- }
375
- /* require the first path segment to be unfancy ASCII string */
376
- for( z = zV; z[0] && z[0] != '/' ;){
377
- if( fossil_isalnum(z[0]) || z[0]=='_' || z[0]=='-' ) z++;
378
- else break;
379
- }
380
- if( z[0] != 0 && z[0] != '/' )
381
- continue;
382
- assert( nSubmenu < count(aSubmenu) );
383
- if(fossil_islower(zV[0])){
384
- aSubmenu[nSubmenu].zLabel = mprintf( "%s",zV); /* memory leak? */
385
- }else{
386
- aSubmenu[nSubmenu].zLabel = mprintf("✧%s",zV); /* maybe: ◦✧⸰⸎ ✨ */
387
- }
388
- if( zQS[0] ){
389
- aSubmenu[nSubmenu].zLink = mprintf("%R/%s?%s",zV,zQS);
390
- }else{
391
- aSubmenu[nSubmenu].zLink = mprintf("%R/%s",zV);
392
- }
393
- nSubmenu++;
394
- }
395
-}
396
-
397335
/*
398336
** Disable or enable the submenu
399337
*/
400338
void style_submenu_enable(int onOff){
401339
submenuEnable = onOff;
402340
--- src/style.c
+++ src/style.c
@@ -330,72 +330,10 @@
330 aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
331 nSubmenuCtrl++;
332 }
333 }
334
335 /* Add hyperlinks depending on the existence and values of special
336 ** parameters in the request's query string. The names of these
337 ** parameters that are investigated are obtainted by concatenation
338 ** of zPrefix with suffix "smplX", where X is either nothing or
339 ** a positive digit <= nMaxDigit. zPrefix must start with a lowercase
340 ** letter, be short and have no strange characters. A value is
341 ** well-formed if its first filepath segment (separated by '/')
342 ** has no strange characters. The labels of the resulting submenu items
343 ** are equal to the well-formed values that are prepended by "✧"
344 ** unless a value starts with a lowercase letter.
345 ** Malformed values are silently ignored.
346 */
347 void style_submenu_parametric(
348 const char *zPrefix, /* common prefix of the query parameters names */
349 const int nMaxDigit /* maximal digit on the end of param names */
350 ){
351 const char *zQS; /* QUERY_STRING */
352 const char *suffix = "smpl"; /* common suffix for all parameters */
353 const short sfxlen = 4; /* length of the above suffix */
354 char zN[32]; /* short names => no dynamic allocations */
355 short i,l;
356
357 /* zPrefix must be tidy and short; also filter out ENV/CGI variables */
358 assert( zPrefix != 0 && fossil_islower(zPrefix[0]) );
359 l = strnlen( zPrefix, sizeof(zN) );
360 assert( l+sfxlen+2 <= sizeof(zN) );
361 assert( fossil_no_strange_characters(zPrefix) );
362 /* concatenate zPrefix and suffix */
363 strcpy( zN, zPrefix );
364 strcpy( zN + l, suffix );
365 l += sfxlen;
366 zN[l+1] = 0; /* nul-terminator after digit's placeholder (if any) */
367 zQS = PD("QUERY_STRING","");
368 for( i = 0; i <= 9 && i <= nMaxDigit; i++ ){
369 const char *zV, *z;
370 zN[l] = ( i == 0 ? 0 : '0' + i ); /* ...smpl instead of ...smpl0 */
371 zV = PD(zN,"");
372 if( zV[0] == 0 || zV[0] == '/' ){
373 continue;
374 }
375 /* require the first path segment to be unfancy ASCII string */
376 for( z = zV; z[0] && z[0] != '/' ;){
377 if( fossil_isalnum(z[0]) || z[0]=='_' || z[0]=='-' ) z++;
378 else break;
379 }
380 if( z[0] != 0 && z[0] != '/' )
381 continue;
382 assert( nSubmenu < count(aSubmenu) );
383 if(fossil_islower(zV[0])){
384 aSubmenu[nSubmenu].zLabel = mprintf( "%s",zV); /* memory leak? */
385 }else{
386 aSubmenu[nSubmenu].zLabel = mprintf("✧%s",zV); /* maybe: ◦✧⸰⸎ ✨ */
387 }
388 if( zQS[0] ){
389 aSubmenu[nSubmenu].zLink = mprintf("%R/%s?%s",zV,zQS);
390 }else{
391 aSubmenu[nSubmenu].zLink = mprintf("%R/%s",zV);
392 }
393 nSubmenu++;
394 }
395 }
396
397 /*
398 ** Disable or enable the submenu
399 */
400 void style_submenu_enable(int onOff){
401 submenuEnable = onOff;
402
--- src/style.c
+++ src/style.c
@@ -330,72 +330,10 @@
330 aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
331 nSubmenuCtrl++;
332 }
333 }
334
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335 /*
336 ** Disable or enable the submenu
337 */
338 void style_submenu_enable(int onOff){
339 submenuEnable = onOff;
340
-1
--- src/wiki.c
+++ src/wiki.c
@@ -593,11 +593,10 @@
593593
}else if( rid && g.perm.ApndWiki ){
594594
style_submenu_element("Edit", "%R/wikiappend?name=%T", zPageName);
595595
}
596596
if( g.perm.Hyperlink ){
597597
style_submenu_element("History", "%R/whistory?name=%T", zPageName);
598
- style_submenu_parametric("wiki",7);
599598
}
600599
}
601600
if( !isPopup ){
602601
style_set_current_page("%T?name=%T", g.zPath, zPageName);
603602
wiki_page_header(WIKITYPE_UNKNOWN, zPageName, "");
604603
--- src/wiki.c
+++ src/wiki.c
@@ -593,11 +593,10 @@
593 }else if( rid && g.perm.ApndWiki ){
594 style_submenu_element("Edit", "%R/wikiappend?name=%T", zPageName);
595 }
596 if( g.perm.Hyperlink ){
597 style_submenu_element("History", "%R/whistory?name=%T", zPageName);
598 style_submenu_parametric("wiki",7);
599 }
600 }
601 if( !isPopup ){
602 style_set_current_page("%T?name=%T", g.zPath, zPageName);
603 wiki_page_header(WIKITYPE_UNKNOWN, zPageName, "");
604
--- src/wiki.c
+++ src/wiki.c
@@ -593,11 +593,10 @@
593 }else if( rid && g.perm.ApndWiki ){
594 style_submenu_element("Edit", "%R/wikiappend?name=%T", zPageName);
595 }
596 if( g.perm.Hyperlink ){
597 style_submenu_element("History", "%R/whistory?name=%T", zPageName);
 
598 }
599 }
600 if( !isPopup ){
601 style_set_current_page("%T?name=%T", g.zPath, zPageName);
602 wiki_page_header(WIKITYPE_UNKNOWN, zPageName, "");
603

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button