root/branches/bedework-leibson/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/default/default.xsl

Revision 2323 (checked in by bleibson, 4 years ago)

Pulled English strings out of file.

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet
3   version="1.0"
4   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5   xmlns="http://www.w3.org/1999/xhtml">
6
7 <xsl:output
8   method="xml"
9   indent="no"
10   media-type="text/html"
11   doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
12   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
13   standalone="yes"
14   omit-xml-declaration="yes"/>
15
16 <!-- =========================================================
17
18               DEMONSTRATION CALENDAR STYLESHEET
19
20                   MainCampus Calendar Suite
21
22      This stylesheet is devoid of school branding.  It is a good
23      starting point for development of a customized calendar.
24
25      For detailed instructions on how to work with the XSLT
26      stylesheets included with this distribution, please see the
27      Bedework Design Guide at
28      http://www.bedework.org/bedework/update.do?artcenterkey=24
29
30 ===============================================================  -->
31 <!-- **********************************************************************
32     Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
33
34     Redistribution and use of this distribution in source and binary forms,
35     with or without modification, are permitted provided that:
36        The above copyright notice and this permission notice appear in all
37         copies and supporting documentation;
38
39         The name, identifiers, and trademarks of Rensselaer Polytechnic
40         Institute are not used in advertising or publicity without the
41         express prior written permission of Rensselaer Polytechnic Institute;
42
43     DISCLAIMER: The software is distributed" AS IS" without any express or
44     implied warranty, including but not limited to, any implied warranties
45     of merchantability or fitness for a particular purpose or any warrant)'
46     of non-infringement of any current or pending patent rights. The authors
47     of the software make no representations about the suitability of this
48     software for any particular purpose. The entire risk as to the quality
49     and performance of the software is with the user. Should the software
50     prove defective, the user assumes the cost of all necessary servicing,
51     repair or correction. In particular, neither Rensselaer Polytechnic
52     Institute, nor the authors of the software are liable for any indirect,
53     special, consequential, or incidental damages related to the software,
54     to the maximum extent the law permits. -->
55
56   <!-- ================================= -->
57   <!--  DEMO PUBLIC CALENDAR STYLESHEET  -->
58   <!-- ================================= -->
59
60   <!-- URL of resources common to all bedework apps (javascript, images) -->
61   <xsl:variable name="resourceCommons">../../../bedework-common</xsl:variable>
62
63   <!-- DEFINE INCLUDES -->
64   <!-- cannot use the resourceCommons variable in xsl:include paths -->
65   <xsl:include href="../../../bedework-common/default/default/errors.xsl"/>
66   <xsl:include href="../../../bedework-common/default/default/messages.xsl"/>
67   <xsl:include href="../../../bedework-common/default/default/util.xsl"/>
68   <xsl:include href="./strings.xsl"/>
69
70   <!-- DEFINE GLOBAL CONSTANTS -->
71
72   <!-- URL of html resources (images, css, other html); by default this is
73        set to the application root -->
74   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
75
76   <!-- URL of the XSL template directory -->
77   <!-- The approot is an appropriate place to put
78        included stylesheets and xml fragments. These are generally
79        referenced relatively (like errors.xsl and messages.xsl above);
80        this variable is here for your convenience if you choose to
81        reference it explicitly.  It is not used in this stylesheet, however,
82        and can be safely removed if you so choose. -->
83   <xsl:variable name="appRoot" select="/bedework/approot"/>
84
85   <!-- Properly encoded prefixes to the application actions; use these to build
86        urls; allows the application to be used without cookies or within a portal.
87        These urls are rewritten in header.jsp and simply passed through for use
88        here. Every url includes a query string (either ?b=de or a real query
89        string) so that all links constructed in this stylesheet may begin the
90        query string with an ampersand. -->
91   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
92   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/main/setSelection"/>
93   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/calendar/fetchPublicCalendars"/>
94   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/main/setViewPeriod"/>
95   <xsl:variable name="listEvents" select="/bedework/urlPrefixes/main/listEvents"/>
96   <xsl:variable name="eventView" select="/bedework/urlPrefixes/event/eventView"/>
97   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/event/addEventRef"/>
98   <xsl:variable name="export" select="/bedework/urlPrefixes/misc/export"/>
99   <xsl:variable name="search" select="/bedework/urlPrefixes/search/search"/>
100   <xsl:variable name="search-next" select="/bedework/urlPrefixes/search/next"/>
101   <xsl:variable name="calendar-fetchForExport" select="/bedework/urlPrefixes/calendar/fetchForExport"/>
102   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mail/mailEvent"/>
103   <!-- Unused
104   <xsl:variable name="showPage" select="/bedework/urlPrefixes/main/showPage"/>
105    -->
106  <xsl:variable name="stats" select="/bedework/urlPrefixes/stats/stats"/>
107
108   <!-- URL of the web application - includes web context -->
109   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/>
110
111   <!-- Other generally useful global variables -->
112   <xsl:variable name="privateCal">/ucal</xsl:variable>
113   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
114   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
115   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
116
117
118   <!-- MAIN TEMPLATE -->
119   <xsl:template match="/">
120     <html lang="en">
121       <head>
122         <title><xsl:value-of select="$bwStr-Root-PageTitle"/></title>
123         <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
124         <!-- load css -->
125         <xsl:choose>
126           <xsl:when test="/bedework/appvar[key='style']/value='red'">
127             <link rel="stylesheet" href="{$resourcesRoot}/default/default/red.css"/>
128           </xsl:when>
129           <xsl:when test="/bedework/appvar[key='style']/value='green'">
130             <link rel="stylesheet" href="{$resourcesRoot}/default/default/green.css"/>
131           </xsl:when>
132           <xsl:otherwise>
133             <link rel="stylesheet" href="{$resourcesRoot}/default/default/blue.css"/>
134           </xsl:otherwise>
135         </xsl:choose>
136         <link rel="stylesheet" href="{$resourcesRoot}/default/default/subColors.css"/>
137         <link rel="stylesheet" type="text/css" media="print" href="{$resourcesRoot}/default/default/print.css" />
138         <!-- load javascript -->
139         <xsl:if test="/bedework/page='event' or /bedework/page='displayCalendarForExport'">
140           <script type="text/javascript" src="/bedework-common/javascript/jquery/jquery-1.3.2.min.js">&#160;</script>
141           <script type="text/javascript" src="/bedework-common/javascript/jquery/jquery-ui-1.7.1.custom.min.js">&#160;</script>
142           <link rel="stylesheet" href="/bedework-common/javascript/jquery/css/custom-theme/jquery-ui-1.7.1.custom.css"/>
143           <link rel="stylesheet" href="/bedework-common/javascript/jquery/css/custom-theme/bedeworkJquery.css"/>
144           <script type="text/javascript" src="{$resourcesRoot}/resources/javascript/bedework.js">&#160;</script>
145           <xsl:if test="/bedework/page='displayCalendarForExport'">
146             <script type="text/javascript">
147               <xsl:comment>
148               $.datepicker.setDefaults({
149                 constrainInput: true,
150                 dateFormat: "yy-mm-dd",
151                 showOn: "both",
152                 buttonImage: "<xsl:value-of select='$resourcesRoot'/>/images/calIcon.gif",
153                 buttonImageOnly: true,
154                 gotoCurrent: true,
155                 duration: ""
156               });
157               $(document).ready(function() {
158                 $("#bwExportCalendarWidgetStartDate").datepicker({
159                 }).attr("readonly", "readonly");
160                 $("#bwExportCalendarWidgetEndDate").datepicker({
161                 }).attr("readonly", "readonly");
162               });
163               </xsl:comment>
164             </script>
165           </xsl:if>
166         </xsl:if>
167         <!-- address bar icon -->
168         <link rel="icon" type="image/ico" href="{$resourcesRoot}/images/bedework.ico" />
169       </head>
170       <body>
171         <xsl:call-template name="headBar"/>
172         <xsl:if test="/bedework/error">
173           <div id="errors">
174             <xsl:apply-templates select="/bedework/error"/>
175           </div>
176         </xsl:if>
177         <xsl:call-template name="tabs"/>
178         <xsl:call-template name="navigation"/>
179         <xsl:call-template name="searchBar"/>
180         <xsl:choose>
181           <xsl:when test="/bedework/page='event'">
182             <!-- show an event -->
183             <xsl:apply-templates select="/bedework/event"/>
184           </xsl:when>
185           <xsl:when test="/bedework/page='eventList'">
186             <!-- show a list of discrete events in a time period -->
187             <xsl:apply-templates select="/bedework/events" mode="eventList"/>
188           </xsl:when>
189           <xsl:when test="/bedework/page='showSysStats'">
190             <!-- show system stats -->
191             <xsl:call-template name="stats"/>
192           </xsl:when>
193           <xsl:when test="/bedework/page='calendarList'">
194             <!-- show a list of all calendars -->
195             <xsl:apply-templates select="/bedework/calendars"/>
196           </xsl:when>
197           <xsl:when test="/bedework/page='displayCalendarForExport'">
198             <!-- page for calendar export (can optionally be replaced by
199                  a pop-up widget; see the calendars template) -->
200             <xsl:apply-templates select="/bedework/currentCalendar" mode="export"/>
201           </xsl:when>
202           <xsl:when test="/bedework/page='searchResult'">
203             <!-- display search results -->
204             <xsl:call-template name="searchResult"/>
205           </xsl:when>
206           <xsl:otherwise>
207             <!-- otherwise, show the eventsCalendar -->
208             <!-- main eventCalendar content -->
209             <xsl:choose>
210               <xsl:when test="/bedework/periodname='Day'">
211                 <xsl:call-template name="listView"/>
212               </xsl:when>
213               <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
214                 <xsl:choose>
215                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
216                     <xsl:call-template name="listView"/>
217                   </xsl:when>
218                   <xsl:otherwise>
219                     <xsl:call-template name="weekView"/>
220                   </xsl:otherwise>
221                 </xsl:choose>
222               </xsl:when>
223               <xsl:when test="/bedework/periodname='Month'">
224                 <xsl:choose>
225                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
226                     <xsl:call-template name="listView"/>
227                   </xsl:when>
228                   <xsl:otherwise>
229                     <xsl:call-template name="monthView"/>
230                   </xsl:otherwise>
231                 </xsl:choose>
232               </xsl:when>
233               <xsl:otherwise>
234                 <xsl:call-template name="yearView"/>
235               </xsl:otherwise>
236             </xsl:choose>
237           </xsl:otherwise>
238         </xsl:choose>
239         <!-- footer -->
240         <xsl:call-template name="footer"/>
241       </body>
242     </html>
243   </xsl:template>
244
245   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
246   <!-- these templates are separated out for convenience and to simplify the default template -->
247
248   <xsl:template name="headBar">
249     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="logoTable">
250       <tr>
251         <td colspan="3" id="logoCell"><a href="/bedework/"><img src="{$resourcesRoot}/images/bedeworkLogo.gif" width="292" height="75" border="0" alt="Bedework"/></a></td>
252         <td colspan="2" id="schoolLinksCell">
253           <h2><xsl:value-of select="$bwStr-HdBr-PublicCalendar"/></h2>
254           <a href="{$privateCal}"><xsl:value-of select="$bwStr-HdBr-PersonalCalendar"/></a> |
255           <a href="http://www.youruniversityhere.edu"><xsl:value-of select="$bwStr-HdBr-UniversityHome"/></a> |
256           <a href="http://www.bedework.org/"><xsl:value-of select="$bwStr-HdBr-OtherLink"/></a>
257         </td>
258       </tr>
259     </table>
260     <table id="curDateRangeTable"  cellspacing="0">
261       <tr>
262         <td class="sideBarOpenCloseIcon">
263           &#160;
264           <!--
265           we may choose to implement calendar selection in the public calendar
266           using a sidebar; leave this comment here for now.
267           <xsl:choose>
268             <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
269               <a href="?setappvar=sidebar(opened)">
270                 <img alt="open sidebar" src="{$resourcesRoot}/resources/sideBarArrowOpen.gif" width="21" height="16" border="0" align="left"/>
271               </a>
272             </xsl:when>
273             <xsl:otherwise>
274               <a href="?setappvar=sidebar(closed)">
275                 <img alt="close sidebar" src="{$resourcesRoot}/resources/sideBarArrowClose.gif" width="21" height="16" border="0" align="left"/>
276               </a>
277             </xsl:otherwise>
278           </xsl:choose>-->
279         </td>
280         <td class="date">
281           <xsl:choose>
282             <xsl:when test="/bedework/page='event'">
283               <xsl:value-of select="$bwStr-HdBr-EventInformation"/>
284             </xsl:when>
285             <xsl:when test="/bedework/page='showSysStats' or
286                             /bedework/page='calendars'">
287               &#160;
288             </xsl:when>
289             <xsl:otherwise>
290               <xsl:value-of select="/bedework/firstday/longdate"/>
291               <xsl:if test="/bedework/periodname!='Day'">
292                 -
293                 <xsl:value-of select="/bedework/lastday/longdate"/>
294               </xsl:if>
295             </xsl:otherwise>
296           </xsl:choose>
297         </td>
298         <td class="rssPrint">
299           <a href="javascript:window.print()" title="{$bwStr-HdBr-PrintThisView}">
300             <img alt="print this view" src="{$resourcesRoot}/images/std-print-icon.gif" width="20" height="14" border="0"/>   
301               <xsl:value-of select="$bwStr-HdBr-Print"/>
302           </a>
303           <a class="rss" href="{$listEvents}&amp;setappvar=summaryMode(details)&amp;skinName=rss-list&amp;days=3" title="{$bwStr-HdBr-RSSFeed}"><xsl:value-of select="$bwStr-HdBr-RSS"/></a>
304         </td>
305       </tr>
306     </table>
307   </xsl:template>
308
309   <xsl:template name="tabs">
310     <div id="bwTabs">
311       <ul>
312         <li>
313           <xsl:if test="/bedework/page='eventscalendar' and /bedework/periodname='Day'">
314             <xsl:attribute name="class">selected</xsl:attribute>
315           </xsl:if>
316           <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$curdate}"><xsl:value-of select="$bwStr-Tabs-Day"/></a>
317         </li>
318         <li>
319           <xsl:if test="/bedework/page='eventscalendar' and /bedework/periodname='Week' or /bedework/periodname=''">
320             <xsl:attribute name="class">selected</xsl:attribute>
321           </xsl:if>
322           <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$curdate}"><xsl:value-of select="$bwStr-Tabs-Week"/></a>
323         </li>
324         <li>
325           <xsl:if test="/bedework/page='eventscalendar' and /bedework/periodname='Month'">
326             <xsl:attribute name="class">selected</xsl:attribute>
327           </xsl:if><a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$curdate}"><xsl:value-of select="$bwStr-Tabs-Month"/></a>
328         </li>
329         <li>
330           <xsl:if test="/bedework/page='eventscalendar' and /bedework/periodname='Year'">
331             <xsl:attribute name="class">selected</xsl:attribute>
332           </xsl:if><a href="{$setViewPeriod}&amp;viewType=yearView&amp;date={$curdate}"><xsl:value-of select="$bwStr-Tabs-Year"/></a>
333         </li>
334         <li>
335           <xsl:if test="/bedework/page='eventList'">
336             <xsl:attribute name="class">selected</xsl:attribute>
337           </xsl:if><a href="{$listEvents}"><xsl:value-of select="$bwStr-Tabs-List"/></a>
338         </li>
339       </ul>
340     </div>
341   </xsl:template>
342
343   <xsl:template name="navigation">
344     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
345       <tr>
346         <td class="leftCell">
347           <a id="prevViewPeriod" href="{$setViewPeriod}&amp;date={$prevdate}"><img src="{$resourcesRoot}/images/std-arrow-left.gif" alt="previous" width="13" height="16" class="prevImg" border="0"/></a>
348           <a id="nextViewPeriod" href="{$setViewPeriod}&amp;date={$nextdate}"><img src="{$resourcesRoot}/images/std-arrow-right.gif" alt="next" width="13" height="16" class="nextImg" border="0"/></a>
349           <xsl:choose>
350             <xsl:when test="/bedework/periodname='Year'">
351               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
352             </xsl:when>
353             <xsl:when test="/bedework/periodname='Month'">
354               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
355             </xsl:when>
356             <xsl:when test="/bedework/periodname='Week'">
357               <xsl:value-of select="$bwStr-Navi-WeekOf"/> <xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
358             </xsl:when>
359             <xsl:otherwise>
360               <xsl:value-of select="/bedework/firstday/longdate"/>
361             </xsl:otherwise>
362           </xsl:choose>
363         </td>
364         <td class="todayButton">
365           <a href="{$setViewPeriod}&amp;viewType=todayView&amp;date={$curdate}">
366             <img src="{$resourcesRoot}/images/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
367           </a>
368         </td>
369         <td align="right" class="gotoForm">
370           <form name="calForm" method="post" action="{$setViewPeriod}">
371              <table border="0" cellpadding="0" cellspacing="0">
372               <tr>
373                 <xsl:if test="/bedework/periodname!='Year'">
374                   <td>
375                     <select name="viewStartDate.month">
376                       <xsl:for-each select="/bedework/monthvalues/val">
377                         <xsl:variable name="temp" select="."/>
378                         <xsl:variable name="pos" select="position()"/>
379                         <xsl:choose>
380                           <xsl:when test="/bedework/monthvalues[start=$temp]">
381                             <option value="{$temp}" selected="selected">
382                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
383                             </option>
384                           </xsl:when>
385                           <xsl:otherwise>
386                             <option value="{$temp}">
387                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
388                             </option>
389                           </xsl:otherwise>
390                         </xsl:choose>
391                       </xsl:for-each>
392                     </select>
393                   </td>
394                   <xsl:if test="/bedework/periodname!='Month'">
395                     <td>
396                       <select name="viewStartDate.day">
397                         <xsl:for-each select="/bedework/dayvalues/val">
398                           <xsl:variable name="temp" select="."/>
399                           <xsl:variable name="pos" select="position()"/>
400                           <xsl:choose>
401                             <xsl:when test="/bedework/dayvalues[start=$temp]">
402                               <option value="{$temp}" selected="selected">
403                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
404                               </option>
405                             </xsl:when>
406                             <xsl:otherwise>
407                               <option value="{$temp}">
408                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
409                               </option>
410                             </xsl:otherwise>
411                           </xsl:choose>
412                         </xsl:for-each>
413                       </select>
414                     </td>
415                   </xsl:if>
416                 </xsl:if>
417                 <td>
418                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
419                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
420                 </td>
421                 <td>
422                   <input name="submit" type="submit" value="{$bwStr-Navi-Go}"/>
423                 </td>
424               </tr>
425             </table>
426           </form>
427         </td>
428         <td class="rightCell">
429         </td>
430       </tr>
431     </table>
432   </xsl:template>
433
434   <xsl:template name="searchBar">
435     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="searchBarTable">
436        <tr>
437          <td class="leftCell">
438            <xsl:choose>
439              <xsl:when test="/bedework/selectionState/selectionType = 'collections'">
440                <xsl:value-of select="$bwStr-SrcB-TopicalArea"/>
441                <strong>
442                  <xsl:call-template name="substring-afterLastInstanceOf">
443                    <xsl:with-param name="string" select="/bedework/appvar[key='curCollection']/value"/>
444                    <xsl:with-param name="char">/</xsl:with-param>
445                  </xsl:call-template>
446                </strong>
447              </xsl:when>
448              <xsl:when test="/bedework/selectionState/selectionType = 'search'">
449                <xsl:value-of select="$bwStr-SrcB-CurrentSearch"/><xsl:text> </xsl:text><xsl:value-of select="/bedework/search"/>
450              </xsl:when>
451              <xsl:otherwise><!-- view -->
452                <xsl:value-of select="$bwStr-SrcB-View"/>
453                <form name="selectViewForm" method="post" action="{$setSelection}">
454                 <select name="viewName" onchange="submit()" >
455                   <xsl:if test="/bedework/page = 'eventList'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if>
456                   <xsl:for-each select="/bedework/views/view">
457                     <xsl:variable name="name" select="name"/>
458                     <xsl:choose>
459                       <xsl:when test="name=/bedework/selectionState/view/name">
460                         <option value="{$name}" selected="selected"><xsl:value-of select="name"/></option>
461                       </xsl:when>
462                       <xsl:otherwise>
463                         <option value="{$name}"><xsl:value-of select="name"/></option>
464                       </xsl:otherwise>
465                     </xsl:choose>
466                   </xsl:for-each>
467                 </select>
468               </form>
469              </xsl:otherwise>
470            </xsl:choose>
471            <span class="link"><a href="{$setSelection}"><xsl:value-of select="$bwStr-SrcB-DefaultView"/></a> | <a href="{$fetchPublicCalendars}"><xsl:value-of select="$bwStr-SrcB-AllTopicalAreas"/></a></span>
472          </td>
473          <td class="rightCell">
474             <xsl:if test="/bedework/page!='searchResult'">
475               <form name="searchForm" id="searchForm" method="post" action="{$search}">
476                 <xsl:value-of select="$bwStr-SrcB-Search"/>:
477                 <input type="text" name="query" size="15">
478                   <xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute>
479                 </input>
480                 <input type="submit" name="submit" value="{$bwStr-SrcB-Go}"/>
481               </form>
482               <xsl:text> </xsl:text>
483             </xsl:if>
484             <xsl:choose>
485               <xsl:when test="/bedework/periodname='Day' or /bedework/page='eventList'">
486                 <img src="{$resourcesRoot}/images/std-button-listview-off.gif" width="46" height="21" border="0"
487                       alt="{$bwStr-SrcB-ToggleListCalView}"/>
488               </xsl:when>
489               <xsl:when test="/bedework/periodname='Year'">
490                 <img src="{$resourcesRoot}/images/std-button-calview-off.gif" width="46" height="21" border="0" alt="{$bwStr-SrcB-ToggleListCalView}"/>
491               </xsl:when>
492               <xsl:when test="/bedework/periodname='Month'">
493                 <xsl:choose>
494                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
495                     <a href="{$setup}&amp;setappvar=monthViewMode(cal)" title="{$bwStr-SrcB-ToggleListCalView}">
496                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0"
497                             alt="{$bwStr-SrcB-ToggleListCalView}"/>
498                     </a>
499                   </xsl:when>
500                   <xsl:otherwise>
501                     <a href="{$setup}&amp;setappvar=monthViewMode(list)" title="{$bwStr-SrcB-ToggleListCalView}">
502                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0"
503                             alt="{$bwStr-SrcB-ToggleListCalView}"/>
504                     </a>
505                   </xsl:otherwise>
506                 </xsl:choose>
507               </xsl:when>
508               <xsl:otherwise>
509                 <xsl:choose>
510                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
511                     <a href="{$setup}&amp;setappvar=weekViewMode(cal)" title="{$bwStr-SrcB-ToggleListCalView}">
512                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0"
513                             alt="{$bwStr-SrcB-ToggleListCalView}"/>
514                     </a>
515                   </xsl:when>
516                   <xsl:otherwise>
517                     <a href="{$setup}&amp;setappvar=weekViewMode(list)" title="{$bwStr-SrcB-ToggleListCalView}">
518                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0"
519                             alt="{$bwStr-SrcB-ToggleListCalView}"/>
520                     </a>
521                   </xsl:otherwise>
522                 </xsl:choose>
523               </xsl:otherwise>
524             </xsl:choose>
525             <xsl:choose>
526               <xsl:when test="/bedework/page = 'eventList'">
527                 <xsl:choose>
528                   <xsl:when test="/bedework/appvar[key='listEventsSummaryMode']/value='details'">
529                     <a href="{$listEvents}&amp;setappvar=listEventsSummaryMode(summary)" title="{$bwStr-SrcB-ToggleSummDetView}">
530                       <img src="{$resourcesRoot}/images/std-button-summary.gif" width="62" height="21" border="0"
531                             alt="{$bwStr-SrcB-ToggleSummDetView}"/>
532                     </a>
533                   </xsl:when>
534                   <xsl:otherwise>
535                     <a href="{$listEvents}&amp;setappvar=listEventsSummaryMode(details)" title="{$bwStr-SrcB-ToggleSummDetView}">
536                       <img src="{$resourcesRoot}/images/std-button-details.gif" width="62" height="21" border="0"
537                             alt="{$bwStr-SrcB-ToggleSummDetView}"/>
538                     </a>
539                   </xsl:otherwise>
540                 </xsl:choose>
541               </xsl:when>
542               <xsl:when test="/bedework/periodname='Year' or
543                               (/bedework/periodname='Month' and
544                               (/bedework/appvar[key='monthViewMode']/value='cal' or
545                                not(/bedework/appvar[key='monthViewMode']))) or
546                               (/bedework/periodname='Week' and
547                               (/bedework/appvar[key='weekViewMode']/value='cal' or
548                                not(/bedework/appvar[key='weekViewMode'])))">
549                 <xsl:choose>
550                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
551                     <img src="{$resourcesRoot}/images/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
552                   </xsl:when>
553                   <xsl:otherwise>
554                     <img src="{$resourcesRoot}/images/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
555                   </xsl:otherwise>
556                 </xsl:choose>
557               </xsl:when>
558               <xsl:otherwise>
559                 <xsl:choose>
560                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
561                     <a href="{$setup}&amp;setappvar=summaryMode(summary)" title="{$bwStr-SrcB-ToggleSummDetView}">
562                       <img src="{$resourcesRoot}/images/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
563                     </a>
564                   </xsl:when>
565                   <xsl:otherwise>
566                     <a href="{$setup}&amp;setappvar=summaryMode(details)" title="{$bwStr-SrcB-ToggleSummDetView}">
567                       <img src="{$resourcesRoot}/images/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
568                     </a>
569                   </xsl:otherwise>
570                 </xsl:choose>
571               </xsl:otherwise>
572             </xsl:choose>
573             <a href="{$setup}">
574               <xsl:if test="/bedework/page='eventList'">
575                 <xsl:attribute name="href"><xsl:value-of select="$listEvents"/></xsl:attribute>
576               </xsl:if>
577               <img src="{$resourcesRoot}/images/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/>
578             </a>
579           </td>
580        </tr>
581     </table>
582   </xsl:template>
583
584   <!--==== SINGLE EVENT ====-->
585   <xsl:template match="event">
586     <xsl:variable name="calPath" select="calendar/encodedPath"/>
587     <xsl:variable name="guid" select="guid"/>
588     <xsl:variable name="recurrenceId" select="recurrenceId"/>
589     <xsl:variable name="statusClass">
590       <xsl:choose>
591         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
592         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
593         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
594       </xsl:choose>
595     </xsl:variable>
596     <h2 class="{$statusClass}">
597       <a id="linkToEvent" href="javascript:showLink('{$urlPrefix}/event/eventView.do?calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}')" title="{$bwStr-SgEv-GenerateLinkToThisEvent}">
598        <xsl:copy-of select="$bwStr-SgEv-LinkToThisEvent"/>
599      </a>
600       <xsl:if test="status='CANCELLED'"><xsl:copy-of select="$bwStr-SgEv-Canceled"/><xsl:text> </xsl:text></xsl:if>
601       <xsl:choose>
602         <xsl:when test="link != ''">
603           <xsl:variable name="link" select="link"/>
604           <a href="{$link}">
605             <xsl:value-of select="summary"/>
606           </a>
607         </xsl:when>
608         <xsl:otherwise>
609           <xsl:value-of select="summary"/>
610         </xsl:otherwise>
611       </xsl:choose>
612     </h2>
613     <table id="eventTable" cellpadding="0" cellspacing="0">
614       <tr>
615         <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-When"/></td>
616         <td class="fieldval">
617           <!-- always display local time -->
618           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
619           <xsl:if test="start/allday = 'false'">
620             <span class="time"><xsl:value-of select="start/time"/></span>
621           </xsl:if>
622           <xsl:if test="(end/longdate != start/longdate) or
623                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
624           <xsl:if test="end/longdate != start/longdate">
625             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
626           </xsl:if>
627           <xsl:choose>
628             <xsl:when test="start/allday = 'true'">
629               <span class="time"><em><xsl:copy-of select="$bwStr-SgEv-AllDay"/></em></span>
630             </xsl:when>
631             <xsl:when test="end/longdate != start/longdate">
632               <span class="time"><xsl:value-of select="end/time"/></span>
633             </xsl:when>
634             <xsl:when test="end/time != start/time">
635               <span class="time"><xsl:value-of select="end/time"/></span>
636             </xsl:when>
637           </xsl:choose>
638           <!-- if timezones are not local, or if floating add labels: -->
639           <xsl:if test="start/timezone/islocal = 'false' or end/timezone/islocal = 'false'">
640             <xsl:text> </xsl:text>
641             --
642             <strong>
643               <xsl:choose>
644                 <xsl:when test="start/floating = 'true'">
645                   <xsl:copy-of select="$bwStr-SgEv-FloatingTime"/>
646                 </xsl:when>
647                 <xsl:otherwise>
648                   <xsl:copy-of select="$bwStr-SgEv-LocalTime"/>
649                 </xsl:otherwise>
650               </xsl:choose>
651             </strong>
652             <br/>
653           </xsl:if>
654           <!-- display in timezone if not local or floating time) -->
655           <xsl:if test="(start/timezone/islocal = 'false' or end/timezone/islocal = 'false') and start/floating = 'false'">
656             <xsl:choose>
657               <xsl:when test="start/timezone/id != end/timezone/id">
658                 <!-- need to display both timezones if they differ from start to end -->
659                 <table border="0" cellspacing="0" id="tztable">
660                   <tr>
661                     <td>
662                       <strong><xsl:copy-of select="$bwStr-SgEv-Start"/></strong>
663                     </td>
664                     <td>
665                       <xsl:choose>
666                         <xsl:when test="start/timezone/islocal='true'">
667                           <xsl:value-of select="start/dayname"/>,
668                           <xsl:value-of select="start/longdate"/>
669                           <xsl:text> </xsl:text>
670                           <span class="time"><xsl:value-of select="start/time"/></span>
671                         </xsl:when>
672                         <xsl:otherwise>
673                           <xsl:value-of select="start/timezone/dayname"/>,
674                           <xsl:value-of select="start/timezone/longdate"/>
675                           <xsl:text> </xsl:text>
676                           <span class="time"><xsl:value-of select="start/timezone/time"/></span>
677                         </xsl:otherwise>
678                       </xsl:choose>
679                     </td>
680                     <td>
681                       --
682                       <strong><xsl:value-of select="start/timezone/id"/></strong>
683                     </td>
684                   </tr>
685                   <tr>
686                     <td>
687                       <strong><xsl:copy-of select="$bwStr-SgEv-End"/></strong>
688                     </td>
689                     <td>
690                       <xsl:choose>
691                         <xsl:when test="end/timezone/islocal='true'">
692                           <xsl:value-of select="end/dayname"/>,
693                           <xsl:value-of select="end/longdate"/>
694                           <xsl:text> </xsl:text>
695                           <span class="time"><xsl:value-of select="end/time"/></span>
696                         </xsl:when>
697                         <xsl:otherwise>
698                           <xsl:value-of select="end/timezone/dayname"/>,
699                           <xsl:value-of select="end/timezone/longdate"/>
700                           <xsl:text> </xsl:text>
701                           <span class="time"><xsl:value-of select="end/timezone/time"/></span>
702                         </xsl:otherwise>
703                       </xsl:choose>
704                     </td>
705                     <td>
706                       --
707                       <strong><xsl:value-of select="end/timezone/id"/></strong>
708                     </td>
709                   </tr>
710                 </table>
711               </xsl:when>
712               <xsl:otherwise>
713                 <!-- otherwise, timezones are the same: display as a single line  -->
714                 <xsl:value-of select="start/timezone/dayname"/>, <xsl:value-of select="start/timezone/longdate"/><xsl:text> </xsl:text>
715                 <xsl:if test="start/allday = 'false'">
716                   <span class="time"><xsl:value-of select="start/timezone/time"/></span>
717                 </xsl:if>
718                 <xsl:if test="(end/timezone/longdate != start/timezone/longdate) or
719                               ((end/timezone/longdate = start/timezone/longdate) and (end/timezone/time != start/timezone/time))"> - </xsl:if>
720                 <xsl:if test="end/timezone/longdate != start/timezone/longdate">
721                   <xsl:value-of select="substring(end/timezone/dayname,1,3)"/>, <xsl:value-of select="end/timezone/longdate"/><xsl:text> </xsl:text>
722                 </xsl:if>
723                 <xsl:choose>
724                   <xsl:when test="start/allday = 'true'">
725                     <span class="time"><em> <xsl:copy-of select="$bwStr-SgEv-AllDay"/></em></span>
726                   </xsl:when>
727                   <xsl:when test="end/timezone/longdate != start/timezone/longdate">
728                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
729                   </xsl:when>
730                   <xsl:when test="end/timezone/time != start/timezone/time">
731                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
732                   </xsl:when>
733                 </xsl:choose>
734                 <xsl:text> </xsl:text>
735                 --
736                 <strong><xsl:value-of select="start/timezone/id"/></strong>
737               </xsl:otherwise>
738             </xsl:choose>
739           </xsl:if>
740         </td>
741         <th class="icalIcon" rowspan="2">
742           <div id="eventIcons">
743             <a href="{$privateCal}/event/addEventRef.do?calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="{$bwStr-SgEv-AddEventToMyCalendar}" target="myCalendar">
744               <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon.gif" width="20" height="26" border="0" alt="Add event to MyCalendar"/>
745               <xsl:copy-of select="$bwStr-SgEv-AddToMyCalendar"/>
746             </a>
747             <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
748             <a href="{$export}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;contentName={$eventIcalName}" title="{$bwStr-SgEv-DownloadEvent}">
749               <img src="{$resourcesRoot}/images/std-ical_icon.gif" width="20" height="26" border="0" alt="Download this event"/>
750              <xsl:copy-of select="$bwStr-SgEv-Download"/></a>
751           </div>
752         </th>
753       </tr>
754       <tr>
755         <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Where"/></td>
756         <td class="fieldval">
757           <xsl:choose>
758             <xsl:when test="location/link=''">
759               <xsl:value-of select="location/address"/>
760             </xsl:when>
761             <xsl:otherwise>
762               <xsl:variable name="locationLink" select="location/link"/>
763               <a href="{$locationLink}">
764                 <xsl:value-of select="location/address"/>
765               </a>
766             </xsl:otherwise>
767           </xsl:choose>
768           <xsl:if test="location/subaddress!=''">
769             <br/><xsl:value-of select="location/subaddress"/>
770           </xsl:if>
771         </td>
772       </tr>
773       <tr>
774         <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Description"/></td>
775         <td colspan="2" class="fieldval description">
776           <xsl:if test="xproperties/node()[name()='X-BEDEWORK-IMAGE']">
777             <xsl:variable name="bwImage"><xsl:value-of select="xproperties/node()[name()='X-BEDEWORK-IMAGE']/values/text"/></xsl:variable>
778             <img src="{$bwImage}" class="bwEventImage"/>
779           </xsl:if>
780           <xsl:call-template name="replace">
781             <xsl:with-param name="string" select="description"/>
782             <xsl:with-param name="pattern" select="'&#xA;'"/>
783             <xsl:with-param name="replacement"><br/></xsl:with-param>
784           </xsl:call-template>
785         </td>
786       </tr>
787       <xsl:if test="status !='' and status != 'CONFIRMED'">
788         <tr>
789           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-STATUS"/></td>
790           <td class="fieldval">
791             <xsl:value-of select="status"/>
792           </td>
793         </tr>
794       </xsl:if>
795       <xsl:if test="cost!=''">
796         <tr>
797           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Cost"/></td>
798           <td colspan="2" class="fieldval"><xsl:value-of select="cost"/></td>
799         </tr>
800       </xsl:if>
801       <xsl:if test="link != ''">
802         <tr>
803           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-See"/></td>
804           <td colspan="2" class="fieldval">
805             <xsl:variable name="link" select="link"/>
806             <a href="{$link}"><xsl:value-of select="link"/></a>
807           </td>
808         </tr>
809       </xsl:if>
810       <xsl:if test="contact/name!='none'">
811         <tr>
812           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Contact"/></td>
813           <td colspan="2" class="fieldval">
814             <xsl:choose>
815               <xsl:when test="contact/link=''">
816                 <xsl:value-of select="contact/name"/>
817               </xsl:when>
818               <xsl:otherwise>
819                 <xsl:variable name="sponsorLink" select="contact/link"/>
820                 <a href="{$sponsorLink}">
821                   <xsl:value-of select="contact/name"/>
822                 </a>
823               </xsl:otherwise>
824             </xsl:choose>
825             <xsl:if test="contact/phone!=''">
826               <br /><xsl:value-of select="contact/phone"/>
827             </xsl:if>
828             <!-- If you want to display email addresses, uncomment the
829                  following 8 lines. -->
830             <!-- <xsl:if test="contact/email!=''">
831               <br />
832               <xsl:variable name="email" select="contact/email"/>
833               <xsl:variable name="subject" select="summary"/>
834               <a href="mailto:{$email}&amp;subject={$subject}">
835                 <xsl:value-of select="contact/email"/>
836               </a>
837             </xsl:if> -->
838           </td>
839         </tr>
840       </xsl:if>
841       <xsl:if test="comments/comment">
842         <tr>
843           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Comments"/></td>
844           <td class="fieldval comments">
845             <xsl:for-each select="comments/comment">
846               <p><xsl:value-of select="value"/></p>
847             </xsl:for-each>
848           </td>
849         </tr>
850       </xsl:if>
851       <xsl:if test="xproperties/X-BEDEWORK-ALIAS">
852         <tr>
853           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-TopicalArea"/></td>
854           <td class="fieldval">
855             <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS">
856               <xsl:variable name="calUrl" select="values/text"/>
857               <a href="{$setSelection}&amp;virtualPath={$calUrl}&amp;setappvar=curCollection({$calUrl})">
858                 <xsl:call-template name="substring-afterLastInstanceOf">
859                   <xsl:with-param name="string" select="values/text"/>
860                   <xsl:with-param name="char">/</xsl:with-param>
861                 </xsl:call-template>
862               </a><xsl:if test="position()!=last()">, </xsl:if>
863             </xsl:for-each>
864           </td>
865         </tr>
866       </xsl:if>
867       <xsl:if test="categories/category">
868         <tr>
869           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Categories"/></td>
870           <td class="fieldval">
871             <xsl:for-each select="categories/category">
872               <xsl:value-of select="word"/><xsl:if test="position() != last()">, </xsl:if>
873             </xsl:for-each>
874           </td>
875         </tr>
876       </xsl:if>
877       <!--  xsl:if test="calendar/path!=''">
878         <tr>
879           <td class="fieldname">Calendar:</td>
880           <td class="fieldval">
881             <xsl:variable name="calUrl" select="calendar/encodedPath"/>
882             <a href="{$setSelection}&amp;calUrl={$calUrl}">
883               <xsl:value-of select="calendar/name"/>
884             </a>
885           </td>
886         </tr>
887       </xsl:if-->
888     </table>
889   </xsl:template>
890
891   <!--==== LIST VIEW  (for day, week, and month) ====-->
892   <xsl:template name="listView">
893     <table id="listTable" border="0" cellpadding="0" cellspacing="0">
894       <xsl:choose>
895         <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)">
896           <tr>
897             <td class="noEventsCell">
898               <xsl:value-of select="$bwStr-LsVw-NoEventsToDisplay"/>
899             </td>
900           </tr>
901         </xsl:when>
902         <xsl:otherwise>
903           <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[event]">
904             <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
905               <tr>
906                 <td colspan="5" class="dateRow">
907                    <xsl:variable name="date" select="date"/>
908                    <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$date}">
909                      <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
910                    </a>
911                 </td>
912               </tr>
913             </xsl:if>
914             <xsl:for-each select="event">
915               <xsl:variable name="id" select="id"/>
916               <xsl:variable name="calPath" select="calendar/encodedPath"/>
917               <xsl:variable name="guid" select="guid"/>
918               <xsl:variable name="recurrenceId" select="recurrenceId"/>
919               <tr>
920                 <xsl:variable name="dateRangeStyle">
921                   <xsl:choose>
922                     <xsl:when test="start/shortdate = parent::day/shortdate">
923                       <xsl:choose>
924                         <xsl:when test="start/allday = 'true'">dateRangeCrossDay</xsl:when>
925                         <xsl:when test="start/hour24 &lt; 6">dateRangeEarlyMorning</xsl:when>
926                         <xsl:when test="start/hour24 &lt; 12">dateRangeMorning</xsl:when>
927                         <xsl:when test="start/hour24 &lt; 18">dateRangeAfternoon</xsl:when>
928                         <xsl:otherwise>dateRangeEvening</xsl:otherwise>
929                       </xsl:choose>
930                     </xsl:when>
931                     <xsl:otherwise>dateRangeCrossDay</xsl:otherwise>
932                   </xsl:choose>
933                 </xsl:variable>
934                 <xsl:choose>
935                   <xsl:when test="start/allday = 'true' and
936                                   start/shortdate = end/shortdate">
937                     <td class="{$dateRangeStyle} center" colspan="3">
938                       <xsl:value-of select="$bwStr-LsVw-AllDay"/>
939                     </td>
940                   </xsl:when>
941                   <xsl:when test="start/shortdate = end/shortdate and
942                                   start/time = end/time">
943                     <td class="{$dateRangeStyle} center" colspan="3">
944                       <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
945                         <xsl:value-of select="start/time"/>
946                       </a>
947                     </td>
948                   </xsl:when>
949                   <xsl:otherwise>
950                     <td class="{$dateRangeStyle} right">
951                       <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
952                       <xsl:choose>
953                         <xsl:when test="start/allday = 'true' and
954                                         parent::day/shortdate = start/shortdate">
955                           <xsl:value-of select="$bwStr-LsVw-Today"/>
956                         </xsl:when>
957                         <xsl:when test="parent::day/shortdate != start/shortdate">
958                           <span class="littleArrow">&#171;</span>&#160;
959                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
960                         </xsl:when>
961                         <xsl:otherwise>
962                           <xsl:value-of select="start/time"/>
963                         </xsl:otherwise>
964                       </xsl:choose>
965                       </a>
966                     </td>
967                     <td class="{$dateRangeStyle} center">
968                       <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a>
969                     </td>
970                     <td class="{$dateRangeStyle} left">
971                       <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
972                       <xsl:choose>
973                         <xsl:when test="end/allday = 'true' and
974                                         parent::day/shortdate = end/shortdate">
975                           <xsl:copy-of select="$bwStr-LsVw-Today"/>
976                         </xsl:when>
977                         <xsl:when test="parent::day/shortdate != end/shortdate">
978                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
979                           &#160;<span class="littleArrow">&#187;</span>
980                         </xsl:when>
981                         <xsl:otherwise>
982                           <xsl:value-of select="end/time"/>
983                         </xsl:otherwise>
984                       </xsl:choose>
985                       </a>
986                     </td>
987                   </xsl:otherwise>
988                 </xsl:choose>
989                 <xsl:variable name="descriptionClass">
990                   <xsl:choose>
991                     <xsl:when test="status='CANCELLED'">description bwStatusCancelled</xsl:when>
992                     <xsl:when test="status='TENTATIVE'">description bwStatusTentative</xsl:when>
993                     <xsl:otherwise><xsl:copy-of select="$bwStr-LsVw-Description"/></xsl:otherwise>
994                   </xsl:choose>
995                 </xsl:variable>
996                 <!-- Subscription styles.
997                      These are set in the add/modify subscription forms in the admin client;
998                      if present, these override the background-color set by eventClass. The
999                      subscription styles should not be used for canceled events (tentative is ok). -->
1000                 <xsl:variable name="subscriptionClass">
1001                   <xsl:if test="status != 'CANCELLED' and
1002                                 subscription/subStyle != '' and
1003                                 subscription/subStyle != 'default'"><xsl:value-of select="subscription/subStyle"/></xsl:if>
1004                 </xsl:variable>
1005                 <td class="{$descriptionClass} {$subscriptionClass}">
1006                   <xsl:if test="status='CANCELLED'"><strong><xsl:copy-of select="$bwStr-LsVw-Canceled"/><xsl:text> </xsl:text></strong></xsl:if>
1007                   <xsl:choose>
1008                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
1009                       <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1010                         <strong>
1011                           <xsl:value-of select="summary"/>:
1012                         </strong>
1013                         <xsl:value-of select="description"/>&#160;
1014                         <em>
1015                           <xsl:value-of select="location/address"/>
1016                           <xsl:if test="location/subaddress != ''">
1017                             , <xsl:value-of select="location/subaddress"/>
1018                           </xsl:if>.&#160;
1019                           <xsl:if test="cost!=''">
1020                             <xsl:value-of select="cost"/>.&#160;
1021                           </xsl:if>
1022                           <xsl:if test="contact/name!='none'">
1023                             <xsl:copy-of select="$bwStr-LsVw-Contact"/><xsl:text> </xsl:text><xsl:value-of select="contact/name"/>
1024                           </xsl:if>
1025                         </em>
1026                         -
1027                         <span class="eventSubscription">
1028                           <xsl:if test="xproperties/X-BEDEWORK-ALIAS">
1029                             <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS">
1030                               <xsl:call-template name="substring-afterLastInstanceOf">
1031                                 <xsl:with-param name="string" select="values/text"/>
1032                                 <xsl:with-param name="char">/</xsl:with-param>
1033                               </xsl:call-template>
1034                               <xsl:if test="position()!=last()">, </xsl:if>
1035                             </xsl:for-each>
1036                           </xsl:if>
1037                         </span>
1038                       </a>
1039                       <xsl:if test="link != ''">
1040                         <xsl:variable name="link" select="link"/>
1041                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
1042                       </xsl:if>
1043                     </xsl:when>
1044                     <xsl:otherwise>
1045                       <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1046                         <xsl:value-of select="summary"/>
1047                         <xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if>
1048                          -
1049                         <span class="eventSubscription">
1050                           <xsl:if test="xproperties/X-BEDEWORK-ALIAS">
1051                             <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS">
1052                               <xsl:call-template name="substring-afterLastInstanceOf">
1053                                 <xsl:with-param name="string" select="values/text"/>
1054                                 <xsl:with-param name="char">/</xsl:with-param>
1055                               </xsl:call-template>
1056                               <xsl:if test="position()!=last()">, </xsl:if>
1057                             </xsl:for-each>
1058                           </xsl:if>
1059                         </span>
1060                       </a>
1061                     </xsl:otherwise>
1062                   </xsl:choose>
1063                 </td>
1064                 <td class="icons">
1065                   <a href="{$privateCal}/event/addEventRef.do?calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
1066                     <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="Add event to MyCalendar"/>
1067                   </a>
1068                   <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
1069                   <a href="{$export}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;contentName={$eventIcalName}" title="{$bwStr-LsVw-DownloadEvent}">
1070                     <img src="{$resourcesRoot}/images/std-ical_icon_small.gif" width="12" height="16" border="0" alt="{$bwStr-LsVw-DownloadEvent}"/>
1071                   </a>
1072                 </td>
1073               </tr>
1074             </xsl:for-each>
1075           </xsl:for-each>
1076         </xsl:otherwise>
1077       </xsl:choose>
1078     </table>
1079   </xsl:template>
1080
1081   <!--==== LIST EVENTS - for listing discrete events ====-->
1082   <xsl:template match="events" mode="eventList">
1083     <h2 class="bwStatusConfirmed">
1084       <!-- <form name="bwListEventsForm" action="{$listEvents}" method="post">
1085         <input type="hidden" name="setappvar"/>-->
1086         <xsl:value-of select="$bwStr-LsEv-Next7Days"/>
1087         <!--
1088         <span id="bwListEventsFormControls">
1089           <select name="catuid" onchange="this.form.submit();">
1090             <option value="">filter by category...</option>
1091             <xsl:for-each select="/bedework/categories/category">
1092               <option>
1093                 <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
1094                 <xsl:value-of select="keyword"/>
1095               </option>
1096             </xsl:for-each>
1097           </select>
1098           <select name="days" onchange="this.form.submit();">
1099             <xsl:call-template name="buildListEventsDaysOptions">
1100               <xsl:with-param name="i">1</xsl:with-param>
1101               <xsl:with-param name="total">31</xsl:with-param>
1102             </xsl:call-template>
1103           </select>
1104         </span>
1105       </form>-->
1106     </h2>
1107
1108     <div id="listEvents">
1109       <ul>
1110         <xsl:choose>
1111           <xsl:when test="not(event)">
1112             <li><xsl:value-of select="$bwStr-LsEv-NoEventsToDisplay"/>.</li>
1113           </xsl:when>
1114           <xsl:otherwise>
1115             <xsl:for-each select="event">
1116               <xsl:variable name="id" select="id"/>
1117               <xsl:variable name="calPath" select="calendar/encodedPath"/>
1118               <xsl:variable name="guid" select="guid"/>
1119               <xsl:variable name="recurrenceId" select="recurrenceId"/>
1120               <li>
1121                 <xsl:attribute name="class">
1122                   <xsl:choose>
1123                     <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
1124                     <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
1125                   </xsl:choose>
1126                 </xsl:attribute>
1127
1128                 <xsl:if test="status='CANCELLED'"><strong><xsl:value-of select="$bwStr-LsEv-Canceled"/><xsl:text> </xsl:text></strong></xsl:if>
1129                 <xsl:if test="status='TENTATIVE'"><em><xsl:value-of select="$bwStr-LsEv-Tentative"/><xsl:text> </xsl:text></em></xsl:if>
1130
1131                 <a class="title" href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1132                   <xsl:value-of select="summary"/>
1133                 </a><xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if>
1134                 <xsl:if test="/bedework/appvar[key='listEventsSummaryMode']/value='details'">
1135                   <xsl:if test="location/subaddress != ''">
1136                     , <xsl:value-of select="location/subaddress"/>
1137                   </xsl:if>
1138                 </xsl:if>
1139
1140                 <xsl:text> </xsl:text>
1141                 <a href="{$privateCal}/event/addEventRef.do?calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
1142                   <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="Add event to MyCalendar"/>
1143                 </a>
1144                 <xsl:text> </xsl:text>
1145                 <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
1146                 <a href="{$export}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;contentName={$eventIcalName}" title="{$bwStr-LsEv-DownloadEvent}">
1147                   <img src="{$resourcesRoot}/images/std-ical_icon_small.gif" width="12" height="16" border="0" alt="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars"/>
1148                 </a>
1149
1150                 <br/>
1151
1152                 <xsl:value-of select="substring(start/dayname,1,3)"/>,
1153                 <xsl:value-of select="start/longdate"/>
1154                 <xsl:text> </xsl:text>
1155                 <xsl:if test="start/allday != 'true'">
1156                   <xsl:value-of select="start/time"/>
1157                 </xsl:if>
1158                 <xsl:choose>
1159                   <xsl:when test="start/shortdate != end/shortdate">
1160                     -
1161                     <xsl:value-of select="substring(end/dayname,1,3)"/>,
1162                     <xsl:value-of select="end/longdate"/>
1163                     <xsl:text> </xsl:text>
1164                     <xsl:if test="start/allday != 'true'">
1165                       <xsl:value-of select="end/time"/>
1166                     </xsl:if>
1167                   </xsl:when>
1168                   <xsl:otherwise>
1169                     <xsl:if test="start/time != end/time">
1170                       -
1171                       <xsl:value-of select="end/time"/>
1172                     </xsl:if>
1173                   </xsl:otherwise>
1174                 </xsl:choose>
1175
1176                 <xsl:if test="/bedework/appvar[key='listEventsSummaryMode']/value='details'">
1177                   <br/>
1178                   <xsl:value-of select="description"/>
1179                   <xsl:if test="link != ''">
1180                     <br/>
1181                     <xsl:variable name="link" select="link"/>
1182                     <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
1183                   </xsl:if>
1184                   <xsl:if test="categories/category">
1185                     <br/>
1186                     <xsl:copy-of select="$bwStr-LsEv-Categories"/>
1187                     <xsl:for-each select="categories/category">
1188                       <xsl:value-of select="word"/><xsl:if test="position() != last()">, </xsl:if>
1189                     </xsl:for-each>
1190                   </xsl:if>
1191                   <br/>
1192                   <em>
1193                     <xsl:if test="cost!=''">
1194                       <xsl:value-of select="cost"/>.&#160;
1195                     </xsl:if>
1196                     <xsl:if test="contact/name!='none'">
1197                       <xsl:copy-of select="$bwStr-LsEv-Contact"/><xsl:text> </xsl:text><xsl:value-of select="contact/name"/>
1198                     </xsl:if>
1199                   </em>
1200                 </xsl:if>
1201
1202               </li>
1203             </xsl:for-each>
1204           </xsl:otherwise>
1205         </xsl:choose>
1206       </ul>
1207     </div>
1208   </xsl:template>
1209
1210   <xsl:template name="buildListEventsDaysOptions">
1211     <xsl:param name="i">1</xsl:param>
1212     <xsl:param name="total">31</xsl:param>
1213     <xsl:param name="default">7</xsl:param>
1214     <xsl:variable name="selected"><xsl:value-of select="/bedework/appvar[key='listEventsDays']/value"/></xsl:variable>
1215
1216     <option onclick="this.form.setappvar.value='listEventsDay({$i})'">
1217       <xsl:attribute name="value"><xsl:value-of select="$i"/></xsl:attribute>
1218       <xsl:if test="($selected != '' and $i = $selected) or ($selected = '' and $i = $default)"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
1219       <xsl:value-of select="$i"/>
1220     </option>
1221
1222     <xsl:if test="$i &lt; $total">
1223       <xsl:call-template name="buildListEventsDaysOptions">
1224         <xsl:with-param name="i"><xsl:value-of select="$i + 1"/></xsl:with-param>
1225         <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param>
1226         <xsl:with-param name="default"><xsl:value-of select="$default"/></xsl:with-param>
1227       </xsl:call-template>
1228     </xsl:if>
1229
1230   </xsl:template>
1231
1232   <!--==== WEEK CALENDAR VIEW ====-->
1233   <xsl:template name="weekView">
1234     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
1235       <tr>
1236         <xsl:for-each select="/bedework/daynames/val">
1237           <th class="dayHeading"><xsl:value-of select="."/></th>
1238         </xsl:for-each>
1239       </tr>
1240       <tr>
1241         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day">
1242           <xsl:variable name="dayPos" select="position()"/>
1243           <xsl:if test="filler='false'">
1244             <td>
1245               <xsl:if test="/bedework/now/date = date">
1246                 <xsl:attribute name="class">today</xsl:attribute>
1247               </xsl:if>
1248               <xsl:variable name="dayDate" select="date"/>
1249               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink">
1250                 <xsl:value-of select="value"/>
1251               </a>
1252               <xsl:if test="event">
1253                 <ul>
1254                   <xsl:apply-templates select="event" mode="calendarLayout">
1255                     <xsl:with-param name="dayPos" select="$dayPos"/>
1256                   </xsl:apply-templates>
1257                 </ul>
1258               </xsl:if>
1259             </td>
1260           </xsl:if>
1261         </xsl:for-each>
1262       </tr>
1263     </table>
1264   </xsl:template>
1265
1266   <!--==== MONTH CALENDAR VIEW ====-->
1267   <xsl:template name="monthView">
1268     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
1269       <tr>
1270         <xsl:for-each select="/bedework/daynames/val">
1271           <th class="dayHeading"><xsl:value-of select="."/></th>
1272         </xsl:for-each>
1273       </tr>
1274       <xsl:for-each select="/bedework/eventscalendar/year/month/week">
1275         <tr>
1276           <xsl:for-each select="day">
1277             <xsl:variable name="dayPos" select="position()"/>
1278             <xsl:choose>
1279               <xsl:when test="filler='true'">
1280                 <td class="filler">&#160;</td>
1281               </xsl:when>
1282               <xsl:otherwise>
1283                 <td>
1284                   <xsl:if test="/bedework/now/date = date">
1285                     <xsl:attribute name="class">today</xsl:attribute>
1286                   </xsl:if>
1287                   <xsl:variable name="dayDate" select="date"/>
1288                   <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink">
1289                     <xsl:value-of select="value"/>
1290                   </a>
1291                   <xsl:if test="event">
1292                     <ul>
1293                       <xsl:apply-templates select="event" mode="calendarLayout">
1294                         <xsl:with-param name="dayPos" select="$dayPos"/>
1295                       </xsl:apply-templates>
1296                     </ul>
1297                   </xsl:if>
1298                 </td>
1299               </xsl:otherwise>
1300             </xsl:choose>
1301           </xsl:for-each>
1302         </tr>
1303       </xsl:for-each>
1304     </table>
1305   </xsl:template>
1306
1307   <!--== EVENTS IN THE CALENDAR GRID ==-->
1308   <xsl:template match="event" mode="calendarLayout">
1309     <xsl:param name="dayPos"/>
1310     <xsl:variable name="calPath" select="calendar/encodedPath"/>
1311     <xsl:variable name="guid" select="guid"/>
1312     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1313     <xsl:variable name="eventClass">
1314       <xsl:choose>
1315         <!-- Special styles for the month grid -->
1316         <xsl:when test="status='CANCELLED'">eventCancelled</xsl:when>
1317         <xsl:when test="status='TENTATIVE'">eventTentative</xsl:when>
1318         <!-- Default alternating colors for all standard events -->
1319         <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when>
1320         <xsl:otherwise>eventLinkB</xsl:otherwise>
1321       </xsl:choose>
1322     </xsl:variable>
1323     <!-- Subscription styles.
1324          These are set in the add/modify subscription forms in the admin client;
1325          if present, these override the background-color set by eventClass. The
1326          subscription styles should not be used for cancelled events (tentative is ok). -->
1327     <xsl:variable name="subscriptionClass">
1328       <xsl:if test="status != 'CANCELLED' and
1329                     subscription/subStyle != '' and
1330                     subscription/subStyle != 'default'"><xsl:value-of select="subscription/subStyle"/></xsl:if>
1331     </xsl:variable>
1332     <li>
1333       <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" class="{$eventClass} {$subscriptionClass}">
1334         <xsl:if test="status='CANCELLED'"><xsl:copy-of select="$bwStr-EvCG-Canceled"/><xsl:text> </xsl:text></xsl:if>
1335         <xsl:choose>
1336           <xsl:when test="start/shortdate != ../shortdate">
1337             <xsl:copy-of select="$bwStr-EvCG-Cont"/>
1338           </xsl:when>
1339           <xsl:when test="start/allday = 'false'">
1340             <xsl:value-of select="start/time"/>:
1341           </xsl:when>
1342           <xsl:otherwise>
1343             <xsl:copy-of select="$bwStr-EvCG-AllDayColon"/>
1344           </xsl:otherwise>
1345         </xsl:choose>
1346         <xsl:value-of select="summary"/>
1347         <xsl:variable name="eventTipClass">
1348           <xsl:choose>
1349             <xsl:when test="$dayPos &gt; 5">eventTipReverse</xsl:when>
1350             <xsl:otherwise>eventTip</xsl:otherwise>
1351           </xsl:choose>
1352         </xsl:variable>
1353         <span class="{$eventTipClass}">
1354           <xsl:if test="status='CANCELLED'"><span class="eventTipStatusCancelled"><xsl:copy-of select="$bwStr-EvCG-Canceled"/></span></xsl:if>
1355           <xsl:if test="status='TENTATIVE'"><span class="eventTipStatusTentative"><xsl:copy-of select="$bwStr-EvCG-Tentative"/></span></xsl:if>
1356           <strong><xsl:value-of select="summary"/></strong><br/>
1357           <xsl:copy-of select="$bwStr-EvCG-Time"/>
1358           <xsl:choose>
1359             <xsl:when test="start/allday = 'true'">
1360               <xsl:copy-of select="$bwStr-EvCG-AllDay"/>
1361             </xsl:when>
1362             <xsl:otherwise>
1363               <xsl:if test="start/shortdate != ../shortdate">
1364                 <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
1365                 <xsl:text> </xsl:text>
1366               </xsl:if>
1367               <xsl:value-of select="start/time"/>
1368               <xsl:if test="(start/time != end/time) or (start/shortdate != end/shortdate)">
1369                 -
1370                 <xsl:if test="end/shortdate != ../shortdate">
1371                   <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
1372                   <xsl:text> </xsl:text>
1373                 </xsl:if>
1374                 <xsl:value-of select="end/time"/>
1375               </xsl:if>
1376             </xsl:otherwise>
1377           </xsl:choose><br/>
1378           <xsl:if test="location/address">
1379             <xsl:copy-of select="$bwStr-EvCG-Location"/><xsl:text> </xsl:text><xsl:value-of select="location/address"/><br/>
1380           </xsl:if>
1381           <xsl:if test="xproperties/X-BEDEWORK-ALIAS">
1382             <xsl:copy-of select="$bwStr-EvCG-TopicalArea"/>
1383               <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS">
1384                 <xsl:call-template name="substring-afterLastInstanceOf">
1385                   <xsl:with-param name="string" select="values/text"/>
1386                   <xsl:with-param name="char">/</xsl:with-param>
1387                 </xsl:call-template>
1388                 <xsl:if test="position()!=last()">, </xsl:if>
1389               </xsl:for-each>
1390           </xsl:if>
1391         </span>
1392       </a>
1393     </li>
1394   </xsl:template>
1395
1396   <!--==== YEAR VIEW ====-->
1397   <xsl:template name="yearView">
1398     <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0">
1399       <tr>
1400         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &lt;= 3]"/>
1401       </tr>
1402       <tr>
1403         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 3) and (position() &lt;= 6)]"/>
1404       </tr>
1405       <tr>
1406         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 6) and (position() &lt;= 9)]"/>
1407       </tr>
1408       <tr>
1409         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &gt; 9]"/>
1410       </tr>
1411     </table>
1412   </xsl:template>
1413
1414   <!-- year view month tables -->
1415   <xsl:template match="month">
1416     <td>
1417       <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0">
1418         <tr>
1419           <td colspan="8" class="monthName">
1420             <xsl:variable name="firstDayOfMonth" select="week/day/date"/>
1421             <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$firstDayOfMonth}">
1422               <xsl:value-of select="longname"/>
1423             </a>
1424           </td>
1425         </tr>
1426         <tr>
1427           <th>&#160;</th>
1428           <xsl:for-each select="/bedework/shortdaynames/val">
1429             <th><xsl:value-of select="."/></th>
1430           </xsl:for-each>
1431         </tr>
1432         <xsl:for-each select="week">
1433           <tr>
1434             <td class="weekCell">
1435               <xsl:variable name="firstDayOfWeek" select="day/date"/>
1436               <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$firstDayOfWeek}">
1437                 <xsl:value-of select="value"/>
1438               </a>
1439             </td>
1440             <xsl:for-each select="day">
1441               <xsl:choose>
1442                 <xsl:when test="filler='true'">
1443                   <td class="filler">&#160;</td>
1444                 </xsl:when>
1445                 <xsl:otherwise>
1446                   <td>
1447                     <xsl:if test="/bedework/now/date = date">
1448                       <xsl:attribute name="class">today</xsl:attribute>
1449                     </xsl:if>
1450                     <xsl:variable name="dayDate" select="date"/>
1451                     <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}">
1452                       <xsl:attribute name="class">today</xsl:attribute>
1453                       <xsl:value-of select="value"/>
1454                     </a>
1455                   </td>
1456                 </xsl:otherwise>
1457               </xsl:choose>
1458             </xsl:for-each>
1459           </tr>
1460         </xsl:for-each>
1461       </table>
1462     </td>
1463   </xsl:template>
1464
1465   <!--==== CALENDARS ====-->
1466
1467   <!-- list of available calendars -->
1468   <xsl:template match="calendars">
1469     <xsl:variable name="topLevelCalCount" select="count(calendar/calendar[calType != 5 and calType != 6 and name != 'calendar'])"/>
1470     <table id="calPageTable" border="0" cellpadding="0" cellspacing="0">
1471       <tr>
1472         <th colspan="2">
1473           <xsl:copy-of select="$bwStr-Cals-AllTopicalAreas"/>
1474         </th>
1475       </tr>
1476       <tr>
1477         <td colspan="2" class="infoCell">
1478           <p class="info">
1479             <xsl:copy-of select="$bwStr-Cals-SelectTopicalArea"/>
1480           </p>
1481         </td>
1482       </tr>
1483       <tr>
1484         <td class="leftCell">
1485           <!-- adjust the following calculations to get a balanced layout between the cells -->
1486           <ul class="calendarTree">
1487             <xsl:apply-templates select="calendar/calendar[(calType != 5 and calType != 6 and name != 'calendar') and (position() &lt;= ceiling($topLevelCalCount div 2)+2)]" mode="calTree"/>
1488           </ul>
1489         </td>
1490         <td>
1491           <ul class="calendarTree">
1492             <xsl:apply-templates select="calendar/calendar[(calType != 5 and calType != 6 and name != 'calendar') and (position() &gt; ceiling($topLevelCalCount div 2)+2)]" mode="calTree"/>
1493           </ul>
1494         </td>
1495       </tr>
1496     </table>
1497   </xsl:template>
1498
1499   <xsl:template match="calendar" mode="calTree">
1500     <xsl:variable name="itemClass">
1501       <xsl:choose>
1502         <xsl:when test="calType = '0'"><xsl:copy-of select="$bwStr-Calr-Folder"/></xsl:when>
1503         <xsl:otherwise><xsl:copy-of select="$bwStr-Calr-Calendar"/></xsl:otherwise>
1504       </xsl:choose>
1505     </xsl:variable>
1506     <xsl:variable name="virtualPath"><xsl:call-template name="url-encode"><xsl:with-param name="str">/user<xsl:for-each select="ancestor-or-self::calendar/name">/<xsl:value-of select="."/></xsl:for-each></xsl:with-param></xsl:call-template></xsl:variable>
1507     <li class="{$itemClass}">
1508       <xsl:variable name="calPath" select="path"/>
1509       <a href="{$setSelection}&amp;virtualPath={$virtualPath}&amp;setappvar=curCollection({$calPath})" title="view calendar"><xsl:value-of select="name"/></a>
1510       <xsl:variable name="calPath" select="path"/>
1511       <span class="exportCalLink">
1512         <a href="{$calendar-fetchForExport}&amp;calPath={$calPath}&amp;virtualPath={$virtualPath}" title="export calendar as iCal">
1513           <img src="{$resourcesRoot}/images/calIconExport-sm.gif" width="13" height="13" alt="export calendar" border="0"/>
1514         </a>
1515       </span>
1516       <xsl:if test="calendar">
1517         <ul>
1518           <xsl:apply-templates select="calendar" mode="calTree"/>
1519         </ul>
1520       </xsl:if>
1521     </li>
1522   </xsl:template>
1523
1524   <!-- calendar export page -->
1525   <xsl:template match="currentCalendar" mode="export">
1526     <h2 class="bwStatusConfirmed"><xsl:copy-of select="$bwStr-Cals-ExportCals"/></h2>
1527     <div id="export">
1528       <p>
1529         <strong><xsl:copy-of select="$bwStr-Cals-CalendarToExport"/></strong>
1530       </p>
1531       <div class="indent">
1532         <xsl:copy-of select="$bwStr-Cals-Name"/><xsl:text> </xsl:text><strong><em><xsl:value-of select="name"/></em></strong><br/>
1533         <xsl:copy-of select="$bwStr-Cals-Path"/><xsl:text> </xsl:text><xsl:value-of select="path"/>
1534       </div>
1535       <p>
1536         <strong><xsl:copy-of select="$bwStr-Cals-EventDateLimits"/></strong>
1537       </p>
1538       <form name="exportCalendarForm" id="exportCalendarForm" action="{$export}" method="post">
1539         <input type="hidden" name="calPath">
1540           <xsl:attribute name="value"><xsl:value-of select="path"/></xsl:attribute>
1541         </input>
1542         <!-- fill these on submit -->
1543         <input type="hidden" name="eventStartDate.year" value=""/>
1544         <input type="hidden" name="eventStartDate.month" value=""/>
1545         <input type="hidden" name="eventStartDate.day" value=""/>
1546         <input type="hidden" name="eventEndDate.year" value=""/>
1547         <input type="hidden" name="eventEndDate.month" value=""/>
1548         <input type="hidden" name="eventEndDate.day" value=""/>
1549         <!-- static fields -->
1550         <input type="hidden" name="nocache" value="no"/>
1551         <input type="hidden" name="contentName">
1552           <xsl:attribute name="value"><xsl:value-of select="name"/>.ics</xsl:attribute>
1553         </input>
1554         <!-- visible fields -->
1555         <input type="radio" name="dateLimits" value="active" checked="checked" onclick="changeClass('exportDateRange','invisible')"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-Cals-TodayForward"/>
1556         <input type="radio" name="dateLimits" value="none" onclick="changeClass('exportDateRange','invisible')"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-Cals-AllDates"/>
1557         <input type="radio" name="dateLimits" value="limited" onclick="changeClass('exportDateRange','visible')"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-Cals-DateRange"/>
1558         <div id="exportDateRange" class="invisible">
1559           <xsl:copy-of select="$bwStr-Cals-Start"/><xsl:text> </xsl:text><input type="text" name="bwExportCalendarWidgetStartDate" id="bwExportCalendarWidgetStartDate" size="10"/>
1560           <span id="bwExportEndField">E<xsl:copy-of select="$bwStr-Cals-End"/><xsl:text> </xsl:text><input type="text" name="bwExportCalendarWidgetEndDate" id="bwExportCalendarWidgetEndDate" size="10"/></span>
1561         </div>
1562         <p><input type="submit" value="{$bwStr-Cals-Export}" class="bwWidgetSubmit" onclick="fillExportFields(this.form)"/></p>
1563       </form>
1564     </div>
1565   </xsl:template>
1566
1567   <!--==== SEARCH RESULT ====-->
1568   <xsl:template name="searchResult">
1569     <h2 class="bwStatusConfirmed">
1570       <div id="searchFilter">
1571         <form name="searchForm" method="post" action="{$search}">
1572           <xsl:value-of select="$bwStr-Srch-Search"/>
1573           <input type="text" name="query" size="15">
1574             <xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute>
1575           </input>
1576           <input type="submit" name="submit" value="{$bwStr-Srch-Go}"/>
1577           <xsl:value-of select="$bwStr-Srch-Limit"/>
1578           <xsl:choose>
1579             <xsl:when test="/bedework/searchResults/searchLimits = 'beforeToday'">
1580               <input type="radio" name="searchLimits" value="fromToday"/><xsl:value-of select="$bwStr-Srch-TodayForward"/>
1581               <input type="radio" name="searchLimits" value="beforeToday" checked="checked"/>
1582                 <xsl:value-of select="$bwStr-Srch-PastDates"/>
1583               <input type="radio" name="searchLimits" value="none"/><xsl:value-of select="$bwStr-Srch-AllDates"/>
1584             </xsl:when>
1585             <xsl:when test="/bedework/searchResults/searchLimits = 'none'">
1586               <input type="radio" name="searchLimits" value="fromToday"/><xsl:value-of select="$bwStr-Srch-TodayForward"/>
1587               <input type="radio" name="searchLimits" value="beforeToday"/><xsl:value-of select="$bwStr-Srch-PastDates"/>
1588               <input type="radio" name="searchLimits" value="none" checked="checked"/><xsl:value-of select="$bwStr-Srch-AllDates"/>
1589             </xsl:when>
1590             <xsl:otherwise>
1591               <input type="radio" name="searchLimits" value="fromToday" checked="checked"/>
1592                 <xsl:value-of select="$bwStr-Srch-TodayForward"/>
1593               <input type="radio" name="searchLimits" value="beforeToday"/><xsl:value-of select="$bwStr-Srch-PastDates"/>
1594               <input type="radio" name="searchLimits" value="none"/><xsl:value-of select="$bwStr-Srch-AllDates"/>
1595             </xsl:otherwise>
1596           </xsl:choose>
1597         </form>
1598       </div>
1599       <xsl:value-of select="$bwStr-Srch-SearchResult"/>
1600     </h2>
1601     <table id="searchTable" cellpadding="0" cellspacing="0">
1602       <tr>
1603         <th colspan="5">
1604           <xsl:if test="/bedework/searchResults/numPages &gt; 1">
1605             <xsl:variable name="curPage" select="/bedework/searchResults/curPage"/>
1606             <div id="searchPageForm">
1607               <xsl:copy-of select="$bwStr-Srch-Page"/>
1608               <xsl:if test="/bedework/searchResults/curPage != 1">
1609                 <xsl:variable name="prevPage" select="number($curPage) - 1"/>
1610                 &lt;<a href="{$search-next}&amp;pageNum={$prevPage}"><xsl:copy-of select="$bwStr-Srch-Prev"/></a>
1611               </xsl:if>
1612               <xsl:text> </xsl:text>
1613
1614               <xsl:call-template name="searchResultPageNav">
1615                 <xsl:with-param name="page">
1616                   <xsl:choose>
1617                     <xsl:when test="number($curPage) - 10 &lt; 1">1</xsl:when>
1618                     <xsl:otherwise><xsl:value-of select="number($curPage) - 6"/></xsl:otherwise>
1619                   </xsl:choose>
1620                 </xsl:with-param>
1621               </xsl:call-template>
1622
1623               <xsl:text> </xsl:text>
1624               <xsl:choose>
1625                 <xsl:when test="$curPage != /bedework/searchResults/numPages">
1626                   <xsl:variable name="nextPage" select="number($curPage) + 1"/>
1627                   <a href="{$search-next}&amp;pageNum={$nextPage}"><xsl:copy-of select="$bwStr-Srch-Next"/></a>&gt;
1628                 </xsl:when>
1629                 <xsl:otherwise>
1630                   <span class="hidden"><xsl:copy-of select="$bwStr-Srch-Next"/>&gt;</span><!-- occupy the space to keep the navigation from moving around -->
1631                 </xsl:otherwise>
1632               </xsl:choose>
1633             </div>
1634           </xsl:if>
1635           <xsl:value-of select="/bedework/searchResults/resultSize"/>
1636           <xsl:text> </xsl:text><xsl:value-of select="$bwStr-Srch-ResultReturnedFor"/><xsl:text> </xsl:text>
1637             <em><xsl:value-of select="/bedework/searchResults/query"/></em>
1638         </th>
1639       </tr>
1640       <xsl:if test="/bedework/searchResults/searchResult">
1641         <tr class="fieldNames">
1642           <td>
1643             <xsl:copy-of select="$bwStr-Srch-Relevance"/>
1644           </td>
1645           <td>
1646             <xsl:copy-of select="$bwStr-Srch-Summary"/>
1647           </td>
1648           <td>
1649             <xsl:copy-of select="$bwStr-Srch-DateAndTime"/>
1650           </td>
1651           <td>
1652             <xsl:copy-of select="$bwStr-Srch-Calendar"/>
1653           </td>
1654           <td>
1655             <xsl:copy-of select="$bwStr-Srch-Location"/>
1656           </td>
1657         </tr>
1658       </xsl:if>
1659       <xsl:for-each select="/bedework/searchResults/searchResult">
1660         <xsl:variable name="calPath" select="event/calendar/encodedPath"/>
1661         <xsl:variable name="guid" select="event/guid"/>
1662         <xsl:variable name="recurrenceId" select="event/recurrenceId"/>
1663         <tr>
1664           <td class="relevance">
1665             <xsl:value-of select="ceiling(number(score)*100)"/>%
1666             <img src="{$resourcesRoot}/images/spacer.gif" height="4" class="searchRelevance">
1667               <xsl:attribute name="width"><xsl:value-of select="ceiling((number(score)*100) div 1.5)"/></xsl:attribute>
1668             </img>
1669           </td>
1670           <td>
1671             <a href="{$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1672               <xsl:value-of select="event/summary"/>
1673             </a>
1674           </td>
1675           <td>
1676             <xsl:value-of select="event/start/longdate"/>
1677             <xsl:text> </xsl:text>
1678             <xsl:value-of select="event/start/time"/>
1679             <xsl:choose>
1680               <xsl:when test="event/start/longdate != event/end/longdate">
1681                 - <xsl:value-of select="event/end/longdate"/>
1682                 <xsl:text> </xsl:text>
1683                 <xsl:value-of select="event/end/time"/>
1684               </xsl:when>
1685               <xsl:when test="event/start/time != event/end/time">
1686                 - <xsl:value-of select="event/end/time"/>
1687               </xsl:when>
1688             </xsl:choose>
1689           </td>
1690           <td>
1691             <xsl:variable name="calUrl" select="event/calendar/encodedPath"/>
1692             <a href="{$setSelection}&amp;calUrl={$calUrl}">
1693               <xsl:value-of select="event/calendar/name"/>
1694             </a>
1695           </td>
1696           <td>
1697             <xsl:value-of select="event/location/address"/>
1698           </td>
1699         </tr>
1700       </xsl:for-each>
1701     </table>
1702   </xsl:template>
1703
1704   <xsl:template name="searchResultPageNav">
1705     <xsl:param name="page">1</xsl:param>
1706     <xsl:variable name="curPage" select="/bedework/searchResults/curPage"/>
1707     <xsl:variable name="numPages" select="/bedework/searchResults/numPages"/>
1708     <xsl:variable name="endPage">
1709       <xsl:choose>
1710         <xsl:when test="number($curPage) + 6 &gt; number($numPages)"><xsl:value-of select="$numPages"/></xsl:when>
1711         <xsl:otherwise><xsl:value-of select="number($curPage) + 6"/></xsl:otherwise>
1712       </xsl:choose>
1713     </xsl:variable>
1714     <xsl:choose>
1715       <xsl:when test="$page = $curPage">
1716         <xsl:value-of select="$page"/>
1717       </xsl:when>
1718       <xsl:otherwise>
1719         <a href="{$search-next}&amp;pageNum={$page}">
1720           <xsl:value-of select="$page"/>
1721         </a>
1722       </xsl:otherwise>
1723     </xsl:choose>
1724     <xsl:text> </xsl:text>
1725     <xsl:if test="$page &lt; $endPage">
1726        <xsl:call-template name="searchResultPageNav">
1727          <xsl:with-param name="page" select="number($page)+1"/>
1728       </xsl:call-template>
1729     </xsl:if>
1730   </xsl:template>
1731
1732   <!--+++++++++++++++ System Stats ++++++++++++++++++++-->
1733   <xsl:template name="stats">
1734     <div id="stats">
1735       <h2><xsl:copy-of select="$bwStr-Stat-SysStats"/></h2>
1736
1737       <p>
1738         <xsl:copy-of select="$bwStr-Stat-StatsCollection"/>
1739       </p>
1740       <ul>
1741         <li>
1742           <a href="{$stats}&amp;enable=yes"><xsl:copy-of select="$bwStr-Stat-Enable"/></a> |
1743           <a href="{$stats}&amp;disable=yes"><xsl:copy-of select="$bwStr-Stat-Disable"/></a>
1744         </li>
1745         <li><a href="{$stats}&amp;fetch=yes"><xsl:copy-of select="$bwStr-Stat-FetchStats"/></a></li>
1746         <li><a href="{$stats}&amp;dump=yes"><xsl:copy-of select="$bwStr-Stat-DumpStats"/></a></li>
1747       </ul>
1748       <table id="statsTable" cellpadding="0">
1749         <xsl:for-each select="/bedework/sysStats/*">
1750           <xsl:choose>
1751             <xsl:when test="name(.) = 'header'">
1752               <tr>
1753                 <th colspan="2">
1754                   <xsl:value-of select="."/>
1755                 </th>
1756               </tr>
1757             </xsl:when>
1758             <xsl:otherwise>
1759               <tr>
1760                 <td class="label">
1761                   <xsl:value-of select="label"/>
1762                 </td>
1763                 <td class="value">
1764                   <xsl:value-of select="value"/>
1765                 </td>
1766               </tr>
1767             </xsl:otherwise>
1768           </xsl:choose>
1769         </xsl:for-each>
1770       </table>
1771     </div>
1772   </xsl:template>
1773
1774   <!--==== FOOTER ====-->
1775
1776   <xsl:template name="footer">
1777     <div id="footer">
1778       <xsl:value-of select="$bwStr-Foot-BasedOnThe"/><xsl:text> </xsl:text><a href="http://www.bedework.org/"><xsl:value-of select="$bwStr-Foot-BedeworkCalendarSystem"/></a>
1779     </div>
1780     <table id="skinSelectorTable" border="0" cellpadding="0" cellspacing="0">
1781       <tr>
1782         <td class="leftCell">
1783           <a href="http://www.bedework.org/"><xsl:value-of select="$bwStr-Foot-BedeworkWebsite"/></a> |
1784           <a href="http://www.bedework.org/bedework/update.do?artcenterkey=35">
1785                         <xsl:value-of select="$bwStr-Foot-ProductionExamples"/></a> |
1786           <a href="?noxslt=yes"><xsl:value-of select="$bwStr-Foot-ShowXML"/></a> |
1787           <a href="?refreshXslt=yes"><xsl:value-of select="$bwStr-Foot-RefreshXSLT"/></a>
1788         </td>
1789         <td class="rightCell">
1790           <form name="styleSelectForm" method="get" action="{$setup}">
1791             <select name="setappvar" onchange="submit()">
1792               <option value=""><xsl:value-of select="$bwStr-Foot-ExampleStyles"/>:</option>
1793               <option value="style(green)"><xsl:value-of select="$bwStr-Foot-Green"/></option>
1794               <option value="style(red)"><xsl:value-of select="$bwStr-Foot-Red"/></option>
1795               <option value="style(blue)"><xsl:value-of select="$bwStr-Foot-Blue"/></option>
1796             </select>
1797           </form>
1798           <form name="skinSelectForm" method="post" action="{$setup}">
1799             <input type="hidden" name="setappvar" value="summaryMode(details)"/>
1800             <select name="skinPicker" onchange="window.location = this.value">
1801               <option value="{$setup}&amp;skinNameSticky=default"><xsl:value-of select="$bwStr-Foot-ExampleSkins"/>:</option>
1802               <option value="{$listEvents}&amp;setappvar=summaryMode(details)&amp;skinName=rss-list&amp;days=3">
1803                                 <xsl:value-of select="$bwStr-Foot-RSSNext3Days"/></option>
1804               <option value="{$listEvents}&amp;setappvar=summaryMode(details)&amp;skinName=js-list&amp;days=3&amp;contentType=text/javascript&amp;contentName=bedework.js">
1805                                 <xsl:value-of select="$bwStr-Foot-JavascriptNext3Days"/></option>
1806               <option value="{$setViewPeriod}&amp;viewType=todayView&amp;skinName=jsToday&amp;contentType=text/javascript&amp;contentName=bedeworkToday.js">
1807                                 <xsl:value-of select="$bwStr-Foot-JavascriptTodaysEvents"/></option>
1808               <option value="{$setup}&amp;browserTypeSticky=PDA">
1809                                 <xsl:value-of select="$bwStr-Foot-ForMobileBrowsers"/></option>
1810               <option value="{$setViewPeriod}&amp;viewType=todayView&amp;skinName=videocal">
1811                                 <xsl:value-of select="$bwStr-Foot-VideoFeed"/></option>
1812               <option value="{$setup}&amp;skinNameSticky=default">
1813                                 <xsl:value-of select="$bwStr-Foot-ResetToCalendarDefault"/></option>
1814             </select>
1815           </form>
1816         </td>
1817       </tr>
1818     </table>
1819   </xsl:template>
1820 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.