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

	<xsl:template name="fnc_mkMeta">
		<xsl:param name="param_link_url"/>
		<xsl:param name="param_ident" />
		<xsl:param name="param_value" />
		<div class="MetaContent">
			<xsl:attribute name="style">
				<xsl:choose>
					<xsl:when test="/content/XMLSite_Head/url/@m">
						display:block;z-index:2;
					</xsl:when>
					<xsl:otherwise>
						display:none;z-index:-1;
					</xsl:otherwise>
				</xsl:choose>
			</xsl:attribute>
 			<div id="metaHead" class="metaHead">
				<span class="right">
					<a id="metaClose" class="buttonClose" href="{$param_link_url}">
						<img class="buttonTransparent" src="include/Forest/mensch.coop/Images/buttonTransparent.png"/>
					</a>
				</span>
				<p class="metaHead">
					<xsl:choose>
						<xsl:when test="$param_ident='c'">
							<xsl:apply-templates select="/content/Language/lang[@name='clipboard']"/>
						</xsl:when>
						<xsl:when test="$param_ident='h'">
							<xsl:apply-templates select="/content/Language/lang[@name='help']"/>
						</xsl:when>
						<xsl:when test="$param_ident='t'">
							<xsl:if test="//BasisClipboard/BasisClipboard[@BasisClipboard='TagContentList']">
								<a class="metaHead" href="javascript:fnc_showTagcloud()"><xsl:apply-templates select="/content/Language/lang[@name='tagcloud']"/></a>
							</xsl:if>
							<xsl:apply-templates select="/content/Language/lang[@name='tagcloud']"/>
						</xsl:when>
						<xsl:when test="$param_ident='i'">
							<xsl:apply-templates select="/content/Language/lang[@name='infobox']"/>
						</xsl:when>
						<xsl:when test="$param_ident='s'">
							<xsl:apply-templates select="/content/Language/lang[@name='search']"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:apply-templates select="/content/Language/lang[@name='metaLayer']"/>
						</xsl:otherwise>
					</xsl:choose>
				</p>
			</div>
		  	<div id="tag" class="metaTag">
				<xsl:attribute name="style">
					<xsl:choose>
						<xsl:when test="$param_ident='t'">
							display:block;
						</xsl:when>
						<xsl:otherwise>
							display:none;
						</xsl:otherwise>
					</xsl:choose>
				</xsl:attribute>
 			 	<xsl:choose>
					<xsl:when test="$param_ident='t' and $param_value != 0">
						<xsl:for-each select="//BasisClipboard[@BasisClipboard='TagContentList']">
							<span id="Taglist">
								<xsl:apply-templates select=".">
									<xsl:with-param name="param_show" select="1" />
								</xsl:apply-templates>
							</span>
							<p id="TagcloudHidden" style="display:none;">
						 		<xsl:apply-templates select="../List/BasisElementAddons/TagCloud"/>
						 	</p>
						</xsl:for-each>

					</xsl:when>
					<xsl:otherwise>
						<p class="center">
						<xsl:choose>
							<xsl:when test="//BasisClipboard[@last]">
								<xsl:choose>
									<xsl:when test="//BasisClipboard[@last]/BasisElement">
										<xsl:apply-templates select="//BasisClipboard[@last]/BasisElement/BasisElementAddons/TagCloud">
											<xsl:with-param name="param_url">
												<xsl:call-template name="function_get_showSingle">
													<xsl:with-param name="param_url" select="//BasisClipboard[@last]/@parameter"/>
													<xsl:with-param name="param_id" select="//BasisClipboard[@last]/BasisElement/@ID"/>
												</xsl:call-template>
											</xsl:with-param>
										</xsl:apply-templates>
									</xsl:when>
									<xsl:when test="//BasisClipboard[@last]/BasisClipboard">
										<xsl:apply-templates select="//BasisClipboard[@last]/BasisClipboard/List/BasisElementAddons/TagCloud"/>									</xsl:when>
									<xsl:otherwise>
										<xsl:apply-templates select="//BasisClipboard[@last]/List/BasisElementAddons/TagCloud"/>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:when>
							<xsl:otherwise>
								<xsl:choose>
									<xsl:when test="BasisClipboard/BasisElement">
										<xsl:apply-templates select="BasisClipboard/BasisElement/BasisElementAddons/TagCloud"/>
									</xsl:when>
									<xsl:when test="BasisClipboard/BasisClipboard/BasisElement">
										<xsl:apply-templates select="BasisClipboard/BasisClipboard/BasisElement/BasisElementAddons/TagCloud"/>
									</xsl:when>
									<xsl:when test="BasisClipboard/BasisClipboard">
										<xsl:apply-templates select="BasisClipboard/BasisClipboard/List/BasisElementAddons/TagCloud"/>
									</xsl:when>
									<xsl:when test="BasisClipboard">
										<xsl:apply-templates select="BasisClipboard/List/BasisElementAddons/TagCloud"/>
									</xsl:when>
									<xsl:when test="BasisElement">
										<xsl:apply-templates select="BasisElement/BasisElementAddons/TagCloud"/>
									</xsl:when>
								</xsl:choose>
							</xsl:otherwise>
						</xsl:choose>
						</p>
					</xsl:otherwise>
				</xsl:choose>
			</div>

		  	<div id="info">
				<xsl:attribute name="style">
					<xsl:choose>
						<xsl:when test="$param_ident='i'">
							display:block;
						</xsl:when>
						<xsl:otherwise>
							display:none;
						</xsl:otherwise>
					</xsl:choose>
				</xsl:attribute>
				<xsl:call-template name="fnc_mkInfo">
					<xsl:with-param name="param_id"><xsl:call-template name="fnc_lastID"/></xsl:with-param>
				</xsl:call-template>
			</div>

			<div id="search">
				<xsl:attribute name="style">
					<xsl:choose>
						<xsl:when test="$param_ident='s'">
							display:block;
						</xsl:when>
						<xsl:otherwise>
							display:none;
						</xsl:otherwise>
					</xsl:choose>
				</xsl:attribute>
				<xsl:call-template name="fnc_mkSearch"/>
			</div>

			<div id="help">
				<xsl:attribute name="style">
					<xsl:choose>
						<xsl:when test="$param_ident='s'">
							display:block;
						</xsl:when>
						<xsl:otherwise>
							display:none;
						</xsl:otherwise>
					</xsl:choose>
				</xsl:attribute>
				<xsl:call-template name="fnc_mkHelp"/>
			</div>

			<div id="clipboard">
				<xsl:attribute name="style">
					<xsl:choose>
						<xsl:when test="$param_ident='s'">
							display:block;
						</xsl:when>
						<xsl:otherwise>
							display:none;
						</xsl:otherwise>
					</xsl:choose>
				</xsl:attribute>
				<a class="buttonedit button" href="{concat($var_link_hostIndex,'?p[]=ProfilePreferenceManager&amp;p[]=Clipboard&amp;p[]=editBC')}" title="editiere Meine Sammlung">
					<xsl:value-of select="$space"/>
				</a>
			</div>

 			<div id="jsMeta">
				<xsl:attribute name="style">
					display:none;
				</xsl:attribute>
				<xsl:value-of select="$space" />
			</div>
		</div>
	</xsl:template>

	<xsl:template name="fnc_lastID">
		<xsl:choose>
			<xsl:when test="//BasisClipboard[@last]">
				<xsl:choose>
					<xsl:when test="//BasisClipboard[@last]/BasisElement">
						<xsl:value-of select="//BasisClipboard[@last]/BasisElement/@ID"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="//BasisClipboard[@last]/../@ID"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:choose>
					<xsl:when test="BasisClipboard/BasisElement">
						<xsl:value-of select="BasisClipboard/BasisElement/@ID"/>
					</xsl:when>
					<xsl:when test="BasisClipboard/BasisClipboard/BasisElement">
						<xsl:value-of select="BasisClipboard/BasisClipboard/BasisElement/@ID"/>
					</xsl:when>
					<xsl:when test="BasisElement">
							<xsl:value-of select="BasisElement/@ID"/>
					</xsl:when>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="fnc_mkSearch">
		<!-- toDo: ohne js implementation -->
