<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY amp   "&#38;">
<!ENTITY copy   "&#169;">
<!ENTITY gt   "&#62;">
<!ENTITY hellip "&#8230;">
<!ENTITY laquo  "&#171;">
<!ENTITY lsaquo   "&#8249;">
<!ENTITY lsquo   "&#8216;">
<!ENTITY lt   "&#60;">
<!ENTITY nbsp   "&#160;">
<!ENTITY quot   "&#34;">
<!ENTITY raquo  "&#187;">
<!ENTITY rsaquo   "&#8250;">
<!ENTITY rsquo   "&#8217;">
]>
<!-- 
Implementations Skeleton - 01/10/2017
-
IMPLEMENTATION VARIABLES 
Define global implementation variables here, so that they may be accessed by all page types and in the info/debug tabs.
This also provides a convenient area for complicated logic to exist without clouding up the general xsl/html structure.
-
Contributors: A. Schwenkenberg
Last Updated: 10/2017
-->
<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">

	<!-- OU CAMPUS SYSTEM PARAMETERS - don't edit -->
	<!-- Current Page Info -->
	<xsl:param name="ou:action"/>		<!-- Page 'state' in OU Campus (prv = Preview, pub = Publish, edt = Edit, cmp = Compare) -->
	<xsl:param name="ou:uuid"/>		<!-- Unique Page ID -->
	<xsl:param name="ou:path"/>		<!-- Root-relative path to page output -->
	<xsl:param name="ou:dirname"/>		<!-- Root-relative path to current folder (USE "dirname" BELOW INSTEAD) -->
	<xsl:param name="ou:filename"/>		<!-- Filename of output -->
	<xsl:param name="ou:created" as="xs:dateTime"/>		<!-- Page Creation date/time -->
	<xsl:param name="ou:modified" as="xs:dateTime"/> 	<!-- Last Page Modification date/time -->
	<xsl:param name="ou:feed"/>		<!-- Path (root-relative) to RSS Feed that's assigned to current page -->

	<!-- Staging Server Info -->
	<xsl:param name="ou:servername"/>	<!-- Staging Server's Domain Name -->
	<xsl:param name="ou:root"/>		<!-- Path from root of staging server -->
	<xsl:param name="ou:site"/>		<!-- Site Name (same as foldername on staging server) -->
	<xsl:param name="ou:stagingpath"/>		<!-- Staging path of the file -->

	<!-- Production Server Info -->
	<xsl:param name="ou:target"/>		<!-- Name of Target Production Server -->
	<xsl:param name="ou:httproot"/>		<!-- Address of Target Production Server (from site settings) -->
	<xsl:param name="ou:ftproot"/>		<!-- Folder path to site root on Production Server (from site settings) -->
	<xsl:param name="ou:ftphome"/>		<!-- Initial subdirectory for site root on Production Server (from site settings) -->

	<!-- User Info -->
	<xsl:param name="ou:username"/>		<!-- Active user/publisher -->
	<xsl:param name="ou:lastname"/>		<!-- Active user/publisher -->
	<xsl:param name="ou:firstname"/> 	<!-- Active user/publisher -->
	<xsl:param name="ou:email"/>		<!-- Active user/publisher -->

	<!-- custom directory variables for reading global include files -->
	<!-- for multisite setups they need to exist on the same server -->
	<xsl:param name="ou:www-domain" /> <!-- where is the main domain -->
	<xsl:param name="ou:www-ftproot" /> <!-- where is the main ftp root -->


	<!-- 

DIRECTORY VARIABLES (add "ou:" before variable name - in XSL only) 

Example: 
<xsl:param name="ou:theme-color" /> 
... Where "theme-color" is the actual Directory Variable name
-->
	<xsl:param name="enable-social-meta-tag-output" select="true()" />
	<!-- standard json-path directory variable for file location -->
	<!--<xsl:param name="ou:json-path"/>
