Fossil SCM

Keep track of versionable and text-area based settings using discrete fields of the stControlSettings structure.

mistachkin 2014-02-21 04:59 trunk
Commit 9b2d565931c69d26564a62efd9d633d641f4495b
2 files changed +52 -55 +6 -8
+52 -55
--- src/db.c
+++ src/db.c
@@ -1790,11 +1790,11 @@
17901790
if( z==0 && g.zConfigDbName ){
17911791
db_swap_connections();
17921792
z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
17931793
db_swap_connections();
17941794
}
1795
- if( ctrlSetting!=0 && (ctrlSetting->width&SETUP_VERSIONABLE) ){
1795
+ if( ctrlSetting!=0 && ctrlSetting->versionable ){
17961796
/* This is a versionable setting, try and get the info from a
17971797
** checked out file */
17981798
z = db_get_do_versionable(zName, z);
17991799
}
18001800
if( z==0 ){
@@ -2080,11 +2080,11 @@
20802080
fossil_print("%-20s %-8s %s\n", ctrlSetting->name, db_column_text(&q, 0),
20812081
db_column_text(&q, 1));
20822082
}else{
20832083
fossil_print("%-20s\n", ctrlSetting->name);
20842084
}
2085
- if( (ctrlSetting->width&SETUP_VERSIONABLE) && localOpen ){
2085
+ if( ctrlSetting->versionable && localOpen ){
20862086
/* Check to see if this is overridden by a versionable settings file */
20872087
Blob versionedPathname;
20882088
blob_zero(&versionedPathname);
20892089
blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
20902090
g.zLocalRoot, ctrlSetting->name);
@@ -2105,74 +2105,71 @@
21052105
** is used for on/off checkboxes.
21062106
** The behaviour page doesn't use a special layout. It lists all
21072107
** set-commands and displays the 'set'-help as info.
21082108
*/
21092109
#if INTERFACE
2110
-
2111
-#define SETUP_WIDTH 63
2112
-#define SETUP_TEXTAREA 64
2113
-#define SETUP_VERSIONABLE 128
2114
-
21152110
struct stControlSettings {
21162111
char const *name; /* Name of the setting */
21172112
char const *var; /* Internal variable name used by db_set() */
2118
- int width; /* Width of display. 0 for boolean values.
2119
- possibly or'ed with above flags. */
2113
+ int width; /* Width of display. 0 for boolean values. */
2114
+ int versionable; /* Is this setting versionable? */
2115
+ int forceTextArea; /* Force using a text area for display? */
21202116
char const *def; /* Default value */
21212117
};
21222118
#endif /* INTERFACE */
21232119
struct stControlSettings const ctrlSettings[] = {
2124
- { "access-log", 0, 0, "off" },
2125
- { "allow-symlinks",0, SETUP_VERSIONABLE, "off" },
2126
- { "auto-captcha", "autocaptcha", 0, "on" },
2127
- { "auto-hyperlink",0, 0, "on", },
2128
- { "auto-shun", 0, 0, "on" },
2129
- { "autosync", 0, 0, "on" },
2130
- { "binary-glob", 0, SETUP_VERSIONABLE|40, "" },
2131
- { "clearsign", 0, 0, "off" },
2132
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
2133
- { "case-sensitive",0, 0, "off" },
2120
+ { "access-log", 0, 0, 0, 0, "off" },
2121
+ { "allow-symlinks", 0, 0, 1, 0, "off" },
2122
+ { "auto-captcha", "autocaptcha", 0, 0, 0, "on" },
2123
+ { "auto-hyperlink", 0, 0, 0, 0, "on", },
2124
+ { "auto-shun", 0, 0, 0, 0, "on" },
2125
+ { "autosync", 0, 0, 0, 0, "on" },
2126
+ { "binary-glob", 0, 40, 1, 0, "" },
2127
+ { "clearsign", 0, 0, 0, 0, "off" },
2128
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || \
2129
+ defined(__APPLE__)
2130
+ { "case-sensitive", 0, 0, 0, 0, "off" },
21342131
#else
2135
- { "case-sensitive",0, 0, "on" },
2132
+ { "case-sensitive", 0, 0, 0, 0, "on" },
21362133
#endif
2137
- { "clean-glob", 0, SETUP_VERSIONABLE|40, "" },
2138
- { "crnl-glob", 0, SETUP_VERSIONABLE|40, "" },
2139
- { "default-perms", 0, 16, "u" },
2140
- { "diff-binary", 0, 0, "on" },
2141
- { "diff-command", 0, 40, "" },
2142
- { "dont-push", 0, 0, "off" },
2143
- { "editor", 0, 32, "" },
2144
- { "empty-dirs", 0, SETUP_VERSIONABLE|40, "" },
2145
- { "encoding-glob", 0, SETUP_VERSIONABLE|40, "" },
2146
- { "gdiff-command", 0, 40, "gdiff" },
2147
- { "gmerge-command",0, 40, "" },
2148
- { "http-port", 0, 16, "8080" },
2149
- { "https-login", 0, 0, "off" },
2150
- { "ignore-glob", 0, SETUP_VERSIONABLE|40, "" },
2151
- { "keep-glob", 0, SETUP_VERSIONABLE|40, "" },
2152
- { "localauth", 0, 0, "off" },
2153
- { "main-branch", 0, 40, "trunk" },
2154
- { "manifest", 0, SETUP_VERSIONABLE, "off" },
2155
- { "max-upload", 0, 25, "250000" },
2156
- { "mtime-changes", 0, 0, "on" },
2157
- { "pgp-command", 0, 40, "gpg --clearsign -o " },
2158
- { "proxy", 0, 32, "off" },
2159
- { "relative-paths",0, 0, "on" },
2160
- { "repo-cksum", 0, 0, "on" },
2161
- { "self-register", 0, 0, "off" },
2162
- { "ssh-command", 0, 40, "" },
2163
- { "ssl-ca-location",0, 40, "" },
2164
- { "ssl-identity", 0, 40, "" },
2134
+ { "clean-glob", 0, 40, 1, 0, "" },
2135
+ { "crnl-glob", 0, 40, 1, 0, "" },
2136
+ { "default-perms", 0, 16, 0, 0, "u" },
2137
+ { "diff-binary", 0, 0, 0, 0, "on" },
2138
+ { "diff-command", 0, 40, 0, 0, "" },
2139
+ { "dont-push", 0, 0, 0, 0, "off" },
2140
+ { "editor", 0, 32, 0, 0, "" },
2141
+ { "empty-dirs", 0, 40, 1, 0, "" },
2142
+ { "encoding-glob", 0, 40, 1, 0, "" },
2143
+ { "gdiff-command", 0, 40, 0, 0, "gdiff" },
2144
+ { "gmerge-command", 0, 40, 0, 0, "" },
2145
+ { "http-port", 0, 16, 0, 0, "8080" },
2146
+ { "https-login", 0, 0, 0, 0, "off" },
2147
+ { "ignore-glob", 0, 40, 1, 0, "" },
2148
+ { "keep-glob", 0, 40, 1, 0, "" },
2149
+ { "localauth", 0, 0, 0, 0, "off" },
2150
+ { "main-branch", 0, 40, 0, 0, "trunk" },
2151
+ { "manifest", 0, 0, 1, 0, "off" },
2152
+ { "max-upload", 0, 25, 0, 0, "250000" },
2153
+ { "mtime-changes", 0, 0, 0, 0, "on" },
2154
+ { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " },
2155
+ { "proxy", 0, 32, 0, 0, "off" },
2156
+ { "relative-paths", 0, 0, 0, 0, "on" },
2157
+ { "repo-cksum", 0, 0, 0, 0, "on" },
2158
+ { "self-register", 0, 0, 0, 0, "off" },
2159
+ { "ssh-command", 0, 40, 0, 0, "" },
2160
+ { "ssl-ca-location", 0, 40, 0, 0, "" },
2161
+ { "ssl-identity", 0, 40, 0, 0, "" },
21652162
#ifdef FOSSIL_ENABLE_TCL
2166
- { "tcl", 0, 0, "off" },
2167
- { "tcl-setup", 0, SETUP_TEXTAREA|40, "" },
2163
+ { "tcl", 0, 0, 0, 0, "off" },
2164
+ { "tcl-setup", 0, 40, 0, 1, "" },
21682165
#endif
2169
- { "th1-setup", 0, SETUP_TEXTAREA|40, "" },
2170
- { "th1-uri-regexp",0, 40, "" },
2171
- { "web-browser", 0, 32, "" },
2172
- { "white-foreground", 0, 0, "off" },
2173
- { 0,0,0,0 }
2166
+ { "th1-setup", 0, 40, 0, 1, "" },
2167
+ { "th1-uri-regexp", 0, 40, 0, 0, "" },
2168
+ { "web-browser", 0, 32, 0, 0, "" },
2169
+ { "white-foreground", 0, 0, 0, 0, "off" },
2170
+ { 0,0,0,0,0,0 }
21742171
};
21752172
21762173
/*
21772174
** COMMAND: settings
21782175
** COMMAND: unset*
21792176
--- src/db.c
+++ src/db.c
@@ -1790,11 +1790,11 @@
1790 if( z==0 && g.zConfigDbName ){
1791 db_swap_connections();
1792 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1793 db_swap_connections();
1794 }
1795 if( ctrlSetting!=0 && (ctrlSetting->width&SETUP_VERSIONABLE) ){
1796 /* This is a versionable setting, try and get the info from a
1797 ** checked out file */
1798 z = db_get_do_versionable(zName, z);
1799 }
1800 if( z==0 ){
@@ -2080,11 +2080,11 @@
2080 fossil_print("%-20s %-8s %s\n", ctrlSetting->name, db_column_text(&q, 0),
2081 db_column_text(&q, 1));
2082 }else{
2083 fossil_print("%-20s\n", ctrlSetting->name);
2084 }
2085 if( (ctrlSetting->width&SETUP_VERSIONABLE) && localOpen ){
2086 /* Check to see if this is overridden by a versionable settings file */
2087 Blob versionedPathname;
2088 blob_zero(&versionedPathname);
2089 blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
2090 g.zLocalRoot, ctrlSetting->name);
@@ -2105,74 +2105,71 @@
2105 ** is used for on/off checkboxes.
2106 ** The behaviour page doesn't use a special layout. It lists all
2107 ** set-commands and displays the 'set'-help as info.
2108 */
2109 #if INTERFACE
2110
2111 #define SETUP_WIDTH 63
2112 #define SETUP_TEXTAREA 64
2113 #define SETUP_VERSIONABLE 128
2114
2115 struct stControlSettings {
2116 char const *name; /* Name of the setting */
2117 char const *var; /* Internal variable name used by db_set() */
2118 int width; /* Width of display. 0 for boolean values.
2119 possibly or'ed with above flags. */
 
2120 char const *def; /* Default value */
2121 };
2122 #endif /* INTERFACE */
2123 struct stControlSettings const ctrlSettings[] = {
2124 { "access-log", 0, 0, "off" },
2125 { "allow-symlinks",0, SETUP_VERSIONABLE, "off" },
2126 { "auto-captcha", "autocaptcha", 0, "on" },
2127 { "auto-hyperlink",0, 0, "on", },
2128 { "auto-shun", 0, 0, "on" },
2129 { "autosync", 0, 0, "on" },
2130 { "binary-glob", 0, SETUP_VERSIONABLE|40, "" },
2131 { "clearsign", 0, 0, "off" },
2132 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
2133 { "case-sensitive",0, 0, "off" },
 
2134 #else
2135 { "case-sensitive",0, 0, "on" },
2136 #endif
2137 { "clean-glob", 0, SETUP_VERSIONABLE|40, "" },
2138 { "crnl-glob", 0, SETUP_VERSIONABLE|40, "" },
2139 { "default-perms", 0, 16, "u" },
2140 { "diff-binary", 0, 0, "on" },
2141 { "diff-command", 0, 40, "" },
2142 { "dont-push", 0, 0, "off" },
2143 { "editor", 0, 32, "" },
2144 { "empty-dirs", 0, SETUP_VERSIONABLE|40, "" },
2145 { "encoding-glob", 0, SETUP_VERSIONABLE|40, "" },
2146 { "gdiff-command", 0, 40, "gdiff" },
2147 { "gmerge-command",0, 40, "" },
2148 { "http-port", 0, 16, "8080" },
2149 { "https-login", 0, 0, "off" },
2150 { "ignore-glob", 0, SETUP_VERSIONABLE|40, "" },
2151 { "keep-glob", 0, SETUP_VERSIONABLE|40, "" },
2152 { "localauth", 0, 0, "off" },
2153 { "main-branch", 0, 40, "trunk" },
2154 { "manifest", 0, SETUP_VERSIONABLE, "off" },
2155 { "max-upload", 0, 25, "250000" },
2156 { "mtime-changes", 0, 0, "on" },
2157 { "pgp-command", 0, 40, "gpg --clearsign -o " },
2158 { "proxy", 0, 32, "off" },
2159 { "relative-paths",0, 0, "on" },
2160 { "repo-cksum", 0, 0, "on" },
2161 { "self-register", 0, 0, "off" },
2162 { "ssh-command", 0, 40, "" },
2163 { "ssl-ca-location",0, 40, "" },
2164 { "ssl-identity", 0, 40, "" },
2165 #ifdef FOSSIL_ENABLE_TCL
2166 { "tcl", 0, 0, "off" },
2167 { "tcl-setup", 0, SETUP_TEXTAREA|40, "" },
2168 #endif
2169 { "th1-setup", 0, SETUP_TEXTAREA|40, "" },
2170 { "th1-uri-regexp",0, 40, "" },
2171 { "web-browser", 0, 32, "" },
2172 { "white-foreground", 0, 0, "off" },
2173 { 0,0,0,0 }
2174 };
2175
2176 /*
2177 ** COMMAND: settings
2178 ** COMMAND: unset*
2179
--- src/db.c
+++ src/db.c
@@ -1790,11 +1790,11 @@
1790 if( z==0 && g.zConfigDbName ){
1791 db_swap_connections();
1792 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1793 db_swap_connections();
1794 }
1795 if( ctrlSetting!=0 && ctrlSetting->versionable ){
1796 /* This is a versionable setting, try and get the info from a
1797 ** checked out file */
1798 z = db_get_do_versionable(zName, z);
1799 }
1800 if( z==0 ){
@@ -2080,11 +2080,11 @@
2080 fossil_print("%-20s %-8s %s\n", ctrlSetting->name, db_column_text(&q, 0),
2081 db_column_text(&q, 1));
2082 }else{
2083 fossil_print("%-20s\n", ctrlSetting->name);
2084 }
2085 if( ctrlSetting->versionable && localOpen ){
2086 /* Check to see if this is overridden by a versionable settings file */
2087 Blob versionedPathname;
2088 blob_zero(&versionedPathname);
2089 blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
2090 g.zLocalRoot, ctrlSetting->name);
@@ -2105,74 +2105,71 @@
2105 ** is used for on/off checkboxes.
2106 ** The behaviour page doesn't use a special layout. It lists all
2107 ** set-commands and displays the 'set'-help as info.
2108 */
2109 #if INTERFACE
 
 
 
 
 
2110 struct stControlSettings {
2111 char const *name; /* Name of the setting */
2112 char const *var; /* Internal variable name used by db_set() */
2113 int width; /* Width of display. 0 for boolean values. */
2114 int versionable; /* Is this setting versionable? */
2115 int forceTextArea; /* Force using a text area for display? */
2116 char const *def; /* Default value */
2117 };
2118 #endif /* INTERFACE */
2119 struct stControlSettings const ctrlSettings[] = {
2120 { "access-log", 0, 0, 0, 0, "off" },
2121 { "allow-symlinks", 0, 0, 1, 0, "off" },
2122 { "auto-captcha", "autocaptcha", 0, 0, 0, "on" },
2123 { "auto-hyperlink", 0, 0, 0, 0, "on", },
2124 { "auto-shun", 0, 0, 0, 0, "on" },
2125 { "autosync", 0, 0, 0, 0, "on" },
2126 { "binary-glob", 0, 40, 1, 0, "" },
2127 { "clearsign", 0, 0, 0, 0, "off" },
2128 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || \
2129 defined(__APPLE__)
2130 { "case-sensitive", 0, 0, 0, 0, "off" },
2131 #else
2132 { "case-sensitive", 0, 0, 0, 0, "on" },
2133 #endif
2134 { "clean-glob", 0, 40, 1, 0, "" },
2135 { "crnl-glob", 0, 40, 1, 0, "" },
2136 { "default-perms", 0, 16, 0, 0, "u" },
2137 { "diff-binary", 0, 0, 0, 0, "on" },
2138 { "diff-command", 0, 40, 0, 0, "" },
2139 { "dont-push", 0, 0, 0, 0, "off" },
2140 { "editor", 0, 32, 0, 0, "" },
2141 { "empty-dirs", 0, 40, 1, 0, "" },
2142 { "encoding-glob", 0, 40, 1, 0, "" },
2143 { "gdiff-command", 0, 40, 0, 0, "gdiff" },
2144 { "gmerge-command", 0, 40, 0, 0, "" },
2145 { "http-port", 0, 16, 0, 0, "8080" },
2146 { "https-login", 0, 0, 0, 0, "off" },
2147 { "ignore-glob", 0, 40, 1, 0, "" },
2148 { "keep-glob", 0, 40, 1, 0, "" },
2149 { "localauth", 0, 0, 0, 0, "off" },
2150 { "main-branch", 0, 40, 0, 0, "trunk" },
2151 { "manifest", 0, 0, 1, 0, "off" },
2152 { "max-upload", 0, 25, 0, 0, "250000" },
2153 { "mtime-changes", 0, 0, 0, 0, "on" },
2154 { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " },
2155 { "proxy", 0, 32, 0, 0, "off" },
2156 { "relative-paths", 0, 0, 0, 0, "on" },
2157 { "repo-cksum", 0, 0, 0, 0, "on" },
2158 { "self-register", 0, 0, 0, 0, "off" },
2159 { "ssh-command", 0, 40, 0, 0, "" },
2160 { "ssl-ca-location", 0, 40, 0, 0, "" },
2161 { "ssl-identity", 0, 40, 0, 0, "" },
2162 #ifdef FOSSIL_ENABLE_TCL
2163 { "tcl", 0, 0, 0, 0, "off" },
2164 { "tcl-setup", 0, 40, 0, 1, "" },
2165 #endif
2166 { "th1-setup", 0, 40, 0, 1, "" },
2167 { "th1-uri-regexp", 0, 40, 0, 0, "" },
2168 { "web-browser", 0, 32, 0, 0, "" },
2169 { "white-foreground", 0, 0, 0, 0, "off" },
2170 { 0,0,0,0,0,0 }
2171 };
2172
2173 /*
2174 ** COMMAND: settings
2175 ** COMMAND: unset*
2176
+6 -8
--- src/setup.c
+++ src/setup.c
@@ -1248,47 +1248,45 @@
12481248
@ the meaning of each setting.</p><hr />
12491249
@ <form action="%s(g.zTop)/setup_settings" method="post"><div>
12501250
@ <table border="0"><tr><td valign="top">
12511251
login_insert_csrf_secret();
12521252
for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1253
- if( (pSet->width&SETUP_WIDTH)==0 ){
1254
- int hasVersionableValue = (pSet->width&SETUP_VERSIONABLE) &&
1253
+ if( pSet->width==0 ){
1254
+ int hasVersionableValue = pSet->versionable &&
12551255
(db_get_do_versionable(pSet->name, NULL)!=0);
12561256
onoff_attribute(pSet->name, pSet->name,
12571257
pSet->var!=0 ? pSet->var : pSet->name,
12581258
is_truth(pSet->def), hasVersionableValue);
1259
- if( (pSet->width&SETUP_VERSIONABLE) ){
1259
+ if( pSet->versionable ){
12601260
@ (v)<br />
12611261
} else {
12621262
@ <br />
12631263
}
12641264
}
12651265
}
12661266
@ <br /><input type="submit" name="submit" value="Apply Changes" />
12671267
@ </td><td style="width:50px;"></td><td valign="top">
12681268
for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1269
- if( (pSet->width&SETUP_WIDTH)!=0
1270
- && !(pSet->width&(SETUP_VERSIONABLE|SETUP_TEXTAREA)) ){
1269
+ if( pSet->width!=0 && !pSet->versionable && !pSet->forceTextArea ){
12711270
entry_attribute(pSet->name, /*pSet->width*/ 25, pSet->name,
12721271
pSet->var!=0 ? pSet->var : pSet->name,
12731272
(char*)pSet->def, 0);
12741273
@ <br />
12751274
}
12761275
}
12771276
for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1278
- if( (pSet->width&SETUP_WIDTH)!=0 && sqlite3_strglob("*glob", pSet->name)
1279
- && (pSet->width&SETUP_TEXTAREA) ){
1277
+ if( pSet->width!=0 && !pSet->versionable && pSet->forceTextArea ){
12801278
@<b>%s(pSet->name)</b><br />
12811279
textarea_attribute("", /*rows*/ 3, /*cols*/ 50, pSet->name,
12821280
pSet->var!=0 ? pSet->var : pSet->name,
12831281
(char*)pSet->def, 0);
12841282
@ <br />
12851283
}
12861284
}
12871285
@ </td><td style="width:50px;"></td><td valign="top">
12881286
for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1289
- if( (pSet->width&SETUP_WIDTH)!=0 && (pSet->width&SETUP_VERSIONABLE) ){
1287
+ if( pSet->width!=0 && pSet->versionable ){
12901288
int hasVersionableValue = db_get_do_versionable(pSet->name, NULL)!=0;
12911289
@<b>%s(pSet->name)</b> (v)<br />
12921290
textarea_attribute("", /*rows*/ 3, /*cols*/ 20, pSet->name,
12931291
pSet->var!=0 ? pSet->var : pSet->name,
12941292
(char*)pSet->def, hasVersionableValue);
12951293
--- src/setup.c
+++ src/setup.c
@@ -1248,47 +1248,45 @@
1248 @ the meaning of each setting.</p><hr />
1249 @ <form action="%s(g.zTop)/setup_settings" method="post"><div>
1250 @ <table border="0"><tr><td valign="top">
1251 login_insert_csrf_secret();
1252 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1253 if( (pSet->width&SETUP_WIDTH)==0 ){
1254 int hasVersionableValue = (pSet->width&SETUP_VERSIONABLE) &&
1255 (db_get_do_versionable(pSet->name, NULL)!=0);
1256 onoff_attribute(pSet->name, pSet->name,
1257 pSet->var!=0 ? pSet->var : pSet->name,
1258 is_truth(pSet->def), hasVersionableValue);
1259 if( (pSet->width&SETUP_VERSIONABLE) ){
1260 @ (v)<br />
1261 } else {
1262 @ <br />
1263 }
1264 }
1265 }
1266 @ <br /><input type="submit" name="submit" value="Apply Changes" />
1267 @ </td><td style="width:50px;"></td><td valign="top">
1268 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1269 if( (pSet->width&SETUP_WIDTH)!=0
1270 && !(pSet->width&(SETUP_VERSIONABLE|SETUP_TEXTAREA)) ){
1271 entry_attribute(pSet->name, /*pSet->width*/ 25, pSet->name,
1272 pSet->var!=0 ? pSet->var : pSet->name,
1273 (char*)pSet->def, 0);
1274 @ <br />
1275 }
1276 }
1277 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1278 if( (pSet->width&SETUP_WIDTH)!=0 && sqlite3_strglob("*glob", pSet->name)
1279 && (pSet->width&SETUP_TEXTAREA) ){
1280 @<b>%s(pSet->name)</b><br />
1281 textarea_attribute("", /*rows*/ 3, /*cols*/ 50, pSet->name,
1282 pSet->var!=0 ? pSet->var : pSet->name,
1283 (char*)pSet->def, 0);
1284 @ <br />
1285 }
1286 }
1287 @ </td><td style="width:50px;"></td><td valign="top">
1288 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1289 if( (pSet->width&SETUP_WIDTH)!=0 && (pSet->width&SETUP_VERSIONABLE) ){
1290 int hasVersionableValue = db_get_do_versionable(pSet->name, NULL)!=0;
1291 @<b>%s(pSet->name)</b> (v)<br />
1292 textarea_attribute("", /*rows*/ 3, /*cols*/ 20, pSet->name,
1293 pSet->var!=0 ? pSet->var : pSet->name,
1294 (char*)pSet->def, hasVersionableValue);
1295
--- src/setup.c
+++ src/setup.c
@@ -1248,47 +1248,45 @@
1248 @ the meaning of each setting.</p><hr />
1249 @ <form action="%s(g.zTop)/setup_settings" method="post"><div>
1250 @ <table border="0"><tr><td valign="top">
1251 login_insert_csrf_secret();
1252 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1253 if( pSet->width==0 ){
1254 int hasVersionableValue = pSet->versionable &&
1255 (db_get_do_versionable(pSet->name, NULL)!=0);
1256 onoff_attribute(pSet->name, pSet->name,
1257 pSet->var!=0 ? pSet->var : pSet->name,
1258 is_truth(pSet->def), hasVersionableValue);
1259 if( pSet->versionable ){
1260 @ (v)<br />
1261 } else {
1262 @ <br />
1263 }
1264 }
1265 }
1266 @ <br /><input type="submit" name="submit" value="Apply Changes" />
1267 @ </td><td style="width:50px;"></td><td valign="top">
1268 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1269 if( pSet->width!=0 && !pSet->versionable && !pSet->forceTextArea ){
 
1270 entry_attribute(pSet->name, /*pSet->width*/ 25, pSet->name,
1271 pSet->var!=0 ? pSet->var : pSet->name,
1272 (char*)pSet->def, 0);
1273 @ <br />
1274 }
1275 }
1276 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1277 if( pSet->width!=0 && !pSet->versionable && pSet->forceTextArea ){
 
1278 @<b>%s(pSet->name)</b><br />
1279 textarea_attribute("", /*rows*/ 3, /*cols*/ 50, pSet->name,
1280 pSet->var!=0 ? pSet->var : pSet->name,
1281 (char*)pSet->def, 0);
1282 @ <br />
1283 }
1284 }
1285 @ </td><td style="width:50px;"></td><td valign="top">
1286 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1287 if( pSet->width!=0 && pSet->versionable ){
1288 int hasVersionableValue = db_get_do_versionable(pSet->name, NULL)!=0;
1289 @<b>%s(pSet->name)</b> (v)<br />
1290 textarea_attribute("", /*rows*/ 3, /*cols*/ 20, pSet->name,
1291 pSet->var!=0 ? pSet->var : pSet->name,
1292 (char*)pSet->def, hasVersionableValue);
1293

Keyboard Shortcuts

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