<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<!-- 
Info and Help Tab
A reference guide for content editors
-->
<xsl:stylesheet version="3.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:ou="http://omniupdate.com/XSL/Variables"
    xmlns:fn="http://omniupdate.com/XSL/Functions"
    xmlns:ouc="http://omniupdate.com/XSL/Variables"
    exclude-result-prefixes="ou xsl xs fn ouc">
		
<xsl:import href="common.xsl"/>

	<xsl:template match="/">
		<xsl:text disable-output-escaping="yes">&lt;</xsl:text>!DOCTYPE html<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
		<xsl:text disable-output-escaping="yes">&lt;</xsl:text>html lang="en"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
		<head>		
			<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"/>
			<xsl:call-template name="common-headcode"/> <!-- common headcode -->

			<style>
			#ox-fullpage-edit-button, .ox-regioneditbutton {
			display: none;
			}
			dl dd{
			word-wrap: break-word;
			margin-right: 1.5em;
			margin-left: 0;
			}
			</style>
		</head>
		<body id="info">

		<div id="main" class="ou silver">
	
	
				<div class="container">
					<div id="sidebar">
					


					
					<h2>Template Image</h2>
					<a href="#templateimage" class="open-lightbox">
						<img min-width="450px" height="auto" src="/_resources/images/documentation/{$pageType}.gif" alt="screen shot of page type with each editable area labeled" title="{$pageType}"/>
					</a>
					
					<h2>Variables</h2>
						<dl>
							<xsl:copy-of select="ou:displayVariable('Page Type',$pageType)"/>	
							<xsl:copy-of select="ou:displayVariable('Page Title',$pageTitle)"/>	
							<xsl:copy-of select="ou:displayVariable('Created Date',$ou:created)"/>	
							<xsl:copy-of select="ou:displayVariable('Modified Date',$ou:modified)"/>									
							<xsl:copy-of select="ou:displayVariable('Root Relative Path',replace($ou:path,'info.html','.aspx'))"/>	
							<xsl:copy-of select="ou:displayVariable('Fully Qualified Path',concat($domain,replace($ou:path,'info.html','.aspx')))"/>	
							<xsl:copy-of select="ou:displayVariable('Bedework XML',$bedeworkXML)"/>													
							<xsl:copy-of select="ou:displayVariable('OUCampus RSS Feed, if any',$ou:feed)"/>	
						</dl>
						<dl>
							<xsl:copy-of select="ou:displayVariable('Navigation Start',$navigationStart)"/>	
							<xsl:copy-of select="ou:displayVariable('Breadcrumb Start',$breadcrumbStart)"/>		
							<xsl:copy-of select="ou:displayVariable('Access Key, if any',$ou:accessKey)"/>							
						</dl>
						
						<em> If no template image is shown, an admin may upload an image named <xsl:value-of select="$pageType"/>.gif to /_resoures/images/documentation/</em>

						
						<!-- 
						Optionally, use this column for display values for global variables  such as current page type, layout, gallery, etc.
						-->			
					</div>
					<div id="content">
						
						<!-- 
						
						Display Editable Content Depending on Page Type, from page in _documentation (pull from staging so publish is not required)
					
						-->
					<xsl:variable name="documentation-path">	
						<xsl:value-of select="concat($ou:root,$ou:site,'/_documentation/page-types/')"/>
						<xsl:choose><!-- decide which pcf to pull content from. -->
						 	<xsl:when test="$pageType='content_main' or $pageType='4h_content'">main-and-4h-content</xsl:when> <!-- main site and 4h content -->					 	
						 	<xsl:when test="$pageType='divisions_lower'">divisions-pages</xsl:when> <!-- division lower level -->
							<xsl:when test="$pageType='counties_home'">county-home</xsl:when> <!-- county home pages -->
							<xsl:when test="$pageType='counties_programs'">county-programs</xsl:when> <!-- county programs pages -->
							<xsl:when test="$pageType='landing'">landing-pages</xsl:when> <!-- main site landing pages -->
							<xsl:when test="$pageType='county_map'">county-map</xsl:when> <!-- divisions home -->
							<xsl:when test="$pageType='divisions_home'">divisions-home</xsl:when> <!-- divisions home -->
							<xsl:when test="$pageType='4h_home'">4h-home</xsl:when> <!-- uaex home -->
							<xsl:when test="$pageType='uaex_home'">uaex-home</xsl:when> <!-- uaex home -->
							<xsl:when test="$pageType='az_interior' or $pageType='az_archive'">a-to-z</xsl:when>
							<xsl:otherwise>default</xsl:otherwise>
						</xsl:choose><xsl:value-of select="'.pcf'"/> 				
					</xsl:variable>
					
					<xsl:if test="doc-available($documentation-path)">
						<xsl:variable name="documentation-pcf" select="document($documentation-path)"/>
						<xsl:apply-templates select="$documentation-pcf/*:document/content//maincontent/node()" mode="copy"/>		
						<div class="popup-holder">				
							<xsl:call-template name="lightboxes">
								<xsl:with-param name="content" select="$documentation-pcf/*:document/content"/>
							</xsl:call-template><!-- see special-templates.xsl -->	
							<div class="lightbox" id="templateimage">
								<div class="lightbox-holder">
									<!-- video-holder -->
									<div class="video-holder">
										<img src="/_resources/images/documentation/{$pageType}.gif" alt="screen shot of page type with each editable area labeled" title="{$pageType}"/>
									</div>
								</div>
							</div>				
						</div>
					</xsl:if>
					
					<em>Admins may edit the content displayed here at <xsl:value-of select="replace($documentation-path,concat($ou:root,$ou:site),'')"/></em>
					
								 
					</div> <!-- end right col -->
				</div> <!-- end row -->
		
		</div> <!-- end ou silver -->
						

		
		</body>
				<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/html<xsl:text disable-output-escaping="yes">&gt;</xsl:text>	

	</xsl:template>
	
	<!-- display a variable for debug purposes -->
	<xsl:function name="ou:displayVariable">
	<xsl:param name="name"/> <xsl:param name="var"/>
	<dt><xsl:value-of select="$name"/></dt> <dd><xsl:value-of select="$var"/></dd>
	</xsl:function>	
	
</xsl:stylesheet>
