Fixes problem that umbraco.library.GetCurrentMember() and Exslt doesn't work any more

This commit is contained in:
Sebastiaan Janssen
2014-09-12 19:46:22 +02:00
parent f500ad62ff
commit 970a08316d
25 changed files with 57 additions and 35 deletions
+3
View File
@@ -281,6 +281,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.6\lib\umbraco.MacroEngines.dll</HintPath>
</Reference>
<Reference Include="umbraco.presentation.xslt.Exslt">
<HintPath>..\dependencies\Our\umbraco.presentation.xslt.Exslt.dll</HintPath>
</Reference>
<Reference Include="umbraco.providers, Version=1.0.5350.25719, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoCms.Core.7.1.6\lib\umbraco.providers.dll</HintPath>
@@ -24,7 +24,7 @@
<xsl:if test="umbraco.library:IsLoggedOn()">
<div class="box" style="text-align: center">
<xsl:variable name="mem" select="umbraco.library:GetCurrentMember()"/>
<xsl:variable name="mem" select="uForum:GetCurrentMember()"/>
<xsl:if test="true and number($mem/@id) = number($currentPage/owner)">
<small>Notify event participants</small>
+3 -2
View File
@@ -7,7 +7,8 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
xmlns:uForum="urn:uForum"
exclude-result-prefixes="msxml umbraco.library uForum">
<xsl:output method="html" omit-xml-declaration="yes"/>
@@ -15,7 +16,7 @@
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:variable name="mem" select="umbraco.library:GetCurrentMember()"/>
<xsl:variable name="mem" select="uForum:GetCurrentMember()"/>
<xsl:variable name="editor" select="umbraco.library:NiceUrl(1057)"/>
<div id="buddyIconForm">
+3 -2
View File
@@ -10,7 +10,8 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library"
xmlns:uForum="urn:uForum"
exclude-result-prefixes="msxml umbraco.library uForum"
>
<xsl:output method="xml" omit-xml-declaration="yes"/>
@@ -21,7 +22,7 @@
<xsl:template match="/">
<xsl:if test="$isLoggedOn">
<xsl:variable name="member" select="umbraco.library:GetCurrentMember()"/>
<xsl:variable name="member" select="uForum:GetCurrentMember()"/>
<script type="text/javascript">
var umb_member_guid = '<xsl:value-of select="$member/@id"/>';
var umb_member_name = '<xsl:value-of select="$member/@nodeName"/>';
@@ -15,7 +15,7 @@
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:variable name="mem" select="umbraco.library:GetCurrentMember()"/>
<xsl:variable name="mem" select="uForum:GetCurrentMember()"/>
<xsl:variable name="memberTopics" select="uForum.raw:TopicsWithParticipation($mem/@id)"/>
<div style="overflow: hidden; width: 480px; float: left; clear: none;">
@@ -14,7 +14,7 @@
<!-- Don't change this, but add a 'contentPicker' element to -->
<!-- your macro with an alias named 'source' -->
<xsl:variable name="source" select="umbraco.library:GetXmlNodeById(/macro/source)"/>
<xsl:variable name="mem" select="umbraco.library:GetCurrentMember()"/>
<xsl:variable name="mem" select="uForum:GetCurrentMember()"/>
<xsl:template match="/">
+3 -3
View File
@@ -41,7 +41,7 @@
<xsl:choose>
<xsl:when test="count(/root/member [@id != umbraco.library:GetCurrentMember()/@id]) = 0">
<xsl:when test="count(/root/member [@id != uForum:GetCurrentMember()/@id]) = 0">
<div class="error">
<xsl:choose>
<xsl:when test="string-length(/root/location/@name) &gt; 0">
@@ -69,9 +69,9 @@
<div class="box">
<h4><xsl:value-of select="count(/root/member [@id != umbraco.library:GetCurrentMember()/@id and string-length(@name) &gt; 0]) "/> members found within <xsl:value-of select="/root/location/@radius"/>&nbsp;KM of <xsl:value-of select="/root/location/@name"/>:</h4>
<h4><xsl:value-of select="count(/root/member [@id != uForum:GetCurrentMember()/@id and string-length(@name) &gt; 0]) "/> members found within <xsl:value-of select="/root/location/@radius"/>&nbsp;KM of <xsl:value-of select="/root/location/@name"/>:</h4>
<ul class="forumTopics summary" style="height:535px;overflow:auto;">
<xsl:for-each select="/root/member [@id != umbraco.library:GetCurrentMember()/@id]">
<xsl:for-each select="/root/member [@id != uForum:GetCurrentMember()/@id]">
<xsl:sort select="./data [@alias = 'distance']" data-type="number"/>
<xsl:variable name="member" select="." />
<xsl:if test="string-length($member/@name) &gt; 0">
@@ -40,7 +40,7 @@
<xsl:choose>
<xsl:when test="count(/root/member [@id != umbraco.library:GetCurrentMember()/@id]) = 0">
<xsl:when test="count(/root/member [@id != uForum:GetCurrentMember()/@id]) = 0">
document.getElementById('memberlocatorextra').style.display = 'block';
</xsl:when>
<xsl:otherwise>
@@ -58,7 +58,7 @@
map.setCenter(new GLatLng(<xsl:value-of select="/root/location"/>), <xsl:value-of select="$zoomlevel"/>);
<xsl:for-each select="/root/member [@id != umbraco.library:GetCurrentMember()/@id]">
<xsl:for-each select="/root/member [@id != uForum:GetCurrentMember()/@id]">
<xsl:sort select="./data [@alias = 'distance']" data-type="number"/>
<xsl:if test="string-length(./@name) &gt; 0">
+2 -2
View File
@@ -98,7 +98,7 @@ RE: <xsl:value-of select="title" />
<xsl:call-template name="renderTopBar"><xsl:with-param name="title">Your Topics</xsl:with-param><xsl:with-param name="backLink" select="concat('/','') "/></xsl:call-template>
<div id="content">
<ul class="topicList list">
<xsl:for-each select="uForum.raw:TopicsWithAuthor(umbraco.library:GetCurrentMember()/@id)/topics/topic">
<xsl:for-each select="uForum.raw:TopicsWithAuthor(uForum:GetCurrentMember()/@id)/topics/topic">
<xsl:sort select="updated" order ="descending"/>
<xsl:call-template name="renderTopic"><xsl:with-param name="topic" select="."/></xsl:call-template>
@@ -113,7 +113,7 @@ RE: <xsl:value-of select="title" />
<div id="content">
<xsl:if test="$loggedOn">
<p>Welcome <xsl:value-of select="umbraco.library:GetMemberName(umbraco.library:GetCurrentMember()/@id)"/></p>
<p>Welcome <xsl:value-of select="umbraco.library:GetMemberName(uForum:GetCurrentMember()/@id)"/></p>
</xsl:if>
<ul class="list">
<li><a href="?mode=latest">Latest topics</a></li>
@@ -20,14 +20,14 @@
<xsl:variable name="mem">
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/@id"/>
<xsl:value-of select="uForum:GetCurrentMember()/@id"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="isAdmin" select="uForum:IsInGroup('admin')"/>
<xsl:variable name="files" select="uWiki:GetAttachedFiles($currentPage/@id)" />
<xsl:variable name="owner" select="umbraco.library:GetMember( number($currentPage/owner) )"/>
<xsl:variable name="canVote" select="boolean( number(umbraco.library:GetCurrentMember()/reputationCurrent) &gt; 25 )"/>
<xsl:variable name="canVote" select="boolean( number(uForum:GetCurrentMember()/reputationCurrent) &gt; 25 )"/>
<div id="project">
@@ -24,7 +24,7 @@
<xsl:template match="/">
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:variable name="mem" select="umbraco.library:GetCurrentMember()"/>
<xsl:variable name="mem" select="uForum:GetCurrentMember()"/>
<h3><a href="{umbraco.library:NiceUrl($editor)}">Create a new project</a></h3>
+2 -2
View File
@@ -16,7 +16,7 @@
<xsl:variable name="mem">
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/@id"/>
<xsl:value-of select="uForum:GetCurrentMember()/@id"/>
</xsl:if>
</xsl:variable>
@@ -29,7 +29,7 @@
<xsl:variable name="treshold">
<xsl:choose>
<xsl:when test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/treshold" />
<xsl:value-of select="uForum:GetCurrentMember()/treshold" />
</xsl:when>
<xsl:otherwise>-10</xsl:otherwise>
</xsl:choose>
+3 -3
View File
@@ -20,10 +20,10 @@
<xsl:variable name="isModerator" select="uForum:IsModerator()"/>
<xsl:variable name="mem">
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/@id"/>
<xsl:value-of select="uForum:GetCurrentMember()/@id"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="canVote" select="boolean( number(umbraco.library:GetCurrentMember()/reputationCurrent) &gt;= 25 )"/>
<xsl:variable name="canVote" select="boolean( number(uForum:GetCurrentMember()/reputationCurrent) &gt;= 25 )"/>
<xsl:template match="/">
@@ -64,7 +64,7 @@
<xsl:variable name="treshold">
<xsl:choose>
<xsl:when test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/treshold" />
<xsl:value-of select="uForum:GetCurrentMember()/treshold" />
</xsl:when>
<xsl:otherwise>-10</xsl:otherwise>
</xsl:choose>
+1 -1
View File
@@ -12,7 +12,7 @@
<xsl:param name="currentPage"/>
<xsl:variable name="mem"><xsl:if test="umbraco.library:IsLoggedOn()"><xsl:value-of select="umbraco.library:GetCurrentMember()/@id"/></xsl:if></xsl:variable>
<xsl:variable name="mem"><xsl:if test="umbraco.library:IsLoggedOn()"><xsl:value-of select="uForum:GetCurrentMember()/@id"/></xsl:if></xsl:variable>
<xsl:variable name="forumid" select="$currentPage/@id" />
<xsl:template match="/">
+1 -1
View File
@@ -24,7 +24,7 @@
<xsl:variable name="forumFrontPageId" select="1053" />
<xsl:variable name="isLoggedOn" select="umbraco.library:IsLoggedOn()"/>
<xsl:variable name="currentMember" select="umbraco.library:GetCurrentMember()"/>
<xsl:variable name="currentMember" select="uForum:GetCurrentMember()"/>
<xsl:template match="/">
<xsl:if test="$isLoggedOn">
+2 -2
View File
@@ -16,7 +16,7 @@
<xsl:variable name="mem">
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/@id"/>
<xsl:value-of select="uForum:GetCurrentMember()/@id"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="forumid" select="$currentPage/@id" />
@@ -27,7 +27,7 @@
<xsl:variable name="treshold">
<xsl:choose>
<xsl:when test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/treshold" />
<xsl:value-of select="uForum:GetCurrentMember()/treshold" />
</xsl:when>
<xsl:otherwise>-10</xsl:otherwise>
</xsl:choose>
@@ -31,7 +31,7 @@
<xsl:when test="umbraco.library:IsLoggedOn()">
<xsl:variable name="mem" select="umbraco.library:GetCurrentMember()/@id"/>
<xsl:variable name="mem" select="uForum:GetCurrentMember()/@id"/>
<xsl:variable name="pages" select="uForum:MemberTopicPager($mem, $recordsPerPage, $pageNumber)"/>
<xsl:variable name="topics" select="uForum.raw:TopicsWithParticipation($mem, $recordsPerPage, $pageNumber)//topic"/>
+1 -1
View File
@@ -21,7 +21,7 @@
<xsl:when test="umbraco.library:IsLoggedOn()">
<xsl:variable name="mem">
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/@id"/>
<xsl:value-of select="uForum:GetCurrentMember()/@id"/>
</xsl:if>
</xsl:variable>
@@ -21,13 +21,13 @@
<xsl:variable name="mem">
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/@id"/>
<xsl:value-of select="uForum:GetCurrentMember()/@id"/>
</xsl:if>
</xsl:variable>
<xsl:template match="/">
<xsl:choose>
<xsl:when test="umbraco.library:GetCurrentMember()/bugMeNot = 1">
<xsl:when test="uForum:GetCurrentMember()/bugMeNot = 1">
<div class="alert" style="width:600px">
Currently you will not receive any notifications since your profile preference is set
to 'Do not send me any notifications or newsletters from our.umbraco.org'.
+1 -1
View File
@@ -21,7 +21,7 @@
<xsl:variable name="isHQ" select="uForum:IsInGroup('HQ')"/>
<xsl:variable name="mem">
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:value-of select="umbraco.library:GetCurrentMember()/@id"/>
<xsl:value-of select="uForum:GetCurrentMember()/@id"/>
</xsl:if>
</xsl:variable>
@@ -22,7 +22,7 @@
<div id="profile">
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:variable name="mem" select="umbraco.library:GetCurrentMember()"/>
<xsl:variable name="mem" select="uForum:GetCurrentMember()"/>
You are logged in as:
<xsl:value-of select="$mem/@nodeName" />
+1 -1
View File
@@ -16,7 +16,7 @@
<xsl:if test="umbraco.library:IsLoggedOn()">
<xsl:variable name="items" select="uPowers:ItemsVotedFor(umbraco.library:GetCurrentMember()/@id, 'powersProject')"/>
<xsl:variable name="items" select="uPowers:ItemsVotedFor(uForum:GetCurrentMember()/@id, 'powersProject')"/>
<ul>
<xsl:for-each select="$items/items/item/id">
+2 -2
View File
@@ -15,8 +15,8 @@
<xsl:variable name="minLevel" select="1" />
<xsl:variable name="isAdmin" select="uForum:IsInGroup('admin') or uForum:IsInGroup('wiki editor')"/>
<xsl:variable name="isLoggedOn" select="umbraco.library:IsLoggedOn()"/>
<xsl:variable name="mem"><xsl:if test="$isLoggedOn"><xsl:value-of select="umbraco.library:GetCurrentMember()/@id"/></xsl:if></xsl:variable>
<xsl:variable name="canVote" select="boolean( number(umbraco.library:GetCurrentMember()/reputationCurrent) &gt;= 25 )"/>
<xsl:variable name="mem"><xsl:if test="$isLoggedOn"><xsl:value-of select="uForum:GetCurrentMember()/@id"/></xsl:if></xsl:variable>
<xsl:variable name="canVote" select="boolean( number(uForum:GetCurrentMember()/reputationCurrent) &gt;= 25 )"/>
<xsl:variable name="isUmbracoHelp" select="$currentPage/@level > 3 and $currentPage/ancestor-or-self::* [@isDoc and @level = 3]/@nodeName = 'Umbraco Help'" />
<div id="wikivoting" class="voting rounded">
Binary file not shown.
+17
View File
@@ -25,6 +25,23 @@ namespace uForum.Library
return "";
}
public static XPathNodeIterator GetCurrentMember()
{
Member m = Member.GetCurrentMember();
if (m != null)
{
XmlDocument mXml = new XmlDocument();
mXml.LoadXml(m.ToXml(mXml, false).OuterXml);
XPathNavigator xp = mXml.CreateNavigator();
return xp.Select("/*");
}
XmlDocument xd = new XmlDocument();
xd.LoadXml(
"<error>No current member exists (best practice is to validate with 'isloggedon()' prior to this call)</error>");
var retVal = xd.CreateNavigator().Select("/");
return retVal;
}
public static string CleanBBCode(string html)
{