1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <!-- Generated by Hand -->
4 Copyright (C) 2011 Julia Longtin <julia.longtin@gmail.com>
6 This program is free software; you can redistribute it and/or
7 Modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
12 <!-- templates in this file are meant as manual replacements for the layouts engine. AKA, this file should not be used in pure layout forms. -->
13 <xsl:stylesheet version=
"1.0"
14 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
15 <!-- the default template for the 'manual' container object -->
16 <xsl:template match=
"manual">
17 <xsl:text disable-output-escaping=
"yes"><![CDATA[
<!-- display the form's manual based fields -->
18 <table border='
0' cellpadding='
0' width='
100%'
>
20 <xsl:apply-templates select=
"field|div|section"/>
21 <xsl:text disable-output-escaping=
"yes"><![CDATA[
</table>
24 <!-- default section template -->
25 <xsl:template match=
"section">
26 <xsl:text disable-output-escaping=
"yes"><![CDATA[
<tr><td class='sectionlabel'
>]]
></xsl:text>
27 <xsl:value-of select=
"@label"/>
28 <xsl:text disable-output-escaping=
"yes"><![CDATA[
</td>]]
></xsl:text>
29 <xsl:if test=
"count(field) > 0">
30 <xsl:call-template name=
"consumeRows">
31 <xsl:with-param name=
"fields" select=
"field"/>
32 <xsl:with-param name=
"checked" select=
"1"/>
33 <xsl:with-param name=
"consumedcols" select=
"0"/>
34 <xsl:with-param name=
"numofCols" select=
"//style/@cells_per_row"/>
38 <xsl:template name=
"consumeRows">
39 <xsl:param name=
"fields" />
40 <xsl:param name=
"checked" />
41 <xsl:param name=
"consumedcols" />
42 <xsl:param name=
"numofCols" />
43 <xsl:text disable-output-escaping=
"yes"><![CDATA[
<!-- called consumeRows ]]></xsl:text>
44 <xsl:value-of select="$consumedcols"/>
45 <xsl:value-of select="$checked"/>
46 <xsl:value-of select="$numofCols"/>
47 <xsl:text disable-output-escaping="yes"><![CDATA[--> ]]
></xsl:text>
49 <!-- exit condition -->
50 <xsl:when test=
"not($fields)">
51 <xsl:text disable-output-escaping=
"yes"><![CDATA[
<!-- Exiting not($fields)]]></xsl:text>
52 <xsl:value-of select="$numofCols - $consumedcols"/>
53 <xsl:text disable-output-escaping="yes"><![CDATA[-->]]
></xsl:text>
54 <xsl:call-template name=
"EmptyFields">
55 <xsl:with-param name=
"fields" select=
"$numofCols - $consumedcols"/>
57 <xsl:text disable-output-escaping=
"yes"><![CDATA[
</tr>
60 <xsl:when test=
"$consumedcols = $numofCols">
61 <xsl:text disable-output-escaping=
"yes"><![CDATA[
</tr>
62 <tr><td valign='top'
> </td>]]
></xsl:text>
66 <xsl:when test=
"not($fields[$checked+1])">
67 <xsl:apply-templates select=
"$fields[position() <= $checked]"/>
68 <xsl:call-template name=
"consumeRows">
69 <xsl:with-param name=
"fields" select=
"$fields[position() > $checked]"/>
70 <xsl:with-param name=
"checked" select=
"$checked"/>
71 <xsl:with-param name=
"consumedcols" select=
"$fields[$checked]/@cols + $fields[$checked]/@labelcols + $consumedcols"/>
72 <xsl:with-param name=
"numofCols" select=
"$numofCols"/>
75 <xsl:when test=
"$fields[$checked]/@cols + $fields[$checked]/@labelcols + $consumedcols = $numofCols">
76 <xsl:apply-templates select=
"$fields[position() <= $checked]"/>
77 <xsl:text disable-output-escaping=
"yes"><![CDATA[
</tr>
78 <tr><td valign='top'
> </td>]]
></xsl:text>
79 <xsl:call-template name=
"consumeRows">
80 <xsl:with-param name=
"fields" select=
"$fields[position() > $checked]"/>
81 <xsl:with-param name=
"checked" select=
"1"/>
82 <xsl:with-param name=
"consumedcols" select=
"0"/>
83 <xsl:with-param name=
"numofCols" select=
"$numofCols"/>
86 <xsl:when test=
"$fields[$checked]/@cols + $fields[$checked]/@labelcols + $consumedcols > $numofCols">
87 <xsl:apply-templates select=
"$fields[position() < $checked]"/>
88 <xsl:call-template name=
"EmptyFields">
89 <xsl:with-param name=
"fields" select=
"$numofCols - $consumedcols"/>
91 <xsl:text disable-output-escaping=
"yes"><![CDATA[
</div>
92 <tr><td valign='top'
> </td>]]
></xsl:text>
93 <xsl:call-template name=
"consumeRows">
94 <xsl:with-param name=
"fields" select=
"$fields[position() >= $checked]"/>
95 <xsl:with-param name=
"checked" select=
"1"/>
96 <xsl:with-param name=
"consumedcols" select=
"0"/>
97 <xsl:with-param name=
"numofCols" select=
"$numofCols"/>
101 <xsl:call-template name=
"consumeRows">
102 <xsl:with-param name=
"fields" select=
"$fields"/>
103 <xsl:with-param name=
"checked" select=
"$checked+1"/>
104 <xsl:with-param name=
"consumedcols" select=
"$fields[$checked]/@cols + $fields[$checked]/@labelcols + $consumedcols"/>
105 <xsl:with-param name=
"numofCols" select=
"$numofCols"/>
112 <xsl:template name=
"EmptyFields">
113 <xsl:param name=
"fields"/>
114 <xsl:if test=
"$fields > 1">
115 <xsl:call-template name=
"EmptyFields">
116 <xsl:with-param name=
"fields" select=
"$fields=1"/>
119 <xsl:if test=
"$fields > 0">
120 <xsl:text disable-output-escaping=
"yes"><![CDATA[
<td class='emptycell' colspan='
1'
></td>]]
></xsl:text>
123 <xsl:template match=
"field[@type='checkbox_list' or @type='exams' or @type='textbox' or @type='textarea' or @type='provider' or @type='date' or @type='textfield' or @type='dropdown_list']">
124 <xsl:if test=
"@labelcols>0">
125 <xsl:text disable-output-escaping=
"yes"><![CDATA[
<td class='fieldlabel' colspan=']]
></xsl:text>
126 <xsl:value-of select=
"@labelcols"/>
127 <xsl:text disable-output-escaping=
"yes"><![CDATA['
><?php echo xl_layout_label(']]
></xsl:text>
128 <xsl:value-of select=
"@label"/>
129 <xsl:text disable-output-escaping=
"yes"><![CDATA[','e').':';
?></td>]]
></xsl:text>
131 <xsl:if test=
"@cols>0">
132 <xsl:text disable-output-escaping=
"yes"><![CDATA[
<td class='text data' colspan=']]
></xsl:text>
133 <xsl:value-of select=
"@cols"/>
134 <xsl:text disable-output-escaping=
"yes"><![CDATA['
><?php echo generate_display_field($manual_layouts[']]
></xsl:text>
135 <xsl:value-of select=
"@name"/>
136 <xsl:text disable-output-escaping=
"yes"><![CDATA['], $]]
></xsl:text>
137 <xsl:value-of select=
"$fetchrow"/>
138 <xsl:text disable-output-escaping=
"yes"><![CDATA[[']]
></xsl:text>
139 <xsl:value-of select=
"@name"/>
140 <xsl:text disable-output-escaping=
"yes"><![CDATA[']);
?></td>]]
></xsl:text>