349 lines
16 KiB
XML
349 lines
16 KiB
XML
<?xml version="1.0"?>
|
|
<root>
|
|
<LabelType>其他类</LabelType>
|
|
<LabelIntro>
|
|
</LabelIntro>
|
|
<OutType>sin</OutType>
|
|
<LabelDataType>sql_sysquery</LabelDataType>
|
|
<EnabelAjax>True</EnabelAjax>
|
|
<LabelTemplate>
|
|
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
|
|
<xsl:variable name="good"/>
|
|
<xsl:output method="html" />
|
|
<xsl:template match="/">
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
|
|
<tbody>
|
|
<tr>
|
|
<xsl:call-template name="GetOptionValue">
|
|
<xsl:with-param name="moodOption" select="NewDataSet/Table/MoodOption"/>
|
|
</xsl:call-template>
|
|
</tr>
|
|
<tr>
|
|
<xsl:call-template name="GetImageHeight">
|
|
<xsl:with-param name="moodOption" select="NewDataSet/Table/MoodOption"/>
|
|
</xsl:call-template>
|
|
</tr>
|
|
|
|
<tr>
|
|
<xsl:call-template name="GetOptionIcon">
|
|
<xsl:with-param name="moodOption" select="NewDataSet/Table/MoodOption"/>
|
|
</xsl:call-template>
|
|
</tr>
|
|
<tr>
|
|
<xsl:call-template name="GetOptionName">
|
|
<xsl:with-param name="moodOption" select="NewDataSet/Table/MoodOption"/>
|
|
</xsl:call-template>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</xsl:template>
|
|
<!--方法模板在不能理解含义的情况下请勿修改
|
|
任何修改都有可能导致改模板不能正常工作
|
|
By Lewi-->
|
|
<!--获取选项对应名称-->
|
|
<xsl:template name="GetOptionName">
|
|
<xsl:param name="moodOption"/>
|
|
<xsl:choose>
|
|
<xsl:when test="contains($moodOption,'$$$')">
|
|
<td align="center" valign="bottom">
|
|
<xsl:value-of select="substring-before(substring-before($moodOption,'$$$'),'|')"/>
|
|
</td>
|
|
<xsl:variable name="after" select="substring-after($moodOption,'$$$')" />
|
|
<xsl:choose>
|
|
<xsl:when test="contains($after,'$$$')">
|
|
<xsl:call-template name="GetOptionName">
|
|
<xsl:with-param name="moodOption" select="$after"/>
|
|
</xsl:call-template>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<td align="center" valign="bottom">
|
|
<xsl:value-of select="substring-before($after,'|')"/>
|
|
</td>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<td align="center" valign="bottom">
|
|
<xsl:value-of select="substring-before($moodOption,'|')"/>
|
|
</td>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<!--获取选项对应图标-->
|
|
<xsl:template name="GetOptionIcon">
|
|
<xsl:param name="moodOption"/>
|
|
<xsl:choose>
|
|
<xsl:when test="contains($moodOption,'$$$')">
|
|
<td align="center" valign="bottom">
|
|
<xsl:element name="img">
|
|
<xsl:attribute name="src">
|
|
<xsl:choose>
|
|
<xsl:when test="pe:IsStartWithhttp(substring-after(substring-before($moodOption,'$$$'),'|')) = 'true'">
|
|
<xsl:value-of select="substring-after(substring-before($moodOption,'$$$'),'|')"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="pe:InstallDir()"/>Images/MoodIcon/<xsl:value-of select="substring-after(substring-before($moodOption,'$$$'),'|')"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:attribute>
|
|
</xsl:element>
|
|
</td>
|
|
<xsl:variable name="after" select="substring-after($moodOption,'$$$')" />
|
|
<xsl:choose>
|
|
<xsl:when test="contains($after,'$$$')">
|
|
<xsl:call-template name="GetOptionIcon">
|
|
<xsl:with-param name="moodOption" select="$after"/>
|
|
</xsl:call-template>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<td align="center" valign="bottom">
|
|
<xsl:element name="img">
|
|
<xsl:attribute name="src">
|
|
<xsl:choose>
|
|
<xsl:when test="pe:IsStartWithhttp(substring-after($after,'|')) = 'true'">
|
|
<xsl:value-of select="substring-after($after,'|')"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="pe:InstallDir()"/>Images/MoodIcon/<xsl:value-of select="substring-after($after,'|')"/>
|
|
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:attribute>
|
|
</xsl:element>
|
|
</td>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<td align="center" valign="bottom">
|
|
<xsl:element name="img">
|
|
<xsl:attribute name="src">
|
|
<xsl:choose>
|
|
<xsl:when test="pe:IsStartWithhttp(substring-after($moodOption,'|')) = 'true'">
|
|
<xsl:value-of select="substring-after($moodOption,'|')"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="pe:InstallDir()"/>Images/MoodIcon/<xsl:value-of select="substring-after($moodOption,'|')"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:attribute>
|
|
</xsl:element>
|
|
</td>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<!--获取选项对应数值-->
|
|
<xsl:template name="GetOptionValue">
|
|
<xsl:param name="moodOption"/>
|
|
<xsl:param name="position" select="0" />
|
|
<xsl:choose>
|
|
<xsl:when test="contains($moodOption,'$$$')">
|
|
<td align="center" valign="bottom">
|
|
<xsl:call-template name="GetMoodValue">
|
|
<xsl:with-param name="position" select="$position"/>
|
|
</xsl:call-template>
|
|
</td>
|
|
<xsl:variable name="after" select="substring-after($moodOption,'$$$')" />
|
|
<xsl:choose>
|
|
<xsl:when test="contains($after,'$$$')">
|
|
<xsl:call-template name="GetOptionValue">
|
|
<xsl:with-param name="moodOption" select="$after"/>
|
|
<xsl:with-param name="position" select="$position + 1"/>
|
|
</xsl:call-template>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<td align="center" valign="bottom">
|
|
<xsl:call-template name="GetMoodValue">
|
|
<xsl:with-param name="position" select="$position+1"/>
|
|
</xsl:call-template>
|
|
</td>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<td align="center" valign="bottom">
|
|
<xsl:call-template name="GetMoodValue">
|
|
<xsl:with-param name="position" select="$position"/>
|
|
</xsl:call-template>
|
|
</td>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
|
|
<!--获取生成图片高度-->
|
|
<xsl:template name="GetImageHeight">
|
|
<xsl:param name="maxImageHeight" select="68"/>
|
|
<xsl:param name="moodOption"/>
|
|
<xsl:param name="position" select="0" />
|
|
<xsl:choose>
|
|
<xsl:when test="contains($moodOption,'$$$')">
|
|
<td style="background: url({pe:InstallDir()}Images/MoodIcon/motion_vote.gif) no-repeat center 50%" height="{$maxImageHeight}" align="center" valign="bottom">
|
|
<xsl:variable name="currentValue">
|
|
<xsl:call-template name="GetMoodValue">
|
|
<xsl:with-param name="position" select="$position"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
<xsl:variable name="totalValue">
|
|
<xsl:call-template name="GetTotalValue"/>
|
|
</xsl:variable>
|
|
<xsl:variable name="relativeValue">
|
|
<xsl:choose>
|
|
<xsl:when test="$totalValue = 0">
|
|
<xsl:value-of select="0"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="$maxImageHeight * ($currentValue div $totalValue)"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:variable>
|
|
<img alt="{$currentValue}人" height="{round($relativeValue)}" src="{pe:InstallDir()}Images/MoodIcon/motion_vote_orange.gif" width="32"/>
|
|
</td>
|
|
<xsl:variable name="after" select="substring-after($moodOption,'$$$')" />
|
|
<xsl:choose>
|
|
<xsl:when test="contains($after,'$$$')">
|
|
<xsl:call-template name="GetImageHeight">
|
|
<xsl:with-param name="moodOption" select="$after"/>
|
|
<xsl:with-param name="position" select="$position + 1"/>
|
|
</xsl:call-template>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<td style="background: url({pe:InstallDir()}Images/MoodIcon/motion_vote.gif) no-repeat center 50%" height="{$maxImageHeight}" align="center" valign="bottom">
|
|
<xsl:variable name="currentValue">
|
|
<xsl:call-template name="GetMoodValue">
|
|
<xsl:with-param name="position" select="$position+1"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
|
|
<xsl:variable name="totalValue">
|
|
<xsl:call-template name="GetTotalValue"/>
|
|
</xsl:variable>
|
|
<xsl:variable name="relativeValue">
|
|
<xsl:choose>
|
|
<xsl:when test="$totalValue = 0">
|
|
<xsl:value-of select="0"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="$maxImageHeight * ($currentValue div $totalValue)"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:variable>
|
|
<img alt="{$currentValue}人" height="{round($relativeValue)}" src="{pe:InstallDir()}Images/MoodIcon/motion_vote_orange.gif" width="32"/>
|
|
</td>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<td style="background: url({pe:InstallDir()}Images/MoodIcon/motion_vote.gif) no-repeat center 50%" height="{$maxImageHeight}" align="center" valign="bottom">
|
|
<xsl:variable name="currentValue">
|
|
<xsl:call-template name="GetMoodValue">
|
|
<xsl:with-param name="position" select="$position+1"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
<xsl:variable name="totalValue">
|
|
<xsl:call-template name="GetTotalValue"/>
|
|
</xsl:variable>
|
|
<xsl:variable name="relativeValue">
|
|
<xsl:choose>
|
|
<xsl:when test="$totalValue = 0">
|
|
<xsl:value-of select="0"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="$maxImageHeight * ($currentValue div $totalValue)"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:variable>
|
|
<img alt="{$currentValue}人" height="{round($relativeValue)}" src="{pe:InstallDir()}Images/MoodIcon/motion_vote_orange.gif" width="32" />
|
|
</td>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template name="GetMoodValue">
|
|
<xsl:param name="position" />
|
|
<xsl:choose>
|
|
<xsl:when test="$position = 0">
|
|
<xsl:value-of select="NewDataSet/Table/M0"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 1">
|
|
<xsl:value-of select="NewDataSet/Table/M1"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 2">
|
|
<xsl:value-of select="NewDataSet/Table/M2"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 3">
|
|
<xsl:value-of select="NewDataSet/Table/M3"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 4">
|
|
<xsl:value-of select="NewDataSet/Table/M4"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 5">
|
|
<xsl:value-of select="NewDataSet/Table/M5"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 6">
|
|
<xsl:value-of select="NewDataSet/Table/M6"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 7">
|
|
<xsl:value-of select="NewDataSet/Table/M7"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 8">
|
|
<xsl:value-of select="NewDataSet/Table/M8"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 9">
|
|
<xsl:value-of select="NewDataSet/Table/M9"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 10">
|
|
<xsl:value-of select="NewDataSet/Table/M10"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 11">
|
|
<xsl:value-of select="NewDataSet/Table/M11"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 12">
|
|
<xsl:value-of select="NewDataSet/Table/M12"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 13">
|
|
<xsl:value-of select="NewDataSet/Table/M13"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 14">
|
|
<xsl:value-of select="NewDataSet/Table/M14"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 15">
|
|
<xsl:value-of select="NewDataSet/Table/M15"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 16">
|
|
<xsl:value-of select="NewDataSet/Table/M16"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 17">
|
|
<xsl:value-of select="NewDataSet/Table/M17"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 18">
|
|
<xsl:value-of select="NewDataSet/Table/M8"/>
|
|
</xsl:when>
|
|
<xsl:when test="$position = 19">
|
|
<xsl:value-of select="NewDataSet/Table/M19"/>
|
|
</xsl:when>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
<xsl:template name="GetTotalValue">
|
|
<xsl:for-each select="NewDataSet/Table">
|
|
<xsl:value-of select="M0+M1+M2+M3+M4+M5+M6+M7+M8+M9+M10+M11+M12+M13+M14+M15+M16+M17+M18+M19"/>
|
|
</xsl:for-each>
|
|
</xsl:template>
|
|
</xsl:stylesheet>]]>
|
|
</LabelTemplate>
|
|
<attributes>
|
|
<name>itemId</name>
|
|
<datatype>supersql</datatype>
|
|
<default>6</default>
|
|
<intro>信息ID</intro>
|
|
</attributes>
|
|
<IsXsltSql>false</IsXsltSql>
|
|
<IsXsltCountSql>false</IsXsltCountSql>
|
|
<LabelSqlString>
|
|
SELECT *
|
|
FROM
|
|
PE_Mood
|
|
INNER JOIN PE_MoodScheme ON (PE_Mood.MoodID = PE_MoodScheme.MoodID)
|
|
WHERE
|
|
PE_Mood.GeneralID = @itemId
|
|
</LabelSqlString>
|
|
</root> |