<xsl:variable name="json-path" select="if ($ou:json-path = '') then '/_resources/includes/programs.data.aspx' else $ou:json-path"/>-->

	<!-- for the following, all are set with start and end slash: /folder/ -->
	<xsl:param name="ou:breadcrumb-start"/> <!-- top level breadcrumb -->
	<xsl:variable name="breadcrumb-start" select="if (ends-with($ou:breadcrumb-start, '/')) then $ou:breadcrumb-start else concat($ou:breadcrumb-start, '/')"/>

	<!-- standard navigation start directory variable for navigation -->
	<xsl:param name="ou:navigation-start"/>
	<xsl:variable name="navigation-start" select="if ($ou:navigation-start = '') then $dirname 
												  else (if (ends-with($ou:navigation-start, '/')) 
												  then $ou:navigation-start else concat($ou:navigation-start, '/'))"/>
	<xsl:param name="ou:header-path"/>
	<xsl:variable name="header-path" select="if (ou:textual-content($ou:header-path) = '') then '/_resources/includes/header.inc' else $ou:header-path"/>
	<!-- GLOBAL VARIABLES - Implementation Specific -->
	<xsl:variable name="body-class" />	<!-- Stores a CSS class to be assigned to a wysiwyg region -->

	<!-- server information -->
	<xsl:variable name="server-type" select="'asp'"/> 
	<xsl:variable name="include-type" select="'c#'"/>
	<xsl:variable name="index-file" select="'default'"/> 
	<xsl:variable name="extension" select="'html'"/> 
	<xsl:param name="current-breadcrumb"/>


	<!-- for various concatenation purposes -->
	<xsl:variable name="dirname" select="if(string-length($ou:dirname) = 1) then $ou:dirname else concat($ou:dirname,'/')" />
	<xsl:variable name="domain" select="substring($ou:httproot,1,string-length($ou:httproot)-1)" /> 				

	<!-- navigation info -->
	<xsl:variable name="nav-file" select="'_nav.ounav'" />

	<!-- section property files -->
	<xsl:variable name="props-file" select="'_props.pcf'"/> 	
	<xsl:variable name="props-path" select="concat($ou:root, $ou:site, $dirname, $props-file)"/>		

	<xsl:variable name="section-title">
		<xsl:choose>
			<!-- test if there is a props file before trying to read it -->
			<xsl:when test="doc-available($props-path)">
				<xsl:value-of select="document($props-path)/document/ouc:properties[@label='config']/parameter[@name='breadcrumb']"/>
			</xsl:when>
			<xsl:otherwise><xsl:value-of select="$heading"/></xsl:otherwise>
		</xsl:choose>
	</xsl:variable>	

	<!-- page information -->
	<xsl:variable name="page-type" select="ou:pcf-param('page-type')"/>
	<xsl:variable name="page-title" select="/document/ouc:properties/title" />
	<xsl:variable name="breadcrumb" select="ou:pcf-param('breadcrumb')" />
	<xsl:variable name="heading" select="ou:pcf-param('heading')" />
	<xsl:variable name="options" select="ou:pcf-param('options')" />
	<xsl:variable name="net-form-control" select="ou:pcf-param('net-form-control')" />
	<xsl:variable name="img-top" select="ou:pcf-param('img-top')" />
	<xsl:variable name="img-top-alt" select="ou:pcf-param('img-top-alt')" />

	<xsl:variable name="sidenav-param-nav"  select="concat($navigation-start, $nav-file)"/>
	<xsl:variable name="sidenav-param-path" select="($ou:path)"/>

	<!-- microsite -->
	<xsl:param name="ou:microsite-school"/>
	<xsl:param name="ou:microsite-navigation"/>

	<xsl:param name="ou:microsite-nav-resources-title"/>
	<xsl:param name="ou:microsite-nav-resources"/>

	<xsl:param name="ou:microsite-nav-info-for-title"/>
	<xsl:param name="ou:microsite-nav-info-for"/>

	<xsl:param name="ou:microsite-nav-give-title"/>
	<xsl:param name="ou:microsite-nav-give"/>

	<xsl:variable name="microsite-school" select="if ($ou:microsite-school = '') then 'Enter Directory Variable [microsite-school]' else $ou:microsite-school"/>
	<xsl:variable name="microsite-navigation" select="if ($ou:microsite-navigation = '') then '/_resources/includes/microsite/health-professions/school-nav.inc' else $ou:microsite-navigation"/>

	<xsl:variable name="microsite-nav-resources-title" select="if ($ou:microsite-nav-resources-title = '') then 'Resources' else $ou:microsite-nav-resources-title"/>
	<xsl:variable name="microsite-nav-resources" select="if ($ou:microsite-nav-resources = '') then '/_resources/includes/microsite/health-professions/resources.inc' else $ou:microsite-nav-resources"/>

	<xsl:variable name="microsite-nav-info-for-title" select="if ($ou:microsite-nav-info-for-title = '') then 'Info for...' else $ou:microsite-nav-info-for-title"/>
	<xsl:variable name="microsite-nav-info-for" select="if ($ou:microsite-nav-info-for = '') then '/_resources/includes/microsite/health-professions/info-for.inc' else $ou:microsite-nav-info-for"/>

	<xsl:variable name="microsite-nav-give-title" select="if ($ou:microsite-nav-give-title = '') then 'Give' else $ou:microsite-nav-give-title"/>
	<xsl:variable name="microsite-nav-give" select="if ($ou:microsite-nav-give = '') then '/_resources/includes/microsite/health-professions/give.inc' else $ou:microsite-nav-give"/>

	<xsl:variable name="school-name">
		<xsl:choose>
			<!-- test if there is a props file before trying to read it -->
			<xsl:when test="doc-available($props-path)">
				<xsl:value-of select="document($props-path)/document/ouc:properties[@label='config']/parameter[@name='school-name']"/>
			</xsl:when>
			<xsl:otherwise><xsl:if test="$ou:action!='pub'">System Message: Props File Not Found</xsl:if></xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<xsl:variable name="school-nav">
		<xsl:choose>
			<!-- test if there is a props file before trying to read it -->
			<xsl:when test="doc-available($props-path)">
				<xsl:value-of select="document($props-path)/document/ouc:properties[@label='config']/parameter[@name='school-nav']"/>
			</xsl:when>
			<xsl:otherwise><xsl:if test="$ou:action!='pub'">System Message: Props File Not Found</xsl:if></xsl:otherwise>
		</xsl:choose>
	</xsl:variable>

	<!-- OU Campus action state variables -->
	<xsl:variable name="is-pub" select="$ou:action = ('pub','cmp')"/> <!-- Returns true if the page is in Publish or Compare Mode -->
	<xsl:variable name="is-edt" select="$ou:action = 'edt'"/> <!-- Returns true if the page is in Edit Mode -->
	<xsl:variable name="is-prv" select="$ou:action = 'prv'"/> <!-- Returns true if the page is in Preview Mode -->

	<!-- Returns the full page publish path -->
	<xsl:variable name="page-pub-path" select="$domain || $ou:path" />



	<xsl:param name="override-og-type" select="if(ou:pcf-param('override-og-type')!='') then ou:pcf-param('override-og-type') => normalize-space() else ou:multiedit-field('fb-type') => normalize-space()"/>
	<xsl:param name="override-og-image" select="if(ou:pcf-param('override-og-image') != '') then $domain || ou:pcf-param('override-og-image') => normalize-space() else  ou:multiedit-field('fb-image') => normalize-space()"/>
	<xsl:param name="override-og-image-alt" select="ou:pcf-param('override-og-image-alt') => normalize-space()"/>
	<xsl:param name="override-og-description" select="if(ou:pcf-param('override-og-description')!='') then ou:pcf-param('override-og-description') => normalize-space() else ou:multiedit-field('fb-description') => normalize-space()"/>
	<xsl:param name="override-og-title" select="if(ou:pcf-param('override-og-title')!='') then ou:pcf-param('override-og-title') => normalize-space() else ou:multiedit-field('fb-title')  => normalize-space()"/>
	<xsl:param name="override-twitter-card-description" select="if(ou:pcf-param('override-twitter-card-description')!='') then ou:pcf-param('override-twitter-card-description') => normalize-space() else ou:multiedit-field('twitter-description') => normalize-space()"/>
	<xsl:param name="override-twitter-card-title" select="if(ou:pcf-param('override-twitter-card-title')!='') then ou:pcf-param('override-twitter-card-title') => normalize-space() else ou:multiedit-field('twitter-title') => normalize-space()"/>
	<xsl:param name="override-twitter-card-site" select="if(ou:pcf-param('override-twitter-card-site')!='') then ou:pcf-param('override-twitter-card-site') => normalize-space() else ou:multiedit-field('twitter-site') => normalize-space()"/>
	<xsl:param name="override-twitter-card-creator" select="if(ou:pcf-param('override-twitter-card-creator')!='') then ou:pcf-param('override-twitter-card-creator') => normalize-space() else ou:multiedit-field('twitter-creator') => normalize-space()"/>
	<xsl:param name="override-twitter-card-image" select="if (ou:pcf-param('override-twitter-card-image') != '') then $domain || ou:pcf-param('override-twitter-card-image') => normalize-space() else ou:multiedit-field('twitter-image') => normalize-space()"/>
	<xsl:param name="override-twitter-card-image-alt" select="ou:pcf-param('override-twitter-card-image-alt') => normalize-space()"/>
	<xsl:param name="override-twitter-card-type" select="ou:pcf-param('override-twitter-card-type') => normalize-space()"/>




</xsl:stylesheet>