default_LinkGeneration.xsl 8.89 KB
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"	xmlns:php="http://php.net/xsl" >

	<xsl:variable name="var_ActiveProfileID"><xsl:value-of select="/content/XMLSite_Top/Account/BasisElement/SwitchProfileList/ShortProfile[@ActiveProfile=1]/@ID" /></xsl:variable>
	<xsl:variable name="var_ActiveAvatar"><xsl:value-of select="/content/XMLSite_Top/Account/BasisElement/SwitchProfileList/ShortProfile[@ActiveProfile=1]/@Avatar" /></xsl:variable>
	<xsl:variable name="var_ProfileNickName"><xsl:value-of select="/content/XMLSite_Top/Account/BasisElement/SwitchProfileList/ShortProfile[@ActiveProfile=1]/@NickName" /></xsl:variable>
	<xsl:variable name="empty"></xsl:variable>
	<xsl:variable name="space">&#160;</xsl:variable>
	<xsl:variable name="Tree"><xsl:value-of select="/content/@Tree" /></xsl:variable>
	<xsl:variable name="var_count_p" select="count(/content/XMLSite_Display/BasisClipboard/p)" />
	<xsl:variable name="var_link_meta"><xsl:value-of select="/content/XMLSite_Head/url/@m" /></xsl:variable>
	<xsl:variable name="var_link_special"><xsl:value-of select="/content/XMLSite_Head/url/@c" /></xsl:variable>
	<xsl:variable name="var_link_parameter"><xsl:value-of select="/content/XMLSite_Head/url/@p" /></xsl:variable>
	<xsl:variable name="var_link_url"><xsl:value-of select="/content/XMLSite_Head/url/@parameter" /></xsl:variable>
	<xsl:variable name="var_link_index"><xsl:value-of select="/content/XMLSite_Top/Account/XMLButtonGroup/Link/@url" /></xsl:variable>
	<xsl:variable name="var_link_host"><xsl:value-of select="/content/XMLSite_Top/Account/XMLButtonGroup/Link/@host" /></xsl:variable>
	<xsl:variable name="var_link_lang"><xsl:value-of select="/content/XMLSite_Head/url/@lang" /></xsl:variable>
	<xsl:variable name="var_link_hostIndex"><xsl:value-of select="$var_link_host" />/<xsl:value-of select="$var_link_index" /></xsl:variable>

	<xsl:variable name="var_more" select="'&lt;!--more--&gt;'"/>
	<xsl:variable name="var_moreStart" select="'&lt;!--more'"/>
	<xsl:variable name="var_moreEnd" select="'--&gt;'"/>

	<xsl:variable name="var_link_AccountManagement"><xsl:value-of select="php:function('XSLPHPFunction::getLinkAccountManagement', . )" disable-output-escaping="yes" /></xsl:variable>


