<?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;">
]>


<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"
	expand-text="yes">

	<xsl:import href="common-2020.xsl"/>

	<xsl:template name="template-headcode"/>
	<xsl:template name="template-footcode"/>

	<xsl:template name="page-content">
		
		<xsl:variable name="search-root" select="if(ou:pcf-param('search-root') != '') then ou:pcf-param('search-root') else $dirname" />
		
		<xsl:variable name="filters">
			<!-- location filter is used so that only news posts that are located in a given folder and its subfolders are returned -->
			<xsl:text>[starts-with(@href,'{replace($search-root, '/[^/]+$', '/')}')]</xsl:text>
			<xsl:if test="string-length(ou:pcf-param('post-year'))=4">
				<xsl:text>[contains(pubDate/text(), '{ou:pcf-param('post-year')}')]</xsl:text>
			</xsl:if>

			<xsl:if test="$tags!=''">
				<xsl:variable name="logical-operator" select="if(ou:pcf-param('filter-option') = 'all') then ' and ' else ' or '" />

				<xsl:text>[</xsl:text>
				<xsl:for-each select="tokenize($tags, ',')">
					<xsl:choose>
						<xsl:when test="contains(., '''')">
							<xsl:value-of select="'tags/tag=&quot;' || .=>normalize-space()=>replace('&quot;', '') || '&quot;'" />
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="'tags/tag=''' || normalize-space(.) || ''''" />
						</xsl:otherwise>
					</xsl:choose>
					<xsl:if test="position() != last()">
						<xsl:value-of select="$logical-operator" />
					</xsl:if>
				</xsl:for-each>
				<xsl:text>]</xsl:text>
			</xsl:if>

		</xsl:variable>
		
		<!-- see breadcrumbs xsl -->
		<div id="breadcrumb">
			<xsl:call-template name="breadcrumb">
				<xsl:with-param name="path" select="$ou:dirname"/>								
			</xsl:call-template>
		</div>

		<!-- <div id="page-title"> -->
		<!--BeginEditable Name="Page Title" Description="Users can edit."-->		
		<!-- <h1><xsl:value-of select="$page-title"/></h1> -->
		<!--EndEditable Name="Page Title"-->
		<!-- </div> -->

<main>

		<!-- If Sidebar is enabled - Edited sidebar editable region per ticket #41335 - OU Support-->
		<xsl:if test="$sidebar = 'true'">
			<div class="sidebar-show">Toggle display of sidebar content</div>			
			<div id="sidebar-left">				
			<xsl:apply-templates select="ouc:div[@label='sidebar left']" />				
			</div>
			<div id="sidebar-right">
			<xsl:apply-templates select="ouc:div[@label='sidebar right']" />
			</div>
		</xsl:if>



<div id="content">		
		<h1><xsl:value-of select='ouc:properties[@label="config"]/parameter[@name="heading"]'/></h1>	

			<!-- begin edit
			<xsl:choose>
				<xsl:when test="$sidebar = 'true'">
					<div id="content-wrap-sidebar">
						<xsl:call-template name="dmc">
						<xsl:with-param name="options">
							<datasource>{ou:pcf-param('dsn')}</datasource>
							<xpath>item{$filters}</xpath>
							<type>listing</type>
							<items_per_page>{ou:pcf-param('items-per-page')}</items_per_page>
							<querystring_control>true</querystring_control>
							<search_columns>title,description,searchtags</search_columns>
							<sort>date(pubDate) desc</sort>
							<form_filter_options>{ou:pcf-param('form-filter-options')}</form_filter_options>
						</xsl:with-param>

						<xsl:with-param name="script-name">news</xsl:with-param>
						<xsl:with-param name="debug" select="$dmc-debug" />
					</xsl:call-template>
						<xsl:apply-templates select="ouc:div[@label='maincontent']" />
					</div>
				</xsl:when>
				<xsl:otherwise> -->
				<xsl:apply-templates select="ouc:div[@label='maincontent']" />	
						<xsl:call-template name="dmc">
						<xsl:with-param name="options">
							<datasource>{ou:pcf-param('dsn')}</datasource>
							<xpath>item{$filters}</xpath>
							<type>standard</type>
							<items_per_page>{ou:pcf-param('items-per-page')}</items_per_page>
							<querystring_control>true</querystring_control>
							<search_columns>title,description,searchtags</search_columns>
							<sort>date(pubDate) desc</sort>
							<form_filter_options>{ou:pcf-param('form-filter-options')}</form_filter_options>
						</xsl:with-param>

						<xsl:with-param name="script-name">news</xsl:with-param>
						<xsl:with-param name="debug" select="$dmc-debug" />
					</xsl:call-template>
						
					
				<!-- </xsl:otherwise>
			</xsl:choose>
			end edit -->
	
		<div id="last-updated-bar">
			<!-- edited for ticket #36630 -->
			<p>Last Updated <xsl:value-of select="ou:dateFromDateTime($ou:modified,'/')" /></p>
		</div>
	</div>
	<hr class="clearall" />
		</main>



	</xsl:template>

</xsl:stylesheet>