Fossil SCM
Add the ability to edit the forum-statuses setting to the /setup_forum page.
Commit
bcf094c3d7b1200c9a2b9a746a1c743fd9d4674567b7b734795670cbd12a1944
Parent
912711f044b83f4…
1 file changed
+15
+15
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -2332,10 +2332,11 @@ | ||
| 2332 | 2332 | void forum_setup(void){ |
| 2333 | 2333 | /* boolean config settings specific to the forum. */ |
| 2334 | 2334 | static const char *azForumSettings[] = { |
| 2335 | 2335 | "forum-close-policy", |
| 2336 | 2336 | "forum-title", |
| 2337 | + "forum-statuses", | |
| 2337 | 2338 | }; |
| 2338 | 2339 | |
| 2339 | 2340 | login_check_credentials(); |
| 2340 | 2341 | if( !g.perm.Setup ){ |
| 2341 | 2342 | login_needed(g.anon.Setup); |
| @@ -2432,10 +2433,24 @@ | ||
| 2432 | 2433 | /* Boolean setting */ |
| 2433 | 2434 | @ <tr><td align="right"> |
| 2434 | 2435 | @ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>: |
| 2435 | 2436 | @ </td><td> |
| 2436 | 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 | + } | |
| 2437 | 2452 | @ </td></tr> |
| 2438 | 2453 | }else{ |
| 2439 | 2454 | /* Text value setting */ |
| 2440 | 2455 | @ <tr><td align="right"> |
| 2441 | 2456 | @ <a href='%R/help/%h(pSetting->name)'>%h(pSetting->name)</a>: |
| 2442 | 2457 |
| --- 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 |