mcPUIX.xsl
11.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!--
last update 07.07.2010 @f
templates/function in this file
<xsl:template match="XMLArra" />
<xsl:template match="DBUIElement" />
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:php="http://php.net/xsl" >
<xsl:template match="/">
<xsl:apply-templates select="DBUIElement" />
<xsl:apply-templates select="DBUIArray" />
</xsl:template>
<xsl:template match="mcPUIX">
<xsl:param name="param_inputBE">0</xsl:param>
<xsl:apply-templates select="DBUIElement" >
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" /></xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="DBUIArray" >
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" /></xsl:with-param>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="DBUIArray">
<xsl:param name="param_inputBE">0</xsl:param>
<xsl:param name="param_noform">0</xsl:param>
<xsl:choose>
<xsl:when test="@edit=1 and $param_noform=0">
<div class="row"><span class="element"><xsl:value-of select="@label" /> count(<xsl:value-of select="@count" />) </span> </div>
<xsl:for-each select="DBUIRow">
<div class="row"><span class="element"><xsl:value-of select="@label" /> i(<xsl:value-of select="@i" />) </span> </div>
<xsl:apply-templates select="DBUIElement" >
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" />[<xsl:value-of select="@i" />]</xsl:with-param>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<!--<xsl:value-of select="count(DBUIRow[@i='NEW_ROW'])" />/<xsl:value-of select="count(DBUIRow)" />-->
<xsl:if test="count(DBUIRow[@i='NEW_ROW'])!=count(DBUIRow)">
<table border="1">
<xsl:for-each select="DBUIRow">
<xsl:choose>
<xsl:when test="position()=1">
<tr valign="top">
<xsl:for-each select="DBUIElement">
<xsl:if test="@show=1">
<td><b><xsl:value-of select="@label" /></b></td>
</xsl:if>
</xsl:for-each>
</tr>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="@i='NEW_ROW'">
</xsl:when>
<xsl:otherwise>
<tr valign="top">
<xsl:for-each select="DBUIElement">
<xsl:choose>
<xsl:when test="@show=1">
<td>
<!-- <xsl:value-of select="position()" />-->
<xsl:apply-templates select=".">
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" />[<xsl:value-of select="local-name(../..)" />][<xsl:value-of select="../@i" />]</xsl:with-param>
<xsl:with-param name="param_withoutLabel" >1</xsl:with-param>
</xsl:apply-templates>
</td>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." >
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" />[<xsl:value-of select="local-name(../..)" />][<xsl:value-of select="../@i" />]</xsl:with-param>
<xsl:with-param name="param_withoutLabel" >1</xsl:with-param>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</table>
</xsl:if>
<table border="1">
<xsl:for-each select="DBUIRow[@i='NEW_ROW']">
<xsl:choose>
<xsl:when test="position()=1">
<tr valign="top">
<xsl:for-each select="DBUIElement">
<xsl:if test="@show=1">
<td><b><xsl:value-of select="@label" /></b></td>
</xsl:if>
</xsl:for-each>
</tr>
<tr valign="top">
<xsl:for-each select="DBUIElement">
<xsl:choose>
<xsl:when test="@show=1">
<td>
<!-- <xsl:value-of select="position()" />-->
<xsl:apply-templates select=".">
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" />[<xsl:value-of select="local-name(../..)" />][<xsl:value-of select="../@i" />]</xsl:with-param>
<xsl:with-param name="param_withoutLabel" >1</xsl:with-param>
</xsl:apply-templates>
</td>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." >
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" />[<xsl:value-of select="local-name(../..)" />][<xsl:value-of select="../@i" />]</xsl:with-param>
<xsl:with-param name="param_withoutLabel" >1</xsl:with-param>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</tr>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="DBUIElement">
<xsl:param name="param_url">?</xsl:param>
<xsl:param name="param_only_objvar">0</xsl:param>
<xsl:param name="param_noform">0</xsl:param>
<xsl:param name="param_withoutLabel">0</xsl:param>
<xsl:param name="param_inputBE" />
<xsl:if test="(@objvar=$param_only_objvar or $param_only_objvar=0)">
<span class="{@objvar}Font">
<div class="row">
<xsl:if test="$param_withoutLabel=0">
<span class="label">
<xsl:if test="@label"><xsl:value-of select="@label" />:</xsl:if>
<xsl:text disable-output-escaping="no"> </xsl:text>
</span>
</xsl:if>
<span class="element">
<xsl:choose>
<xsl:when test="@edit=1 and $param_noform=0">
<!--<xsl:variable name="var_form_name"><xsl:value-of select="@objvar" /></xsl:variable>-->
<xsl:if test="@element_classname">
<input type="hidden" name="{$param_inputBE}[element_classname]" value="{@element_classname}" />
</xsl:if>
<xsl:choose>
<xsl:when test="@fixed=1">
<input type="hidden" name="{$param_inputBE}[{@objvar}]" value="{@value}" />
<xsl:if test="@show=1"><xsl:value-of select="@value" /></xsl:if>
</xsl:when>
<xsl:when test="@type='DBUIArray'">
<xsl:apply-templates select="DBUIArray" >
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" /></xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="@type='hidden'">
<input type="hidden" name="{$param_inputBE}[{@objvar}]" value="{@value}" />
<xsl:if test="@show=1"><xsl:value-of select="@value" /></xsl:if>
</xsl:when>
<xsl:when test="@type='text'">
<textarea name="{$param_inputBE}[{@objvar}]" class="width" cols="40" rows="20">
<xsl:value-of select="." />
<xsl:text disable-output-escaping="no"> </xsl:text>
</textarea>
</xsl:when>
<xsl:when test="@type='file'">
<xsl:call-template name="Function_FileUploadFormular">
<xsl:with-param name="param_inputBE" select="$param_inputBE" />
</xsl:call-template>
</xsl:when>
<xsl:when test="@type='select'">
<select name="{$param_inputBE}[{@objvar}]" size="1" class="width">
<xsl:for-each select="DBUIList/item">
<xsl:choose>
<xsl:when test="@key=../../@value">
<option value="{@key}" selected="selected"><xsl:value-of select="@value" /></option>
</xsl:when>
<xsl:otherwise>
<option value="{@key}"><xsl:value-of select="@value" /></option>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
</xsl:when>
<xsl:when test="@type='password'">
<div class="row">
<span class="element">1. <input type="password" name="{$param_inputBE}[password2]" class="width" maxlength="{@form_Length}" value="{@value}" /></span>
</div>
<div class="row">
<span class="element">2. <input type="password" name="{$param_inputBE}[password1]" class="width" maxlength="{@form_Length}" value="{@value}" /></span>
</div>
</xsl:when>
<xsl:when test="@type='time'">
<xsl:call-template name="Function_TimeFormular">
<xsl:with-param name="param_prefix"><xsl:value-of select="@objvar" />_</xsl:with-param>
<xsl:with-param name="param_time"><xsl:value-of select="End" /></xsl:with-param>
<xsl:with-param name="param_inputBE" select="$param_inputBE" />
</xsl:call-template>
</xsl:when>
<xsl:when test="@type='checkbox'">
<xsl:choose>
<xsl:when test="@value=1">
<input type="checkbox" name="{$param_inputBE}[{@objvar}]" value="1" checked="checked" />
</xsl:when>
<xsl:otherwise>
<input type="checkbox" name="{$param_inputBE}[{@objvar}]" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="var_maxlength"><xsl:value-of select="@maxlength" /></xsl:variable>
<input name="{$param_inputBE}[{@objvar}]" class="width" type="text" size="{@size}" maxlength="{@maxlength}" value="{@value}" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@show=1">
<xsl:choose>
<xsl:when test="@objvar='EMail'">
<!--<xsl:variable name="EMail"><xsl:value-of select="@value" /></xsl:variable>-->
<span class="LinkFont">
<a href="mailto:{@value}"><xsl:value-of select="@value" /><xsl:text disable-output-escaping="no"> </xsl:text></a>
</span>
</xsl:when>
<xsl:when test="@type='text'">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:when>
<xsl:when test="@type='FORM_TYPE_SEOLINK'">
<a href="{@value}">SEOL</a>
</xsl:when>
<xsl:when test="@ID">
<a href="{$param_url}"><xsl:value-of select="@value" /><xsl:text disable-output-escaping="no"> </xsl:text></a>
</xsl:when>
<xsl:when test="@type='DBUIArray'">
<xsl:apply-templates select="DBUIArray" >
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" /></xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="@type='time'">
<xsl:variable name="var_var"><xsl:value-of select="@value" /></xsl:variable>
<xsl:value-of select="php:function('date', 'j.n.Y H:i', string($var_var) )" />
</xsl:when>
<xsl:when test="@type='url'">
<a href="{@value}"><xsl:value-of select="@value" /></a>
</xsl:when>
<xsl:when test="@type='file'">
<!--<xsl:variable name="var_var"><xsl:value-of select="@value" /></xsl:variable>-->
<xsl:variable name="var_imgname"><xsl:value-of select="DBUIElement" /></xsl:variable>
<xsl:variable name="var_varfile"><xsl:value-of select="." /></xsl:variable>
<xsl:choose>
<xsl:when test="../DBUIElement[@objvar='Mime'] = 'image'">
<img src="files/{$var_var}" height="200" title="{$var_imgname}"/>
</xsl:when>
<xsl:otherwise>
<a href="file.php?p[0]={@value}"> <xsl:value-of select="@value" /></a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@value" disable-output-escaping="yes"/></xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</span>
</div>
</span>
</xsl:if>
</xsl:template>
</xsl:stylesheet>