122 lines
3.6 KiB
XML
122 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<root>
|
|
<LabelType>博客类</LabelType>
|
|
<LabelIntro>
|
|
</LabelIntro>
|
|
<OutType>sin</OutType>
|
|
<LabelDataType>sql_sysquery</LabelDataType>
|
|
<EnabelAjax>True</EnabelAjax>
|
|
<Version officialVersion="" modifiedVersions="2908" compatibleVersion="" />
|
|
<attributes>
|
|
<name>linkOpenType</name>
|
|
<datatype>string</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>默认为原窗口打开,新窗口打开:_blank</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>listOrderType</name>
|
|
<datatype>int</datatype>
|
|
<default>1</default>
|
|
<intro>排序方式:1排序ID排序、2按类别ID排序(升序)、3按类别ID排序(降序)</intro>
|
|
</attributes>
|
|
<IsXsltSql>true</IsXsltSql>
|
|
<IsXsltCountSql>false</IsXsltCountSql>
|
|
<LabelSqlString><![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
<xsl:param name="listOrderType" />
|
|
<xsl:output method="xml" />
|
|
<xsl:template match="/">
|
|
<root>
|
|
<sql>
|
|
SELECT TOP @outputQty * FROM PE_BG_Category
|
|
<xsl:choose>
|
|
<xsl:when test="$listOrderType=1"> ORDER BY OrderID ASC</xsl:when>
|
|
<xsl:when test="$listOrderType=2"> ORDER BY CategoryID ASC</xsl:when>
|
|
<xsl:when test="$listOrderType=3"> ORDER BY CategoryID DESC</xsl:when>
|
|
<xsl:otherwise> ORDER BY OrderID ASC</xsl:otherwise>
|
|
</xsl:choose>
|
|
</sql>
|
|
<sqlpage>
|
|
</sqlpage>
|
|
<countsql>
|
|
</countsql>
|
|
</root>
|
|
</xsl:template>
|
|
</xsl:transform>]]></LabelSqlString>
|
|
<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:param name="linkOpenType" />
|
|
<xsl:param name="titleLength" />
|
|
<xsl:param name="categoryId" />
|
|
<xsl:output method="html" />
|
|
<xsl:variable name="CategoryCount" select="count(/NewDataSet/Table)"/>
|
|
<xsl:template match="/">
|
|
|
|
<li id="Category_0">
|
|
<a href="{pe:InstallDir()}Blog/index.aspx" onclick="guide('0')">博客首页</a>
|
|
</li>
|
|
<xsl:for-each select="/NewDataSet/Table">
|
|
<li id="Category_{CategoryID}">
|
|
<xsl:if test="position()=1">
|
|
<xsl:attribute name="class">current</xsl:attribute>
|
|
</xsl:if>
|
|
<xsl:if test="$CategoryCount = position()">
|
|
<xsl:attribute name="class">lastOne</xsl:attribute>
|
|
</xsl:if>
|
|
<a href="{pe:InstallDir()}Blog/Category.aspx?categoryId={CategoryID}" target="{$linkOpenType}">
|
|
<xsl:value-of select="pe:CutText(CategoryName,$titleLength,'')"/>
|
|
</a>
|
|
</li>
|
|
</xsl:for-each>
|
|
<script type="text/javascript" language="JavaScript">
|
|
function guide(num)
|
|
{
|
|
var arr=new Array;
|
|
arr[0]=0;
|
|
<xsl:for-each select="/NewDataSet/Table">
|
|
arr[<xsl:value-of select="position()"/>]=<xsl:value-of select="CategoryID"/>;
|
|
</xsl:for-each>
|
|
for(var i=0;i<arr.length;i++)
|
|
{
|
|
if(arr[i]==num)
|
|
{
|
|
document.getElementById("Category_"+arr[i]).className="current";
|
|
}
|
|
else
|
|
{
|
|
if(i==arr.length-1)
|
|
{
|
|
document.getElementById("Category_"+arr[i]).className="lastOne";
|
|
}
|
|
else
|
|
{
|
|
document.getElementById("Category_"+arr[i]).className="";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
guide('<xsl:value-of select="$categoryId" />')
|
|
</script>
|
|
</xsl:template>
|
|
</xsl:stylesheet>]]></LabelTemplate>
|
|
<attributes>
|
|
<name>outputQty</name>
|
|
<datatype>supersql</datatype>
|
|
<default>15</default>
|
|
<intro>显示栏目数</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>titleLength</name>
|
|
<datatype>int</datatype>
|
|
<default>8</default>
|
|
<intro>标题长度</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>categoryId</name>
|
|
<datatype>int</datatype>
|
|
<default>0</default>
|
|
<intro>栏目ID:默认为博客首页</intro>
|
|
</attributes>
|
|
</root> |