Changed order of attrib format params

SVN revision: 575
This commit is contained in:
Stefan Ritt 2003-07-04 18:06:44 +00:00
parent 4a9a641697
commit 92891ef3f2
2 changed files with 32 additions and 27 deletions

View File

@ -817,11 +817,24 @@ listed here to display a date filter. Using that filter, the last day, week, mon
on can be displayed. on can be displayed.
<p> <p>
<LI><b><code>Format &lt;attribute&gt; = &lt;width&gt;,&lt;size&gt;,&lt;flags&gt;,&lt;css_class_name&gt;,&lt;css_class_value&gt;</code></b> <LI><b><code>Format &lt;attribute&gt; = &lt;flags&gt;,&lt;css_class_name&gt;,&lt;css_class_value&gt;,&lt;width&gt;,&lt;size&gt;</code></b>
<br> <br>
Optional formatting parameters for attributes. Following items can be defined in the Optional formatting parameters for attributes. Following items can be defined in the
comma-separated list:<p> comma-separated list:<p>
Values used for single message display page:
<ul>
<li><b>&lt;flags&gt;</b> Sum of following flags:
<ul>
<li><b> 1</b>: Display attribute in same line as previous attribute
<li><b> 2</b>: Display radio buttons or check boxes in separate lines (if applicable)
</ul>
<li><b>&lt;css_class_name&gt;</b>,<b>&lt;css_class_value&gt;</b> Cascading Style Sheet class
names used for cells containing attribute name or value, respectively. The classes must
be defined in the style sheet file (usually <i>themes/default/default.css</i>).
</ul>
<p>
Values used for new message entry form: Values used for new message entry form:
<ul> <ul>
<li><b>&lt;width&gt;</b> Width of the text entry field in characters <li><b>&lt;width&gt;</b> Width of the text entry field in characters
@ -829,19 +842,8 @@ Values used for new message entry form:
</ul> </ul>
<p> <p>
Values used for single message display page: Default is <i>"0, attribname, attribvalue, 80, 500"</i>. Trailing parameters can be ommitted,
<ul> so specifying for example only the flags is possible.
<li><b>&lt;flags&gt;</b> Sum of following flags:
<ul>
<li> 1: Display attribute in same line as previous attribute
<li> 2: Display radio buttons or check boxes in separate lines (if applicable)
</ul>
<li><b>&lt;css_class_name&gt;</b>,<b>&lt;css_class_value&gt;</b> Cascading Style Sheet class
names used for cells containing attribute name or value, respectively. The classes must
be defined in the style sheet file (usually <i>themes/default/default.css</i>).
</ul>
<p>
Default is <i>"80, 500, 0, attribname, attribvalue"</i>.
</UL> </UL>

View File

@ -6,6 +6,9 @@
Contents: Web server program for Electronic Logbook ELOG Contents: Web server program for Electronic Logbook ELOG
$Log$ $Log$
Revision 1.128 2003/07/04 18:06:44 midas
Changed order of attrib format params
Revision 1.127 2003/07/04 16:06:50 midas Revision 1.127 2003/07/04 16:06:50 midas
Removed width from attrname cells (should be in CSS now) Removed width from attrname cells (should be in CSS now)
@ -5719,16 +5722,16 @@ char fl[8][NAME_LENGTH];
if (getcfg(lbs->name, str, format)) if (getcfg(lbs->name, str, format))
{ {
n = strbreak(format, fl, 8); n = strbreak(format, fl, 8);
if (n > 0 && atoi(fl[0]) > 0) if (n > 0)
input_size = atoi(fl[0]); format_flags = atoi(fl[0]);
if (n > 1 && atoi(fl[1]) > 0) if (n > 1)
input_maxlen = atoi(fl[1]); strlcpy(class_name, fl[1], sizeof(class_name));
if (n > 2) if (n > 2)
format_flags = atoi(fl[2]); strlcpy(class_value, fl[2], sizeof(class_value));
if (n > 3) if (n > 3 && atoi(fl[3]) > 0)
strlcpy(class_name, fl[3], sizeof(class_name)); input_size = atoi(fl[3]);
if (n > 4) if (n > 4 && atoi(fl[4]) > 0)
strlcpy(class_value, fl[4], sizeof(class_value)); input_maxlen = atoi(fl[4]);
} }
strcpy(star, (attr_flags[index] & AF_REQUIRED) ? "<font color=red>*</font>" : ""); strcpy(star, (attr_flags[index] & AF_REQUIRED) ? "<font color=red>*</font>" : "");
@ -11050,10 +11053,10 @@ BOOL first;
if (getcfg(lbs->name, str, format)) if (getcfg(lbs->name, str, format))
{ {
n = strbreak(format, fl, 8); n = strbreak(format, fl, 8);
if (n > 3) if (n > 1)
strlcpy(class_name, fl[3], sizeof(class_name)); strlcpy(class_name, fl[1], sizeof(class_name));
if (n > 4) if (n > 2)
strlcpy(class_value, fl[4], sizeof(class_value)); strlcpy(class_value, fl[2], sizeof(class_value));
} }
if ((format_flags[i] & AFF_SAME_LINE) == 0) if ((format_flags[i] & AFF_SAME_LINE) == 0)