Fossil SCM

Add the ability to edit the forum-statuses setting to the /setup_forum page.

drh 2026-10-19 09:01 UTC trunk
Commit bcf094c3d7b1200c9a2b9a746a1c743fd9d4674567b7b734795670cbd12a1944
1 file changed +15
+15
--- src/forum.c
+++ src/forum.c
@@ -2332,10 +2332,11 @@
23322332
void forum_setup(void){
23332333
/* boolean config settings specific to the forum. */
23342334
static const char *azForumSettings[] = {
23352335
"forum-close-policy",
23362336
"forum-title",
2337
+ "forum-statuses",
23372338
};
23382339
23392340
login_check_credentials();
23402341
if( !g.perm.Setup ){
23412342
login_needed(g.anon.Setup);
@@ -2432,10 +2433,24 @@
24322433
/* Boolean setting */
24332434
@ <tr><td align="right">
24342435
@ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>:
24352436
@ </td><td>
24362437
onoff_attribute("", zQP, pSetting->name/*works-like:"x"*/, 0, 0);
2438
+ @ </td></tr>
2439
+ }else if( pSetting->forceTextArea ){
2440
+ /* Multi-line text value setting */
2441
+ @ <tr><td align="right" valign="top">
2442
+ @ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>:
2443
+ @ </td><td>
2444
+ textarea_attribute("", 6, 60, pSetting->name, zQP/*works-like:""*/,
2445
+ pSetting->def, 0);
2446
+ if( fossil_strcmp(pSetting->name,"forum-statuses")==0
2447
+ && db_int(0, "SELECT value<>'' AND NOT json_valid(value,0x02)"
2448
+ " FROM config WHERE name='forum-statuses'") ){
2449
+ @ <br><span class='error'>Warning: this value is not \
2450
+ @ well-formed JSON5 and will be ignored.</span>
2451
+ }
24372452
@ </td></tr>
24382453
}else{
24392454
/* Text value setting */
24402455
@ <tr><td align="right">
24412456
@ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>:
24422457
--- src/forum.c
+++ src/forum.c
@@ -2332,10 +2332,11 @@
2332 void forum_setup(void){
2333 /* boolean config settings specific to the forum. */
2334 static const char *azForumSettings[] = {
2335 "forum-close-policy",
2336 "forum-title",
 
2337 };
2338
2339 login_check_credentials();
2340 if( !g.perm.Setup ){
2341 login_needed(g.anon.Setup);
@@ -2432,10 +2433,24 @@
2432 /* Boolean setting */
2433 @ <tr><td align="right">
2434 @ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>:
2435 @ </td><td>
2436 onoff_attribute("", zQP, pSetting->name/*works-like:"x"*/, 0, 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2437 @ </td></tr>
2438 }else{
2439 /* Text value setting */
2440 @ <tr><td align="right">
2441 @ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>:
2442
--- src/forum.c
+++ src/forum.c
@@ -2332,10 +2332,11 @@
2332 void forum_setup(void){
2333 /* boolean config settings specific to the forum. */
2334 static const char *azForumSettings[] = {
2335 "forum-close-policy",
2336 "forum-title",
2337 "forum-statuses",
2338 };
2339
2340 login_check_credentials();
2341 if( !g.perm.Setup ){
2342 login_needed(g.anon.Setup);
@@ -2432,10 +2433,24 @@
2433 /* Boolean setting */
2434 @ <tr><td align="right">
2435 @ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>:
2436 @ </td><td>
2437 onoff_attribute("", zQP, pSetting->name/*works-like:"x"*/, 0, 0);
2438 @ </td></tr>
2439 }else if( pSetting->forceTextArea ){
2440 /* Multi-line text value setting */
2441 @ <tr><td align="right" valign="top">
2442 @ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>:
2443 @ </td><td>
2444 textarea_attribute("", 6, 60, pSetting->name, zQP/*works-like:""*/,
2445 pSetting->def, 0);
2446 if( fossil_strcmp(pSetting->name,"forum-statuses")==0
2447 && db_int(0, "SELECT value<>'' AND NOT json_valid(value,0x02)"
2448 " FROM config WHERE name='forum-statuses'") ){
2449 @ <br><span class='error'>Warning: this value is not \
2450 @ well-formed JSON5 and will be ignored.</span>
2451 }
2452 @ </td></tr>
2453 }else{
2454 /* Text value setting */
2455 @ <tr><td align="right">
2456 @ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>:
2457

Keyboard Shortcuts

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