root/trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/default/default.xsl

Revision 1732 (checked in by johnsa, 5 years ago)

public client: stop explicitly setting content type during ical export

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