first commit
This commit is contained in:
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<LabelType>博客类</LabelType>
|
||||
<LabelIntro>
|
||||
</LabelIntro>
|
||||
<OutType>sin</OutType>
|
||||
<LabelDataType>static</LabelDataType>
|
||||
<EnabelAjax>True</EnabelAjax>
|
||||
<Version officialVersion="" modifiedVersions="2526" compatibleVersion="" />
|
||||
<attributes>
|
||||
<name>logID</name>
|
||||
<datatype>supersql</datatype>
|
||||
<default>0</default>
|
||||
<intro>博文ID</intro>
|
||||
</attributes>
|
||||
<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:param name="logID" />
|
||||
<xsl:param name="userName" />
|
||||
<xsl:param name="type" />
|
||||
<xsl:param name="blogId" />
|
||||
<xsl:param name="recyle" />
|
||||
<xsl:variable name="IsBlogOwner" select="pe:LoginedUserName()=$userName"/>
|
||||
<xsl:output method="html" />
|
||||
<xsl:template match="/">
|
||||
<xsl:if test="$IsBlogOwner = 'true'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$type=0">
|
||||
[<a><xsl:attribute name="href">
|
||||
{PE.SiteConfig.ApplicationPath/}Blog/Log.aspx?id=<xsl:value-of select="$blogId" />&Action=modify&LogId=<xsl:value-of select="$logID" />
|
||||
</xsl:attribute>编辑</a>]
|
||||
[<a><xsl:attribute name="href">javascript:DeleteLog('<xsl:value-of select="$logID" />','<xsl:value-of select="$blogId" />');</xsl:attribute>
|
||||
<xsl:attribute name="onclick">return confirm("删除的博文将被放入回收站,确定要删除此博文吗?");</xsl:attribute>删除</a>]
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$type=1">
|
||||
[<a><xsl:attribute name="href">
|
||||
{PE.SiteConfig.ApplicationPath/}Blog/Log.aspx?id=<xsl:value-of select="$blogId" />&Action=modify&LogId=<xsl:value-of select="$logID" />
|
||||
</xsl:attribute>编辑</a>]
|
||||
[<a><xsl:attribute name="href">
|
||||
javascript:Delete('<xsl:value-of select="$logID" />','<xsl:value-of select="$blogId" />');
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="onclick">
|
||||
return confirm("确实要删除此草稿吗?删除后不可恢复。");
|
||||
</xsl:attribute>彻底删除</a>]
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="$type=2">
|
||||
[<a href="javascript:;">
|
||||
<xsl:attribute name="onclick">Restore('<xsl:value-of select="$logID" />','<xsl:value-of select="$blogId" />');</xsl:attribute>还原</a>]
|
||||
[<a href="javascript:;">
|
||||
<xsl:attribute name="onclick">
|
||||
if(confirm("确定要彻底删除此博文吗?")){Delete('<xsl:value-of select="$logID" />','<xsl:value-of select="$blogId" />')};
|
||||
</xsl:attribute>彻底删除</a>]
|
||||
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<script language="javascript" type="text/javascript">
|
||||
function DeleteLog(id,blogID){
|
||||
var x = new AjaxRequest('XML', '');
|
||||
x.para = ['logID='+id,'blogID='+blogID];
|
||||
x.post('deletelog', '{PE.SiteConfig.AjaxSitepath/}Ajax.aspx?HandlerName=BlogAjaxHandler', function(s){
|
||||
var xml = x.createXmlDom(s);
|
||||
var status = xml.getElementsByTagName("status")[0].firstChild.data;
|
||||
if (status == "ok") {
|
||||
if(<xsl:value-of select="$recyle" />==false){
|
||||
window.location.href="{PE.SiteConfig.ApplicationPath/}Blog/UserIndex.aspx?id="+blogID;
|
||||
}else{
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
else {
|
||||
ShowBlogMessage("error","删除博文失败!","");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function Restore(id,blogID){
|
||||
var x = new AjaxRequest('XML', '');
|
||||
x.para = ['logID='+id,'blogID='+blogID];
|
||||
x.post('Restore', '{PE.SiteConfig.AjaxSitepath/}Ajax.aspx?HandlerName=BlogAjaxHandler', function(s){
|
||||
var xml = x.createXmlDom(s);
|
||||
var status = xml.getElementsByTagName("status")[0].firstChild.data;
|
||||
if (status == "ok") {
|
||||
if(<xsl:value-of select="$recyle" />==false){
|
||||
window.location.href="{PE.SiteConfig.ApplicationPath/}Blog/UserIndex.aspx?id="+blogID;
|
||||
}
|
||||
else{
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
else {
|
||||
ShowBlogMessage("error","还原失败!","");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function Delete(id,blogID){
|
||||
var x = new AjaxRequest('XML', '');
|
||||
x.para = ['logID='+id,'blogID='+blogID];
|
||||
x.post('Delete', '{PE.SiteConfig.AjaxSitepath/}Ajax.aspx?HandlerName=BlogAjaxHandler', function(s){
|
||||
var xml = x.createXmlDom(s);
|
||||
var status = xml.getElementsByTagName("status")[0].firstChild.data;
|
||||
if (status == "ok") {
|
||||
if(<xsl:value-of select="$recyle" />==false){
|
||||
window.location.href="{PE.SiteConfig.ApplicationPath/}Blog/UserIndex.aspx?id="+blogID;
|
||||
}
|
||||
else{
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
else {
|
||||
ShowBlogMessage("error","删除博文失败!","");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
</xsl:transform>
|
||||
]]></LabelTemplate>
|
||||
<IsXsltSql>false</IsXsltSql>
|
||||
<IsXsltCountSql>false</IsXsltCountSql>
|
||||
<LabelSqlString>
|
||||
</LabelSqlString>
|
||||
<attributes>
|
||||
<name>userName</name>
|
||||
<datatype>supersql</datatype>
|
||||
<default>
|
||||
</default>
|
||||
<intro>博文用户名</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>type</name>
|
||||
<datatype>int</datatype>
|
||||
<default>
|
||||
</default>
|
||||
<intro>类型</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>blogId</name>
|
||||
<datatype>int</datatype>
|
||||
<default>0</default>
|
||||
<intro>博客ID</intro>
|
||||
</attributes>
|
||||
<attributes>
|
||||
<name>recyle</name>
|
||||
<datatype>bool</datatype>
|
||||
<default>true</default>
|
||||
<intro>是否为回收站</intro>
|
||||
</attributes>
|
||||
</root>
|
||||
Reference in New Issue
Block a user