Files
2026-08-31 16:22:00 +08:00

133 lines
3.8 KiB
XML

<?xml version="1.0"?>
<root>
<LabelType>来源类</LabelType>
<LabelIntro>
</LabelIntro>
<OutType>sin</OutType>
<LabelDataType>sql_sysquery</LabelDataType>
<attributes>
<name>outputQty</name>
<default>5</default>
<intro>显示来源数</intro>
</attributes>
<attributes>
<name>displayType</name>
<datatype>supersql</datatype>
<default>0</default>
<intro>显示方式{普通:0,头像和说明:1,头像无说明:2}</intro>
</attributes>
<attributes>
<name>imageHeight</name>
<default>175</default>
<intro>头像高度</intro>
</attributes>
<attributes>
<name>imageWidth</name>
<default>150</default>
<intro>头像宽度</intro>
</attributes>
<attributes>
<name>contentLength</name>
<default>50</default>
<intro>作者简介的字数</intro>
</attributes>
<LabelSqlString><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
<xsl:output method="xml" />
<xsl:param name="type"/>
<xsl:template match="/">
<root>
<sql>
SELECT TOP @outputQty * FROM PE_Source WHERE
<xsl:choose>
<xsl:when test="type = 1">
onTop = 1
</xsl:when>
<xsl:otherwise>
IsElite = 1
</xsl:otherwise>
</xsl:choose>
AND Passed = 1
</sql>
<countsql>
</countsql>
</root>
</xsl:template>
</xsl:transform>]]></LabelSqlString>
<LabelTemplate><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
<xsl:output method="html" />
<xsl:param name="displayType"/>
<xsl:param name="imageHeight"/>
<xsl:param name="imageWidth"/>
<xsl:param name="contentLength"/>
<xsl:template match="/NewDataSet">
<xsl:choose>
<xsl:when test="count(/NewDataSet/Table) = 0">
<li style="color:red">没有来源!</li>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="Table">
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="pe:InstallDir()"/>Common/ShowCopyFrom.aspx?copyfrom=<xsl:value-of select="Name"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$displayType=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="Photo"/>
</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="width">
<xsl:value-of select="$imageWidth"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="$imageHeight"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="Name"/>
</xsl:attribute>
</xsl:element>
<br />
<xsl:value-of disable-output-escaping="yes" select="pe:CutText(Intro,$contentLength,'…')"/>
</xsl:when>
<xsl:when test="$displayType=2">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="Photo"/>
</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="width">
<xsl:value-of select="$imageWidth"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="$imageHeight"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="Name"/>
</xsl:attribute>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="Name"/>
</xsl:otherwise>
</xsl:choose>
</a>
</li>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:transform>]]></LabelTemplate>
<EnabelAjax>False</EnabelAjax>
<IsXsltSql>true</IsXsltSql>
<IsXsltCountSql>false</IsXsltCountSql>
<attributes>
<name>type</name>
<datatype>supersql</datatype>
<default>1</default>
<intro>输出类型{推荐:2,固顶:1}</intro>
</attributes>
</root>