<!-- besondere Links für Funktionen -->
	<!-- AccountManagement	 -->
	<xsl:variable name="var_link_changePassword"><xsl:value-of select="php:function('XSLPHPFunction::getLinkChangePassword', . )" disable-output-escaping="yes" /></xsl:variable>


	<xsl:template name="function_get_BasisClipboard">
		<xsl:param name="param_url" />
		<xsl:param name="param_kind" select="@name" />
		<xsl:param name="param_edit"/>

		<xsl:if test="not(starts-with($param_url,'http'))">
			<xsl:value-of select="$var_link_hostIndex"/>
		</xsl:if>

		<xsl:value-of select="concat($param_url,'&amp;','p[]=',$param_kind)"/>
		<xsl:if test="$param_edit = '1'" >
			<xsl:value-of select="concat('&amp;','p[]=editBC')"/>
		</xsl:if>

	</xsl:template>

	<xsl:template name="function_get_makeNew">
		<xsl:param name="param_url">0</xsl:param>
		<xsl:param name="param_kind">0</xsl:param>

		<xsl:if test="not(starts-with($param_url,'http'))">
			<xsl:value-of select="$var_link_hostIndex"/>
		</xsl:if>
		<xsl:value-of select="concat($param_url,'&amp;','p[]=',$param_kind,'&amp;','p[]=makeNew',$var_link_lang)"/>
	</xsl:template>

	<xsl:template name="function_add_makeNew">
		<xsl:param name="param_url">0</xsl:param>
		<xsl:param name="param_kind">0</xsl:param>

		<xsl:if test="not(starts-with($param_url,'http'))">
			<xsl:value-of select="$var_link_hostIndex"/>
		</xsl:if>
		<xsl:value-of select="concat($param_url,'&amp;','p[]=makeNew',$var_link_lang)"/>
	</xsl:template>

	<xsl:template name="function_add_addElementTo">
		<xsl:param name="param_url" select="$var_link_parameter"/>
		<xsl:value-of select="concat($param_url,'&amp;','p[]=addElementTo',$var_link_special)"/>
	</xsl:template>

	<xsl:template name="function_get_edit">
		<xsl:param name="param_url" select="$var_link_index" />
		<xsl:param name="param_kind">0</xsl:param>
		<xsl:param name="param_id"/>

		<xsl:if test="not(starts-with($param_url,'http'))">
			<xsl:value-of select="$var_link_hostIndex"/>
		</xsl:if>

		<xsl:choose>
			<xsl:when test="$param_url =  $var_link_index">
				<xsl:value-of select="concat('?','p[')"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="concat($param_url,'&amp;','p[')" />
			</xsl:otherwise>
		</xsl:choose>
		<xsl:value-of select="concat(']=edit','&amp;','p[]=ID','&amp;','p[]=',$param_id,$var_link_lang)"/>
	</xsl:template>

    <xsl:template name="function_get_showCategory">
		<xsl:param name="param_url" select="../../../../../@parameter"/>
		<xsl:param name="param_id" select="@BECategoryID"/>


		<xsl:if test="not(starts-with($param_url,'http'))">
			<xsl:value-of select="$var_link_hostIndex"/>
		</xsl:if>
		<xsl:value-of select="concat($param_url,'&amp;','p[]=CategoryContentList','&amp;','p[]=showList','&amp;','p[]=ID','&amp;','p[]=',$param_id,$var_link_lang)"/>
	</xsl:template>

	<xsl:template name="function_get_showSingle">
		<xsl:param name="param_url" select="$var_link_index" />
		<xsl:param name="param_kind">0</xsl:param>
		<xsl:param name="param_id" select="@ID"/>
		<xsl:param name="param_showBoth"/>

		<xsl:param name="param_c"/>

		<xsl:if test="not(starts-with($param_url,'http'))">
			<xsl:value-of select="$var_link_hostIndex"/>
		</xsl:if>
		<xsl:choose>
			<xsl:when test="$param_url =  $var_link_index or $param_url =''">
				<xsl:value-of select="concat('?','p[')"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="concat($param_url,'&amp;','p[')"/>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:choose>
			<xsl:when test="$param_showBoth != ''">
				]=showBoth
			</xsl:when>
			<xsl:otherwise>
				]=showSingle
			</xsl:otherwise>
		</xsl:choose>
		<xsl:value-of select="concat('&amp;','p[]=ID','&amp;','p[]=',$param_id)" />
		<xsl:if test="$param_c=1">
			<xsl:value-of select="$var_link_special"/>
		</xsl:if>
		<xsl:value-of select="$var_link_lang"/>
	</xsl:template>

	<xsl:template name="function_get_TagContentList">
		<xsl:param name="param_url" />
		<xsl:if test="not(starts-with($param_url,'http'))">
			<xsl:value-of select="$var_link_hostIndex"/>
		</xsl:if>
		<xsl:value-of select="concat($param_url,'&amp;','p[]=TagContentList','&amp;','p[]=showList','&amp;','p[]=ID','&amp;','p[]=')"/>
	</xsl:template>

	<xsl:template name="function_get_changeAccountPassword">
		<xsl:param name="param_url">0</xsl:param>
		<xsl:param name="param_kind">0</xsl:param>
		<xsl:value-of select="php:function('XSLPHPLinkGenerator::getLinkChangePassword', string($param_url),string($param_kind)  )" disable-output-escaping="yes" />
	</xsl:template>

	<xsl:template name="fnc_get_Last">
		<xsl:param name="param_id" select="@ID"/>
		<xsl:param name="param_kind" select="@PartOfObjVar"/>
		<xsl:param name="param_ad" select="'desc'"/>

		<xsl:value-of select="concat('&amp;','c[',$param_id,'][',$param_kind,'][0-',$param_ad,']',$var_link_lang,'#last')"/>

	</xsl:template>

	<xsl:template name="fnc_get_UrlAfterForm">
		<xsl:param name="param_url" select="../@parameter"/>
		<xsl:param name="param_class" select="@class"/>
		<xsl:param name="param_kind" select="'edit'"/>

		<xsl:choose>
			<xsl:when test="not($param_class='GroupProfileBE' or $param_class='TopicBE')">
				<xsl:value-of select="$param_url"/>
			</xsl:when>
			<xsl:when test="$param_class = 'GroupProfileBE'">
				<xsl:value-of select="concat($var_link_hostIndex,'?p[]=ProfilePreferenceManager','&amp;','p[]=showSingle','&amp;','p[]=ID','&amp;','p[]=',$var_ActiveProfileID)"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:call-template name="fnc_kill_p">
					<xsl:with-param name="param_kind" select="$param_kind"/>
				</xsl:call-template>
			</xsl:otherwise>
		</xsl:choose>

	</xsl:template>

	<xsl:template name="fnc_kill_p">
		<xsl:param name="param_url" select="$var_link_url"/>
		<xsl:param name="param_p" select="0"/>
		<xsl:param name="param_kind" select="edit"/>

		<xsl:choose>
			<xsl:when test="$param_kind='edit'">
				<xsl:value-of select="substring-before($param_url,'edit')"/>showSingle<xsl:value-of select="substring-after($param_url,'edit')"/>
			</xsl:when>
			<xsl:when test="$param_kind='makeNew'">
				<xsl:variable name="tmp_p">
					<xsl:call-template name="fnc_next_p">
						<xsl:with-param name="param_url" select="$param_url"/>
					</xsl:call-template>
		 		</xsl:variable>
				<xsl:value-of select="substring-before($param_url,concat('&amp;','p[', $tmp_p - 1))"/>
			</xsl:when>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="fnc_next_p">
		<xsl:param name="param_url" />
		<xsl:param name="param_p" select="0"/>

 		<xsl:choose>
			<xsl:when test="contains($param_url,concat('p[',$param_p))" >
				<xsl:call-template name="fnc_next_p">
					<xsl:with-param name="param_url" select="$param_url"/>
					<xsl:with-param name="param_p" select="$param_p + 1"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$param_p"/>
			</xsl:otherwise>
		</xsl:choose>


	</xsl:template>

</xsl:stylesheet>