<!-- http://localhost/losp/service.php?output=xml&p[0]=showSingle&p[1]=ID&p[2]=5&p[]=TopicBC&p[]=showAll&c[5][TopicBC][0][ListCondition-in][Name][1]=homi -->
		<form name="Formular" method="post" enctype="multipart/form-data" onsubmit="fnc_search();return false;">
			<p>
				<label class="editText"><xsl:apply-templates select="/content/Language/lang[@name='searchAim']"/></label>
				<select id="searchAim" name="searchAim" size="1">
					<option value="TopicBC"><xsl:apply-templates select="/content/Language/lang[@name='TopicBE']"/></option>
					<option value="ProfileBC"><xsl:apply-templates select="/content/Language/lang[@name='Profile']"/>/<xsl:apply-templates select="/content/Language/lang[@name='GroupProfileBE']"/></option>
				</select>
			</p>
			<p>
				<label class="editText"><xsl:apply-templates select="/content/Language/lang[@name='searchValue']"/></label>
				<input id="searchValue" name="searchValue" type="text"/>
				<div class="post_fnc ok left" title="{$lang_search}">
					<input class="post_fnc" type="submit" name="" title="{$lang_search}"/>
				</div>
			</p>
		</form>
	</xsl:template>
	<xsl:template name="fnc_mkHelp">
		<!--  toDo: dynamische Hilfe seite, automatische erstellung der indexe (s. js) -->
		<p>
			<span class="bold"><xsl:apply-templates select="/content/Language/lang[@name='chooseHelp']"/></span>
		</p>
		<ul>
			<li>
				<a href="javascript:fnc_xmlChooserShowHelp('192')">Erstellung von Content (eines Elementes)</a>
			</li>
			<ul>
				<li>
					<a href="javascript:fnc_xmlChooserShowHelp('881')">Erstellung von einer Kampagne (eines Elementes)</a>
				</li>
				<li>
					<a href="javascript:fnc_xmlChooserShowHelp('897')">Der Texteditor</a>
				</li>
			</ul>
			<li>
				<a href="javascript:fnc_xmlChooserShowHelp('191')">Die Metaebene</a>
			</li>
		</ul>
	</xsl:template>
	<xsl:template name="fnc_mkInfo">
		<xsl:param name="param_id"/>
		<xsl:choose>
			<xsl:when test="number($param_id)=$param_id">
				<xsl:for-each select="//BasisElement[@ID=$param_id and (@view='showSingle' or @view='showBoth' or ../../XMLSite_Display)]">
						<p class="head">
							<xsl:apply-templates select="/content/Language/lang[@name='infobox']"/>
							-
							<xsl:value-of select="Headline/Element" />
						</p>
						 <ul class="infobox">
						 	<li>
								<span class="bold"><xsl:apply-templates select="/content/Language/lang[@name='elem']"/>-ID:<xsl:text> </xsl:text></span>
								<xsl:value-of select="@ID"/>
							</li>
						 	<li>
								<span class="bold"><xsl:apply-templates select="/content/Language/lang[@name='creation']"/>:</span><br/>
								<span class="info">
								<xsl:apply-templates select="/content/Language/lang[@name='from']"/><xsl:call-template name="fnc_mkAuthorLink"><xsl:with-param name="param_style" select="0" /></xsl:call-template>
								<xsl:value-of select="$space"/><xsl:apply-templates select="/content/Language/lang[@name='at']"/> <xsl:call-template name="fnc_mkFullDate">
										<xsl:with-param name="param_date">
											<xsl:choose>
												<xsl:when test="CreateDate">
													<xsl:value-of select="CreateDate"/>
												</xsl:when>
												<xsl:otherwise>
													 <xsl:value-of select="Element[@objvar='CreateDate']" />
												</xsl:otherwise>
											</xsl:choose>
										</xsl:with-param>
									</xsl:call-template>
								</span>
							</li>
							<xsl:if test="BasisElementAddons/Infobox/BELastEdits/Action[1]">
							<li>
								<span class="bold"><xsl:apply-templates select="/content/Language/lang[@name='lastModification']"/>:</span><br/>
								<span class="info">
								<xsl:apply-templates select="/content/Language/lang[@name='from']"/> <xsl:value-of select="BasisElementAddons/Infobox/BELastEdits/Action[1]/@NickName"/>
								<xsl:value-of select="$space"/><xsl:apply-templates select="/content/Language/lang[@name='at']"/><xsl:call-template name="fnc_mkFullDate">
										<xsl:with-param name="param_date" select="BasisElementAddons/Infobox/BELastEdits/Action[1]/@CDate"/>
									</xsl:call-template>
								</span>
								</li>
							</xsl:if>
						</ul>
						 <ul class="infobox">
							<li class="bold"><xsl:apply-templates select="/content/Language/lang[@name='lastDirectUnder']"/>:</li>
	 							<xsl:apply-templates select="BasisElementAddons/Infobox/LastLinkerBC">
 									<xsl:with-param name="param_short" select="2" />
 								</xsl:apply-templates>
	 							<xsl:apply-templates select="BasisElementAddons/Infobox/LastBasisElementBC">
 									<xsl:with-param name="param_short" select="2" />
 								</xsl:apply-templates>
						 </ul>

				</xsl:for-each>
			</xsl:when>
			<xsl:otherwise>
				Fehler ich bin keine ID <xsl:value-of select="$param_id"/>! Fehler wird schnellst möglichst behoben!
			</xsl:otherwise>
		</xsl:choose>
		<xsl-value-of select="$space"/>
	</xsl:template>
	<xsl:template match="TagCloud">
		<xsl:param name="param_url" select="../../../@parameter"/>
		<xsl:param name="param_kind">0</xsl:param>
		<xsl:param name="param_meta">0</xsl:param>
		<xsl:param name="param_list"/>
		<xsl:param name="param_inputBE"/>
		<xsl:choose>
			<xsl:when test="@edit and $param_meta=0">
				<xsl:apply-templates select="Element">
					<xsl:with-param name="param_inputBE" select="$param_inputBE"/>
				</xsl:apply-templates>
			</xsl:when>
			<xsl:otherwise>
				<xsl:variable name="var_get_TagContentList">
					<xsl:call-template name="function_get_TagContentList" >
						<xsl:with-param name="param_url">
							<xsl:choose>
								<xsl:when test="$param_url">
									<xsl:value-of select="$param_url"/>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="concat('?',../../Link/@parameter)"/>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:with-param>
					</xsl:call-template>
				</xsl:variable>
				<xsl:if test="TreeTagList/Tag">
					<xsl:for-each select="TreeTagList/Tag">
						<xsl:variable name="var_size"><xsl:value-of select="@size" /></xsl:variable>
						<xsl:value-of select="' '"/>
						<strong style="font-size:{2*$var_size}%;">
	    	      			<a class="tagCloud" href="{$var_get_TagContentList}{@TagID}&amp;m[tag]=1{$var_link_lang}"  title="{@count} mal wurde dieser Tag bis zur {../../@depth} Subebene verwendet ">
								<xsl:value-of select="@TagName" />
							</a>
						</strong>
					</xsl:for-each>
				</xsl:if>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="RootTagList">
		<xsl:param name="param_url"/>
		<xsl:variable name="var_get_TagContentList">
			<xsl:call-template name="function_get_TagContentList" >
				<xsl:with-param name="param_url" select="$param_url"/>
			</xsl:call-template>
		</xsl:variable>
		<xsl:for-each select="Tag">
   			<a href="{$var_get_TagContentList}{@TagID}&amp;m[tag]=1"  title="{@count} mal wurde dieser Tag bis zur {../../@depth} Subebene verwendet ">
				<xsl:value-of select="@TagName" />
			</a>
			<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
		</xsl:for-each>
	</xsl:template>

</xsl:stylesheet>