[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/templates/default/attributes_form.xsl, 1.2
From: |
nomail |
Subject: |
[Phpgroupware-cvs] property/templates/default/attributes_form.xsl, 1.2 |
Date: |
Wed, 2 Jun 2004 21:09:40 +0200 |
Update of /property/templates/default
Added Files:
Branch:
attributes_form.xsl
date: 2004/06/02 19:09:40; author: sigurdne; state: Exp; lines: +150 -0
Log Message:
no message
=====================================================================
<!-- $Id: attributes_form.xsl,v 1.2 2004/06/02 19:09:40 sigurdne Exp $ -->
<xsl:template name="attributes_form">
<xsl:apply-templates select="attributes_values"/>
</xsl:template>
<xsl:template match="attributes_values">
<xsl:variable name="lang_attribute_statustext"><xsl:value-of
select="lang_attribute_statustext"/></xsl:variable>
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="@class">
<xsl:value-of
select="@class"/>
</xsl:when>
<xsl:when test="position() mod
2 = 0">
<xsl:text>row_off</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>row_on</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td class="{class}" align="left" valign="top">
<xsl:value-of select="input_text"/>
<xsl:choose>
<xsl:when test="datatype='D'">
<xsl:text>[</xsl:text><xsl:value-of
select="//lang_dateformat"/><xsl:text>]</xsl:text>
</xsl:when>
</xsl:choose>
</td>
<td align="left">
<xsl:choose>
<xsl:when test="name!=''">
<input type="hidden"
name="values_attribute[{counter}][name]" value="{name}"></input>
<input type="hidden"
name="values_attribute[{counter}][datatype]" value="{datatype}"></input>
<xsl:choose>
<xsl:when
test="datatype='R'">
<xsl:call-template name="choice"/>
</xsl:when>
<xsl:when
test="datatype='CH'">
<xsl:call-template name="choice"/>
</xsl:when>
<xsl:when
test="datatype='LB'">
<select
name="values_attribute[{counter}][value]" class="forms"
onMouseover="window.status='{statustext}'; return true;"
onMouseout="window.status='';return true;">
<option value=""><xsl:value-of select="//lang_none"/></option>
<xsl:for-each select="choice">
<xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
<xsl:choose>
<xsl:when test="checked='checked'">
<option value="{$id}" selected="selected"><xsl:value-of
disable-output-escaping="yes" select="value"/></option>
</xsl:when>
<xsl:otherwise>
<option value="{$id}"><xsl:value-of
disable-output-escaping="yes" select="value"/></option>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</select>
</xsl:when>
<xsl:when
test="datatype='AB'">
<xsl:variable name="org_name"><xsl:value-of
select="name"/><xsl:text>_org_name</xsl:text></xsl:variable>
<xsl:variable name="lookup_function"><xsl:text>lookup_</xsl:text><xsl:value-of
select="name"/><xsl:text>();</xsl:text></xsl:variable>
<input
type="text" name="{name}" value="{value}" onClick="{$lookup_function}"
readonly="readonly" size="5" onMouseout="window.status='';return true;" >
<xsl:attribute name="onMouseover">
<xsl:text>window.status='</xsl:text>
<xsl:value-of select="statustext"/>
<xsl:text>'; return true;</xsl:text>
</xsl:attribute>
</input>
<input
size="30" type="text" name="{$org_name}" value="{org_name}"
onClick="{$lookup_function}" readonly="readonly">
<xsl:attribute name="onMouseover">
<xsl:text>window.status='</xsl:text>
<xsl:value-of select="statustext"/>
<xsl:text>'; return true;</xsl:text>
</xsl:attribute>
</input>
</xsl:when>
<xsl:when
test="datatype='D'">
<input
type="text" name="values_attribute[{counter}][value]" value="{value}"
onFocus="{//dateformat_validate}" onKeyUp="{//onKeyUp}" onBlur="{//onBlur}"
size="12" maxlength="10" onMouseout="window.status='';return true;" >
<xsl:attribute name="onMouseover">
<xsl:text>window.status='</xsl:text>
<xsl:value-of select="statustext"/>
<xsl:text>';return true;</xsl:text>
</xsl:attribute>
</input>
</xsl:when>
<xsl:when
test="datatype='T'">
<textarea cols="40" rows="6" name="values_attribute[{counter}][value]"
wrap="virtual" onMouseout="window.status='';return true;">
<xsl:attribute name="onMouseover">
<xsl:text>window.status='</xsl:text>
<xsl:value-of select="statustext"/>
<xsl:text>';return true;</xsl:text>
</xsl:attribute>
<xsl:value-of select="value"/>
</textarea>
</xsl:when>
<xsl:otherwise>
<input
type="text" name="values_attribute[{counter}][value]" value="{value}" size="30"
onMouseout="window.status='';return true;" >
<xsl:attribute name="onMouseover">
<xsl:text>window.status='</xsl:text>
<xsl:value-of select="statustext"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="datatype_text"/>
<xsl:text>';return true;</xsl:text>
</xsl:attribute>
</input>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:template>
<xsl:template name="choice">
<xsl:variable name="counter"><xsl:value-of
select="counter"/></xsl:variable>
<table cellpadding="2" cellspacing="2" width="50%"
align="left">
<xsl:for-each select="choice" >
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when
test="@class">
<xsl:value-of select="@class"/>
</xsl:when>
<xsl:when
test="position() mod 2 = 0">
<xsl:text>row_off</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>row_on</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td align="left">
<xsl:value-of select="value"/>
<xsl:text> </xsl:text>
</td>
<td align="left">
<xsl:choose>
<xsl:when
test="checked='checked'">
<input
type="{input_type}" name="values_attribute[{$counter}][value][]" value="{id}"
checked="checked"></input>
</xsl:when>
<xsl:otherwise>
<input
type="{input_type}" name="values_attribute[{$counter}][value][]"
value="{id}"></input>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>