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

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

public client: rename an xproperty

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 "DEPARTMENTAL" CALENDAR STYLESHEET
15
16                   SoEDepartmental Calendar Suite
17
18      This stylesheet is for the "soe" (School of Engineering)
19      calendar suite; it is an example of a departmental skin.
20
21      This skin, along with the preferences for the Calendar
22      Suite owner, differs from the main public skin (default.xsl) in the
23      following ways:
24        - different header, title, and footer
25        - default layout = list view (rather than calendar grid)
26        - different color scheme
27
28      Otherwise, for the sake of demonstration, we've left most of the
29      functionality of the public client in place.
30
31      For detailed instructions on how to work with the XSLT
32      stylesheets included with this distribution, please see the
33      Bedework Design Guide at
34      http://www.bedework.org/bedework/update.do?artcenterkey=24
35
36 ===============================================================  -->
37
38 <!-- **********************************************************************
39   Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
40
41   Redistribution and use of this distribution in source and binary forms,
42   with or without modification, are permitted provided that:
43      The above copyright notice and this permission notice appear in all
44       copies and supporting documentation;
45
46       The name, identifiers, and trademarks of Rensselaer Polytechnic
47       Institute are not used in advertising or publicity without the
48       express prior written permission of Rensselaer Polytechnic Institute;
49
50   DISCLAIMER: The software is distributed" AS IS" without any express or
51   implied warranty, including but not limited to, any implied warranties
52   of merchantability or fitness for a particular purpose or any warrant)'
53   of non-infringement of any current or pending patent rights. The authors
54   of the software make no representations about the suitability of this
55   software for any particular purpose. The entire risk as to the quality
56   and performance of the software is with the user. Should the software
57   prove defective, the user assumes the cost of all necessary servicing,
58   repair or correction. In particular, neither Rensselaer Polytechnic
59   Institute, nor the authors of the software are liable for any indirect,
60   special, consequential, or incidental damages related to the software,
61   to the maximum extent the law permits. -->
62
63   <!-- ================================= -->
64   <!--  DEMO PUBLIC CALENDAR STYLESHEET  -->
65   <!-- ================================= -->
66
67   <!-- URL of resources common to all bedework apps (javascript, images) -->
68   <xsl:variable name="resourceCommons">../../../bedework-common</xsl:variable>
69
70   <!-- DEFINE INCLUDES -->
71   <!-- cannot use the resourceCommons variable in xsl:include paths -->
72   <xsl:include href="../../../bedework-common/default/default/errors.xsl"/>
73   <xsl:include href="../../../bedework-common/default/default/messages.xsl"/>
74
75   <!-- DEFINE GLOBAL CONSTANTS -->
76
77   <!-- URL of the XSL template directory -->
78   <!-- The approot is an appropriate place to put
79        included stylesheets and xml fragments. These are generally
80        referenced relatively (like errors.xsl and messages.xsl above);
81        this variable is here for your convenience if you choose to
82        reference it explicitly.  It is not used in this stylesheet, however,
83        and can be safely removed if you so choose. -->
84   <xsl:variable name="appRoot" select="/bedework/approot"/>
85
86   <!-- URL of html resources (images, css, other html); by default this is
87        set to the application root -->
88   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
89
90   <!-- Properly encoded prefixes to the application actions; use these to build
91        urls; allows the application to be used without cookies or within a portal.
92        These urls are rewritten in header.jsp and simply passed through for use
93        here. Every url includes a query string (either ?b=de or a real query
94        string) so that all links constructed in this stylesheet may begin the
95        query string with an ampersand. -->
96   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
97   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/main/setSelection"/>
98   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/calendar/fetchPublicCalendars"/>
99   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/main/setViewPeriod"/>
100   <xsl:variable name="listEvents" select="/bedework/urlPrefixes/main/listEvents"/>
101   <xsl:variable name="eventView" select="/bedework/urlPrefixes/event/eventView"/>
102   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/event/addEventRef"/>
103   <xsl:variable name="export" select="/bedework/urlPrefixes/misc/export"/>
104   <xsl:variable name="search" select="/bedework/urlPrefixes/search/search"/>
105   <xsl:variable name="search-next" select="/bedework/urlPrefixes/search/next"/>
106   <xsl:variable name="calendar-fetchForExport" select="/bedework/urlPrefixes/calendar/fetchForExport"/>
107   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mail/mailEvent"/>
108   <xsl:variable name="showPage" select="/bedework/urlPrefixes/main/showPage"/>
109   <xsl:variable name="stats" select="/bedework/urlPrefixes/stats/stats"/>
110
111   <!-- URL of the web application - includes web context -->
112   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/>
113
114   <!-- Other generally useful global variables -->
115   <xsl:variable name="privateCal">/ucal</xsl:variable>
116   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
117   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
118   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
119
120
121   <!-- MAIN TEMPLATE -->
122   <xsl:template match="/">
123     <html lang="en">
124       <head>
125         <title>School of Engineering: Example Bedework Departmental Calendar Suite</title>
126         <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
127         <link rel="stylesheet" type="text/css" href="{$resourcesRoot}/default/default/soe.css" />
128         <link rel="stylesheet" href="{$resourcesRoot}/default/default/subColors.css"/>
129         <!-- load javascript -->
130         <xsl:if test="/bedework/page='calendarList' or /bedework/page='displayCalendarForExport'">
131           <script type="text/javascript" src="{$resourceCommons}/javascript/dojo/dojo.js">&#160;</script>
132           <script type="text/javascript" src="{$resourcesRoot}/resources/javascript/bedework.js">&#160;</script>
133         </xsl:if>
134         <!-- address bar icon -->
135         <link rel="icon" type="image/ico" href="{$resourcesRoot}/images/bedework.ico" />
136       </head>
137       <body>
138         <xsl:call-template name="headBar"/>
139         <xsl:if test="/bedework/error">
140           <div id="errors">
141             <xsl:apply-templates select="/bedework/error"/>
142           </div>
143         </xsl:if>
144         <xsl:call-template name="tabs"/>
145         <xsl:call-template name="navigation"/>
146         <xsl:call-template name="searchBar"/>
147         <xsl:choose>
148           <xsl:when test="/bedework/page='event'">
149             <!-- show an event -->
150             <xsl:apply-templates select="/bedework/event"/>
151           </xsl:when>
152           <xsl:when test="/bedework/page='showSysStats'">
153             <!-- show system stats -->
154             <xsl:call-template name="stats"/>
155           </xsl:when>
156           <xsl:when test="/bedework/page='calendarList'">
157             <!-- show a list of all calendars -->
158             <xsl:apply-templates select="/bedework/calendars"/>
159           </xsl:when>
160           <xsl:when test="/bedework/page='displayCalendarForExport'">
161             <!-- page for calendar export (can optionally be replaced by
162                  a pop-up widget; see the calendars template) -->
163             <xsl:apply-templates select="/bedework/currentCalendar" mode="export"/>
164           </xsl:when>
165           <xsl:when test="/bedework/page='searchResult'">
166             <!-- display search results -->
167             <xsl:call-template name="searchResult"/>
168           </xsl:when>
169           <xsl:otherwise>
170             <!-- otherwise, show the eventsCalendar -->
171             <!-- main eventCalendar content -->
172             <xsl:choose>
173               <xsl:when test="/bedework/periodname='Day'">
174                 <xsl:call-template name="listView"/>
175               </xsl:when>
176               <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
177                 <xsl:choose>
178                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='cal'">
179                     <xsl:call-template name="weekView"/>
180                   </xsl:when>
181                   <xsl:otherwise>
182                     <xsl:call-template name="listView"/>
183                   </xsl:otherwise>
184                 </xsl:choose>
185               </xsl:when>
186               <xsl:when test="/bedework/periodname='Month'">
187                 <xsl:choose>
188                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
189                     <xsl:call-template name="listView"/>
190                   </xsl:when>
191                   <xsl:otherwise>
192                     <xsl:call-template name="monthView"/>
193                   </xsl:otherwise>
194                 </xsl:choose>
195               </xsl:when>
196               <xsl:otherwise>
197                 <xsl:call-template name="yearView"/>
198               </xsl:otherwise>
199             </xsl:choose>
200           </xsl:otherwise>
201         </xsl:choose>
202         <!-- footer -->
203         <xsl:call-template name="footer"/>
204       </body>
205     </html>
206   </xsl:template>
207
208   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
209   <!-- these templates are separated out for convenience and to simplify the default template -->
210
211   <xsl:template name="headBar">
212     <div id="headBar">
213       <div id="bedeworkLogo">
214         <a href="/bedework/">
215           <img src="{$resourcesRoot}/images/soecal/soeBedeworkLogo.gif" width="296" height="69" border="0" alt="Bedework" align="right"/>
216         </a>
217       </div>
218       <h1>Example Departmental Calendar Suite</h1>
219       <!--<ul id="schoolLinks">
220         <li><a href="{$privateCal}">Personal Calendar</a></li>
221         <li><a href="http://www.yourschoolhere.edu">School Home</a></li>
222         <li><a href="http://www.bedework.org/">Other Link</a></li>
223         <li>
224           <a href="http://helpdesk.rpi.edu/update.do?catcenterkey=51">
225             Example Calendar Help
226           </a>
227         </li>
228       </ul> -->
229     </div>
230     <!--  Turn off the date range table for this departmental view -->
231     <!--<table id="curDateRangeTable"  cellspacing="0">
232       <td class="sideBarOpenCloseIcon">
233         &#160; -->
234         <!--
235         we may choose to implement calendar selection in the public calendar
236         using a sidebar; leave this comment here for now.
237         <xsl:choose>
238           <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
239             <a href="?setappvar=sidebar(opened)">
240               <img alt="open sidebar" src="{$resourcesRoot}/resources/sideBarArrowOpen.gif" width="21" height="16" border="0" align="left"/>
241             </a>
242           </xsl:when>
243           <xsl:otherwise>
244             <a href="?setappvar=sidebar(closed)">
245               <img alt="close sidebar" src="{$resourcesRoot}/resources/sideBarArrowClose.gif" width="21" height="16" border="0" align="left"/>
246             </a>
247           </xsl:otherwise>
248         </xsl:choose>-->
249       <!-- </td>
250       <td class="date">
251         <xsl:choose>
252           <xsl:when test="/bedework/page='event'">
253             Event Information
254           </xsl:when>
255           <xsl:when test="/bedework/page='showSysStats' or
256                           /bedework/page='calendars'">
257             &#160;
258           </xsl:when>
259           <xsl:otherwise>
260             <xsl:value-of select="/bedework/firstday/longdate"/>
261             <xsl:if test="/bedework/periodname!='Day'">
262               -
263               <xsl:value-of select="/bedework/lastday/longdate"/>
264             </xsl:if>
265           </xsl:otherwise>
266         </xsl:choose>
267       </td>
268       <td class="rssPrint">
269         <a href="javascript:window.print()" title="print this view">
270           <img alt="print this view" src="{$resourcesRoot}/images/std-print-icon.gif" width="20" height="14" border="0"/> print
271         </a>
272         <a class="rss" href="{$listEvents}&amp;setappvar=summaryMode(details)&amp;skinName=rss-list&amp;days=3" title="RSS feed">RSS</a>
273       </td>
274     </table>-->
275   </xsl:template>
276
277   <xsl:template name="tabs">
278     <xsl:choose>
279       <xsl:when test="/bedework/page='eventscalendar'">
280         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
281           <tr>
282             <td>
283               <xsl:choose>
284                 <xsl:when test="/bedework/periodname='Day'">
285                   <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>
286                 </xsl:when>
287                 <xsl:otherwise>
288                   <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>
289                 </xsl:otherwise>
290               </xsl:choose>
291             </td>
292             <td>
293               <xsl:choose>
294                 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
295                   <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>
296                  </xsl:when>
297                 <xsl:otherwise>
298                   <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>
299                  </xsl:otherwise>
300               </xsl:choose>
301             </td>
302             <td>
303               <xsl:choose>
304                 <xsl:when test="/bedework/periodname='Month'">
305                   <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>
306                 </xsl:when>
307                 <xsl:otherwise>
308                   <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>
309                 </xsl:otherwise>
310               </xsl:choose>
311             </td>
312             <td>
313               <xsl:choose>
314                 <xsl:when test="/bedework/periodname='Year'">
315                   <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>
316                 </xsl:when>
317                 <xsl:otherwise>
318                   <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>
319                 </xsl:otherwise>
320               </xsl:choose>
321             </td>
322             <td class="rssPrint">
323               <a href="javascript:window.print()" title="print this view">
324                 <img alt="print this view" src="{$resourcesRoot}/images/std-print-icon.gif" width="20" height="14" border="0"/> print
325               </a>
326               <a class="rss" href="{$listEvents}&amp;setappvar=summaryMode(details)&amp;skinName=rss-list&amp;days=3" title="RSS feed">RSS</a>
327             </td>
328           </tr>
329         </table>
330       </xsl:when>
331       <xsl:otherwise>
332         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
333           <tr>
334             <td>
335               <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>
336             </td>
337             <td>
338               <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>
339             </td>
340             <td>
341               <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>
342             </td>
343             <td>
344               <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>
345             </td>
346             <td class="rssPrint">
347               <a href="javascript:window.print()" title="print this view">
348                 <img alt="print this view" src="{$resourcesRoot}/images/std-print-icon.gif" width="20" height="14" border="0"/> print
349               </a>
350               <a class="rss" href="{$setSelection}&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
351             </td>
352           </tr>
353         </table>
354       </xsl:otherwise>
355     </xsl:choose>
356   </xsl:template>
357
358   <xsl:template name="navigation">
359     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
360       <tr>
361         <td class="leftCell">
362           <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>
363           <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>
364           <xsl:choose>
365             <xsl:when test="/bedework/periodname='Year'">
366               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
367             </xsl:when>
368             <xsl:when test="/bedework/periodname='Month'">
369               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
370             </xsl:when>
371             <xsl:when test="/bedework/periodname='Week'">
372               Week of <xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
373             </xsl:when>
374             <xsl:otherwise>
375               <xsl:value-of select="/bedework/firstday/longdate"/>
376             </xsl:otherwise>
377           </xsl:choose>
378         </td>
379         <td class="todayButton">
380           <a href="{$setViewPeriod}&amp;viewType=todayView&amp;date={$curdate}">
381             <img src="{$resourcesRoot}/images/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
382           </a>
383         </td>
384         <td align="right" class="gotoForm">
385           <form name="calForm" method="post" action="{$setViewPeriod}">
386              <table border="0" cellpadding="0" cellspacing="0">
387               <tr>
388                 <xsl:if test="/bedework/periodname!='Year'">
389                   <td>
390                     <select name="viewStartDate.month">
391                       <xsl:for-each select="/bedework/monthvalues/val">
392                         <xsl:variable name="temp" select="."/>
393                         <xsl:variable name="pos" select="position()"/>
394                         <xsl:choose>
395                           <xsl:when test="/bedework/monthvalues[start=$temp]">
396                             <option value="{$temp}" selected="selected">
397                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
398                             </option>
399                           </xsl:when>
400                           <xsl:otherwise>
401                             <option value="{$temp}">
402                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
403                             </option>
404                           </xsl:otherwise>
405                         </xsl:choose>
406                       </xsl:for-each>
407                     </select>
408                   </td>
409                   <xsl:if test="/bedework/periodname!='Month'">
410                     <td>
411                       <select name="viewStartDate.day">
412                         <xsl:for-each select="/bedework/dayvalues/val">
413                           <xsl:variable name="temp" select="."/>
414                           <xsl:variable name="pos" select="position()"/>
415                           <xsl:choose>
416                             <xsl:when test="/bedework/dayvalues[start=$temp]">
417                               <option value="{$temp}" selected="selected">
418                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
419                               </option>
420                             </xsl:when>
421                             <xsl:otherwise>
422                               <option value="{$temp}">
423                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
424                               </option>
425                             </xsl:otherwise>
426                           </xsl:choose>
427                         </xsl:for-each>
428                       </select>
429                     </td>
430                   </xsl:if>
431                 </xsl:if>
432                 <td>
433                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
434                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
435                 </td>
436                 <td>
437                   <input name="submit" type="submit" value="go"/>
438                 </td>
439               </tr>
440             </table>
441           </form>
442         </td>
443         <td class="rightCell">
444         </td>
445       </tr>
446     </table>
447   </xsl:template>
448
449   <xsl:template name="searchBar">
450     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="searchBarTable">
451        <tr>
452          <td class="leftCell">
453            <xsl:choose>
454              <xsl:when test="/bedework/selectionState/selectionType = 'calendar'">
455                Calendar: <xsl:value-of select="/bedework/selectionState/subscriptions/subscription/calendar/name"/>
456                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
457              </xsl:when>
458              <xsl:when test="/bedework/selectionState/selectionType = 'search'">
459                Current search: <xsl:value-of select="/bedework/search"/>
460                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
461              </xsl:when>
462              <xsl:when test="/bedework/selectionState/selectionType = 'subscription'">
463                Subscription: (not implemented yet)
464                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
465              </xsl:when>
466              <xsl:when test="/bedework/selectionState/selectionType = 'filter'">
467                Filter: (not implemented yet)
468                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
469              </xsl:when>
470              <xsl:otherwise><!-- view -->
471                View:
472                <form name="selectViewForm" method="post" action="{$setSelection}">
473                 <select name="viewName" onchange="submit()" >
474                   <xsl:for-each select="/bedework/views/view">
475                     <xsl:variable name="name" select="name"/>
476                     <xsl:choose>
477                       <xsl:when test="name=/bedework/selectionState/view/name">
478                         <option value="{$name}" selected="selected"><xsl:value-of select="name"/></option>
479                       </xsl:when>
480                       <xsl:otherwise>
481                         <option value="{$name}"><xsl:value-of select="name"/></option>
482                       </xsl:otherwise>
483                     </xsl:choose>
484                   </xsl:for-each>
485                 </select>
486               </form>
487               <span class="link"><a href="{$setSelection}">default view</a> | <a href="{$fetchPublicCalendars}">available calendars</a></span>
488              </xsl:otherwise>
489            </xsl:choose>
490          </td>
491          <td class="rightCell">
492             <xsl:if test="/bedework/page!='searchResult'">
493               <form name="searchForm" id="searchForm" method="post" action="{$search}">
494                 Search:
495                 <input type="text" name="query" size="15">
496                   <xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute>
497                 </input>
498                 <input type="submit" name="submit" value="go"/>
499               </form>
500               <xsl:text> </xsl:text>
501             </xsl:if>
502             <xsl:choose>
503               <xsl:when test="/bedework/periodname='Day'">
504                 <img src="{$resourcesRoot}/images/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
505               </xsl:when>
506               <xsl:when test="/bedework/periodname='Year'">
507                 <img src="{$resourcesRoot}/images/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
508               </xsl:when>
509               <xsl:when test="/bedework/periodname='Month'">
510                 <xsl:choose>
511                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
512                     <a href="{$setup}&amp;setappvar=monthViewMode(cal)" title="toggle list/calendar view">
513                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
514                     </a>
515                   </xsl:when>
516                   <xsl:otherwise>
517                     <a href="{$setup}&amp;setappvar=monthViewMode(list)" title="toggle list/calendar view">
518                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
519                     </a>
520                   </xsl:otherwise>
521                 </xsl:choose>
522               </xsl:when>
523               <xsl:otherwise>
524                 <xsl:choose>
525                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='cal'">
526                     <a href="{$setup}&amp;setappvar=weekViewMode(list)" title="toggle list/calendar view">
527                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
528                     </a>
529                   </xsl:when>
530                   <xsl:otherwise>
531                     <a href="{$setup}&amp;setappvar=weekViewMode(cal)" title="toggle list/calendar view">
532                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
533                     </a>
534                   </xsl:otherwise>
535                 </xsl:choose>
536               </xsl:otherwise>
537             </xsl:choose>
538             <xsl:choose>
539               <xsl:when test="/bedework/periodname='Year' or
540                               (/bedework/periodname='Month' and
541                               (/bedework/appvar[key='monthViewMode']/value='cal' or
542                                not(/bedework/appvar[key='monthViewMode']))) or
543                               (/bedework/periodname='Week' and
544                               (/bedework/appvar[key='weekViewMode']/value='cal' or
545                                not(/bedework/appvar[key='weekViewMode'])))">
546                 <xsl:choose>
547                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
548                     <img src="{$resourcesRoot}/images/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
549                   </xsl:when>
550                   <xsl:otherwise>
551                     <img src="{$resourcesRoot}/images/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
552                   </xsl:otherwise>
553                 </xsl:choose>
554               </xsl:when>
555               <xsl:otherwise>
556                 <xsl:choose>
557                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
558                     <a href="{$setup}&amp;setappvar=summaryMode(summary)" title="toggle summary/detailed view">
559                       <img src="{$resourcesRoot}/images/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
560                     </a>
561                   </xsl:when>
562                   <xsl:otherwise>
563                     <a href="{$setup}&amp;setappvar=summaryMode(details)" title="toggle summary/detailed view">
564                       <img src="{$resourcesRoot}/images/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
565                     </a>
566                   </xsl:otherwise>
567                 </xsl:choose>
568               </xsl:otherwise>
569             </xsl:choose>
570             <a href="{$setup}"><img src="{$resourcesRoot}/images/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
571           </td>
572        </tr>
573     </table>
574   </xsl:template>
575
576   <!--==== SINGLE EVENT ====-->
577   <xsl:template match="event">
578     <xsl:variable name="subscriptionId" select="subscription/id"/>
579     <xsl:variable name="calPath" select="calendar/encodedPath"/>
580     <xsl:variable name="guid" select="guid"/>
581     <xsl:variable name="recurrenceId" select="recurrenceId"/>
582     <xsl:variable name="statusClass">
583       <xsl:choose>
584         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
585         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
586         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
587       </xsl:choose>
588     </xsl:variable>
589     <h2 class="{$statusClass}">
590       <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
591       <xsl:choose>
592         <xsl:when test="link != ''">
593           <xsl:variable name="link" select="link"/>
594           <a href="{$link}">
595             <xsl:value-of select="summary"/>
596           </a>
597         </xsl:when>
598         <xsl:otherwise>
599           <xsl:value-of select="summary"/>
600         </xsl:otherwise>
601       </xsl:choose>
602     </h2>
603     <table id="eventTable" cellpadding="0" cellspacing="0">
604       <tr>
605         <td class="fieldname">When:</td>
606         <td class="fieldval">
607           <!-- always display local time -->
608           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
609           <xsl:if test="start/allday = 'false'">
610             <span class="time"><xsl:value-of select="start/time"/></span>
611           </xsl:if>
612           <xsl:if test="(end/longdate != start/longdate) or
613                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
614           <xsl:if test="end/longdate != start/longdate">
615             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
616           </xsl:if>
617           <xsl:choose>
618             <xsl:when test="start/allday = 'true'">
619               <span class="time"><em>(all day)</em></span>
620             </xsl:when>
621             <xsl:when test="end/longdate != start/longdate">
622               <span class="time"><xsl:value-of select="end/time"/></span>
623             </xsl:when>
624             <xsl:when test="end/time != start/time">
625               <span class="time"><xsl:value-of select="end/time"/></span>
626             </xsl:when>
627           </xsl:choose>
628           <!-- if timezones are not local, or if floating add labels: -->
629           <xsl:if test="start/timezone/islocal = 'false' or end/timezone/islocal = 'false'">
630             <xsl:text> </xsl:text>
631             --
632             <strong>
633               <xsl:choose>
634                 <xsl:when test="start/floating = 'true'">
635                   Floating time
636                 </xsl:when>
637                 <xsl:otherwise>
638                   Local time
639                 </xsl:otherwise>
640               </xsl:choose>
641             </strong>
642             <br/>
643           </xsl:if>
644           <!-- display in timezone if not local or floating time) -->
645           <xsl:if test="(start/timezone/islocal = 'false' or end/timezone/islocal = 'false') and start/floating = 'false'">
646             <xsl:choose>
647               <xsl:when test="start/timezone/id != end/timezone/id">
648                 <!-- need to display both timezones if they differ from start to end -->
649                 <table border="0" cellspacing="0" id="tztable">
650                   <tr>
651                     <td>
652                       <strong>Start:</strong>
653                     </td>
654                     <td>
655                       <xsl:choose>
656                         <xsl:when test="start/timezone/islocal='true'">
657                           <xsl:value-of select="start/dayname"/>,
658                           <xsl:value-of select="start/longdate"/>
659                           <xsl:text> </xsl:text>
660                           <span class="time"><xsl:value-of select="start/time"/></span>
661                         </xsl:when>
662                         <xsl:otherwise>
663                           <xsl:value-of select="start/timezone/dayname"/>,
664                           <xsl:value-of select="start/timezone/longdate"/>
665                           <xsl:text> </xsl:text>
666                           <span class="time"><xsl:value-of select="start/timezone/time"/></span>
667                         </xsl:otherwise>
668                       </xsl:choose>
669                     </td>
670                     <td>
671                       --
672                       <strong><xsl:value-of select="start/timezone/id"/></strong>
673                     </td>
674                   </tr>
675                   <tr>
676                     <td>
677                       <strong>End:</strong>
678                     </td>
679                     <td>
680                       <xsl:choose>
681                         <xsl:when test="end/timezone/islocal='true'">
682                           <xsl:value-of select="end/dayname"/>,
683                           <xsl:value-of select="end/longdate"/>
684                           <xsl:text> </xsl:text>
685                           <span class="time"><xsl:value-of select="end/time"/></span>
686                         </xsl:when>
687                         <xsl:otherwise>
688                           <xsl:value-of select="end/timezone/dayname"/>,
689                           <xsl:value-of select="end/timezone/longdate"/>
690                           <xsl:text> </xsl:text>
691                           <span class="time"><xsl:value-of select="end/timezone/time"/></span>
692                         </xsl:otherwise>
693                       </xsl:choose>
694                     </td>
695                     <td>
696                       --
697                       <strong><xsl:value-of select="end/timezone/id"/></strong>
698                     </td>
699                   </tr>
700                 </table>
701               </xsl:when>
702               <xsl:otherwise>
703                 <!-- otherwise, timezones are the same: display as a single line  -->
704                 <xsl:value-of select="start/timezone/dayname"/>, <xsl:value-of select="start/timezone/longdate"/><xsl:text> </xsl:text>
705                 <xsl:if test="start/allday = 'false'">
706                   <span class="time"><xsl:value-of select="start/timezone/time"/></span>
707                 </xsl:if>
708                 <xsl:if test="(end/timezone/longdate != start/timezone/longdate) or
709                               ((end/timezone/longdate = start/timezone/longdate) and (end/timezone/time != start/timezone/time))"> - </xsl:if>
710                 <xsl:if test="end/timezone/longdate != start/timezone/longdate">
711                   <xsl:value-of select="substring(end/timezone/dayname,1,3)"/>, <xsl:value-of select="end/timezone/longdate"/><xsl:text> </xsl:text>
712                 </xsl:if>
713                 <xsl:choose>
714                   <xsl:when test="start/allday = 'true'">
715                     <span class="time"><em>(all day)</em></span>
716                   </xsl:when>
717                   <xsl:when test="end/timezone/longdate != start/timezone/longdate">
718                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
719                   </xsl:when>
720                   <xsl:when test="end/timezone/time != start/timezone/time">
721                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
722                   </xsl:when>
723                 </xsl:choose>
724                 <xsl:text> </xsl:text>
725                 --
726                 <strong><xsl:value-of select="start/timezone/id"/></strong>
727               </xsl:otherwise>
728             </xsl:choose>
729           </xsl:if>
730         </td>
731         <th class="icalIcon" rowspan="2">
732           <div id="eventIcons">
733             <xsl:if test="recurrenceId = ''">
734               <!-- hide this for a 3.3.1 bug: can't add a reference to a recurring event at this time -->
735               <a href="{$privateCal}/event/addEventRef.do?subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
736                 <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon.gif" width="20" height="26" border="0" alt="Add event to MyCalendar"/>
737               add to my calendar</a>
738             </xsl:if>
739             <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
740             <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">
741               <img src="{$resourcesRoot}/images/std-ical_icon.gif" width="20" height="26" border="0" alt="Download this event"/>
742              download</a>
743           </div>
744         </th>
745       </tr>
746       <tr>
747         <td class="fieldname">Where:</td>
748         <td class="fieldval">
749           <xsl:choose>
750             <xsl:when test="location/link=''">
751               <xsl:value-of select="location/address"/>
752             </xsl:when>
753             <xsl:otherwise>
754               <xsl:variable name="locationLink" select="location/link"/>
755               <a href="{$locationLink}">
756                 <xsl:value-of select="location/address"/>
757               </a>
758             </xsl:otherwise>
759           </xsl:choose>
760           <xsl:if test="location/subaddress!=''">
761             <br/><xsl:value-of select="location/subaddress"/>
762           </xsl:if>
763         </td>
764       </tr>
765       <tr>
766         <td class="fieldname">Description:</td>
767         <td colspan="2" class="fieldval description">
768           <xsl:if test="xproperties/node()[name()='X-BEDEWORK-IMAGE']">
769             <xsl:variable name="bwImageUrl"><xsl:value-of select="xproperties/node()[name()='X-BEDEWORK-IMAGE']/values/text"/></xsl:variable>
770             <img src="{$bwImageUrl}" class="bwEventImage"/>
771           </xsl:if>
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="skinName" value="ical"/>
1305               <input type="hidden" name="contentName" value="calendar.ics"/>
1306               <input type="radio" name="dateLimits" value="active" checked="checked" onclick="changeClass('exportDateRange','invisible')"/> today forward
1307               <input type="radio" name="dateLimits" value="none" onclick="changeClass('exportDateRange','invisible')"/> all dates
1308               <input type="radio" name="dateLimits" value="limited" onclick="changeClass('exportDateRange','visible')"/> date range
1309               <div id="exportDateRange" class="invisible">
1310                 Start: <div dojoType="dropdowndatepicker" formatLength="medium" saveFormat="yyyyMMdd" id="bwExportCalendarWidgetStartDate"><xsl:text> </xsl:text></div>
1311                 End: <div dojoType="dropdowndatepicker" formatLength="medium" saveFormat="yyyyMMdd" id="bwExportCalendarWidgetEndDate"><xsl:text> </xsl:text></div>
1312               </div>
1313               <p><input type="submit" value="export" class="bwWidgetSubmit" onclick="fillExportFields(this.form);hideWidget('bwCalendarExportWidget')"/></p>
1314             </form>
1315           </div>-->
1316         </td>
1317       </tr>
1318       <tr>
1319         <td class="leftCell">
1320           <ul class="calendarTree">
1321             <xsl:apply-templates select="calendar/calendar[position() &lt;= ceiling($topLevelCalCount div 2)]" mode="calTree"/>
1322           </ul>
1323         </td>
1324         <td>
1325           <ul class="calendarTree">
1326             <xsl:apply-templates select="calendar/calendar[position() &gt; ceiling($topLevelCalCount div 2)]" mode="calTree"/>
1327           </ul>
1328         </td>
1329       </tr>
1330     </table>
1331   </xsl:template>
1332
1333   <xsl:template match="calendar" mode="calTree">
1334     <xsl:variable name="itemClass">
1335       <xsl:choose>
1336         <xsl:when test="calendarCollection='false'">folder</xsl:when>
1337         <xsl:otherwise>calendar</xsl:otherwise>
1338       </xsl:choose>
1339     </xsl:variable>
1340     <xsl:variable name="url" select="encodedPath"/>
1341     <li class="{$itemClass}">
1342       <a href="{$setSelection}&amp;calUrl={$url}" title="view calendar"><xsl:value-of select="name"/></a>
1343       <xsl:if test="calendarCollection='true'">
1344         <xsl:variable name="calPath" select="path"/>
1345         <span class="exportCalLink">
1346           <!-- To use the dojo floating widget from the template above, uncomment
1347                this block:
1348           <xsl:variable name="name" select="name"/>
1349           <xsl:variable name="idForCal" select="translate(translate(path,'/','S'),' ','s')"/>
1350           <a href="javascript:launchExportWidget('exportCalendarForm','{$export}','{$name}','{$calPath}')" id="{$idForCal}" title="export calendar as iCal">
1351             <img src="{$resourcesRoot}/images/calIconExport-sm.gif" width="13" height="13" alt="export calendar" border="0"/>
1352           </a> -->
1353           <a href="{$calendar-fetchForExport}&amp;calPath={$calPath}" title="export calendar as iCal">
1354             <img src="{$resourcesRoot}/images/calIconExport-sm.gif" width="13" height="13" alt="export calendar" border="0"/>
1355           </a>
1356         </span>
1357       </xsl:if>
1358       <xsl:if test="calendar">
1359         <ul>
1360           <xsl:apply-templates select="calendar" mode="calTree"/>
1361         </ul>
1362       </xsl:if>
1363     </li>
1364   </xsl:template>
1365
1366   <!-- calendar export page -->
1367   <xsl:template match="currentCalendar" mode="export">
1368     <h2 class="bwStatusConfirmed">Export Calendar</h2>
1369     <div id="export">
1370       <p>
1371         <strong>Calendar to export:</strong>
1372       </p>
1373       <div class="indent">
1374         Name: <strong><em><xsl:value-of select="name"/></em></strong><br/>
1375         Path: <xsl:value-of select="path"/>
1376       </div>
1377       <p>
1378         <strong>Event date limits:</strong>
1379       </p>
1380       <form name="exportCalendarForm" id="exportCalendarForm" action="{$export}" method="post">
1381         <input type="hidden" name="calPath">
1382           <xsl:attribute name="value"><xsl:value-of select="path"/></xsl:attribute>
1383         </input>
1384         <!-- fill these on submit -->
1385         <input type="hidden" name="eventStartDate.year" value=""/>
1386         <input type="hidden" name="eventStartDate.month" value=""/>
1387         <input type="hidden" name="eventStartDate.day" value=""/>
1388         <input type="hidden" name="eventEndDate.year" value=""/>
1389         <input type="hidden" name="eventEndDate.month" value=""/>
1390         <input type="hidden" name="eventEndDate.day" value=""/>
1391         <!-- static fields -->
1392         <input type="hidden" name="nocache" value="no"/>
1393         <input type="hidden" name="contentName">
1394           <xsl:attribute name="value"><xsl:value-of select="name"/>.ics</xsl:attribute>
1395         </input>
1396         <!-- visible fields -->
1397         <input type="radio" name="dateLimits" value="active" checked="checked" onclick="changeClass('exportDateRange','invisible')"/> today forward
1398         <input type="radio" name="dateLimits" value="none" onclick="changeClass('exportDateRange','invisible')"/> all dates
1399         <input type="radio" name="dateLimits" value="limited" onclick="changeClass('exportDateRange','visible')"/> date range
1400         <div id="exportDateRange" class="invisible">
1401           Start: <div dojoType="dropdowndatepicker" formatLength="medium" saveFormat="yyyyMMdd" id="bwExportCalendarWidgetStartDate"><xsl:text> </xsl:text></div>
1402           End: <div dojoType="dropdowndatepicker" formatLength="medium" saveFormat="yyyyMMdd" id="bwExportCalendarWidgetEndDate"><xsl:text> </xsl:text></div>
1403         </div>
1404         <p><input type="submit" value="export" class="bwWidgetSubmit" onclick="fillExportFields(this.form)"/></p>
1405       </form>
1406     </div>
1407   </xsl:template>
1408
1409   <!--==== SEARCH RESULT ====-->
1410   <xsl:template name="searchResult">
1411     <h2 class="bwStatusConfirmed">
1412       <div id="searchFilter">
1413         <form name="searchForm" method="post" action="{$search}">
1414           Search:
1415           <input type="text" name="query" size="15">
1416             <xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute>
1417           </input>
1418           <input type="submit" name="submit" value="go"/>
1419           Limit:
1420           <xsl:choose>
1421             <xsl:when test="/bedework/searchResults/searchLimits = 'beforeToday'">
1422               <input type="radio" name="searchLimits" value="fromToday"/>today forward
1423               <input type="radio" name="searchLimits" value="beforeToday" checked="checked"/>past dates
1424               <input type="radio" name="searchLimits" value="none"/>all dates
1425             </xsl:when>
1426             <xsl:when test="/bedework/searchResults/searchLimits = 'none'">
1427               <input type="radio" name="searchLimits" value="fromToday"/>today forward
1428               <input type="radio" name="searchLimits" value="beforeToday"/>past dates
1429               <input type="radio" name="searchLimits" value="none" checked="checked"/>all dates
1430             </xsl:when>
1431             <xsl:otherwise>
1432               <input type="radio" name="searchLimits" value="fromToday" checked="checked"/>today forward
1433               <input type="radio" name="searchLimits" value="beforeToday"/>past dates
1434               <input type="radio" name="searchLimits" value="none"/>all dates
1435             </xsl:otherwise>
1436           </xsl:choose>
1437         </form>
1438       </div>
1439       Search Result
1440     </h2>
1441     <table id="searchTable" cellpadding="0" cellspacing="0">
1442       <tr>
1443         <th colspan="5">
1444           <xsl:if test="/bedework/searchResults/numPages &gt; 1">
1445             <xsl:variable name="curPage" select="/bedework/searchResults/curPage"/>
1446             <div id="searchPageForm">
1447               page:
1448               <xsl:if test="/bedework/searchResults/curPage != 1">
1449                 <xsl:variable name="prevPage" select="number($curPage) - 1"/>
1450                 &lt;<a href="{$search-next}&amp;pageNum={$prevPage}">prev</a>
1451               </xsl:if>
1452               <xsl:text> </xsl:text>
1453
1454               <xsl:call-template name="searchResultPageNav">
1455                 <xsl:with-param name="page">
1456                   <xsl:choose>
1457                     <xsl:when test="number($curPage) - 10 &lt; 1">1</xsl:when>
1458                     <xsl:otherwise><xsl:value-of select="number($curPage) - 6"/></xsl:otherwise>
1459                   </xsl:choose>
1460                 </xsl:with-param>
1461               </xsl:call-template>
1462
1463               <xsl:text> </xsl:text>
1464               <xsl:choose>
1465                 <xsl:when test="$curPage != /bedework/searchResults/numPages">
1466                   <xsl:variable name="nextPage" select="number($curPage) + 1"/>
1467                   <a href="{$search-next}&amp;pageNum={$nextPage}">next</a>&gt;
1468                 </xsl:when>
1469                 <xsl:otherwise>
1470                   <span class="hidden">next&gt;</span><!-- occupy the space to keep the navigation from moving around -->
1471                 </xsl:otherwise>
1472               </xsl:choose>
1473             </div>
1474           </xsl:if>
1475           <xsl:value-of select="/bedework/searchResults/resultSize"/>
1476           result<xsl:if test="/bedework/searchResults/resultSize != 1">s</xsl:if> returned
1477           for <em><xsl:value-of select="/bedework/searchResults/query"/></em>
1478         </th>
1479       </tr>
1480       <xsl:if test="/bedework/searchResults/searchResult">
1481         <tr class="fieldNames">
1482           <td>
1483             relevance
1484           </td>
1485           <td>
1486             summary
1487           </td>
1488           <td>
1489             date &amp; time
1490           </td>
1491           <td>
1492             calendar
1493           </td>
1494           <td>
1495             location
1496           </td>
1497         </tr>
1498       </xsl:if>
1499       <xsl:for-each select="/bedework/searchResults/searchResult">
1500         <xsl:variable name="subscriptionId" select="event/subscription/id"/>
1501         <xsl:variable name="calPath" select="event/calendar/encodedPath"/>
1502         <xsl:variable name="guid" select="event/guid"/>
1503         <xsl:variable name="recurrenceId" select="event/recurrenceId"/>
1504         <tr>
1505           <td class="relevance">
1506             <xsl:value-of select="ceiling(number(score)*100)"/>%
1507             <img src="{$resourcesRoot}/images/spacer.gif" height="4" class="searchRelevance">
1508               <xsl:attribute name="width"><xsl:value-of select="ceiling((number(score)*100) div 1.5)"/></xsl:attribute>
1509             </img>
1510           </td>
1511           <td>
1512             <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1513               <xsl:value-of select="event/summary"/>
1514             </a>
1515           </td>
1516           <td>
1517             <xsl:value-of select="event/start/longdate"/>
1518             <xsl:text> </xsl:text>
1519             <xsl:value-of select="event/start/time"/>
1520             <xsl:choose>
1521               <xsl:when test="event/start/longdate != event/end/longdate">
1522                 - <xsl:value-of select="event/end/longdate"/>
1523                 <xsl:text> </xsl:text>
1524                 <xsl:value-of select="event/end/time"/>
1525               </xsl:when>
1526               <xsl:when test="event/start/time != event/end/time">
1527                 - <xsl:value-of select="event/end/time"/>
1528               </xsl:when>
1529             </xsl:choose>
1530           </td>
1531           <td>
1532             <xsl:variable name="calUrl" select="event/calendar/encodedPath"/>
1533             <a href="{$setSelection}&amp;calUrl={$calUrl}">
1534               <xsl:value-of select="event/calendar/name"/>
1535             </a>
1536           </td>
1537           <td>
1538             <xsl:value-of select="event/location/address"/>
1539           </td>
1540         </tr>
1541       </xsl:for-each>
1542     </table>
1543   </xsl:template>
1544
1545   <xsl:template name="searchResultPageNav">
1546     <xsl:param name="page">1</xsl:param>
1547     <xsl:variable name="curPage" select="/bedework/searchResults/curPage"/>
1548     <xsl:variable name="numPages" select="/bedework/searchResults/numPages"/>
1549     <xsl:variable name="endPage">
1550       <xsl:choose>
1551         <xsl:when test="number($curPage) + 6 &gt; number($numPages)"><xsl:value-of select="$numPages"/></xsl:when>
1552         <xsl:otherwise><xsl:value-of select="number($curPage) + 6"/></xsl:otherwise>
1553       </xsl:choose>
1554     </xsl:variable>
1555     <xsl:choose>
1556       <xsl:when test="$page = $curPage">
1557         <xsl:value-of select="$page"/>
1558       </xsl:when>
1559       <xsl:otherwise>
1560         <a href="{$search-next}&amp;pageNum={$page}">
1561           <xsl:value-of select="$page"/>
1562         </a>
1563       </xsl:otherwise>
1564     </xsl:choose>
1565     <xsl:text> </xsl:text>
1566     <xsl:if test="$page &lt; $endPage">
1567        <xsl:call-template name="searchResultPageNav">
1568          <xsl:with-param name="page" select="number($page)+1"/>
1569       </xsl:call-template>
1570     </xsl:if>
1571   </xsl:template>
1572
1573   <!--+++++++++++++++ System Stats ++++++++++++++++++++-->
1574   <xsl:template name="stats">
1575     <div id="stats">
1576       <h2>System Statistics</h2>
1577
1578       <p>
1579         Stats collection:
1580       </p>
1581       <ul>
1582         <li>
1583           <a href="{$stats}&amp;enable=yes">enable</a> |
1584           <a href="{$stats}&amp;disable=yes">disable</a>
1585         </li>
1586         <li><a href="{$stats}&amp;fetch=yes">fetch statistics</a></li>
1587         <li><a href="{$stats}&amp;dump=yes">dump stats to log</a></li>
1588       </ul>
1589       <table id="statsTable" cellpadding="0">
1590         <xsl:for-each select="/bedework/sysStats/*">
1591           <xsl:choose>
1592             <xsl:when test="name(.) = 'header'">
1593               <tr>
1594                 <th colspan="2">
1595                   <xsl:value-of select="."/>
1596                 </th>
1597               </tr>
1598             </xsl:when>
1599             <xsl:otherwise>
1600               <tr>
1601                 <td class="label">
1602                   <xsl:value-of select="label"/>
1603                 </td>
1604                 <td class="value">
1605                   <xsl:value-of select="value"/>
1606                 </td>
1607               </tr>
1608             </xsl:otherwise>
1609           </xsl:choose>
1610         </xsl:for-each>
1611       </table>
1612     </div>
1613   </xsl:template>
1614
1615   <!--==== UTILITY TEMPLATES ====-->
1616
1617   <!-- search and replace template taken from
1618        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
1619   <xsl:template name="replace">
1620     <xsl:param name="string" select="''"/>
1621     <xsl:param name="pattern" select="''"/>
1622     <xsl:param name="replacement" select="''"/>
1623     <xsl:choose>
1624       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
1625         <xsl:value-of select="substring-before($string, $pattern)"/>
1626         <xsl:copy-of select="$replacement"/>
1627         <xsl:call-template name="replace">
1628           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
1629           <xsl:with-param name="pattern" select="$pattern"/>
1630           <xsl:with-param name="replacement" select="$replacement"/>
1631         </xsl:call-template>
1632       </xsl:when>
1633       <xsl:otherwise>
1634         <xsl:value-of select="$string"/>
1635       </xsl:otherwise>
1636     </xsl:choose>
1637   </xsl:template>
1638
1639   <!--==== FOOTER ====-->
1640
1641   <xsl:template name="footer">
1642     <div id="footer">
1643       Demonstration calendar; place footer information here.
1644     </div>
1645     <div id="subFoot">
1646       Based on the <a href="http://www.bedework.org/">Bedework Calendar</a> |
1647       <a href="?noxslt=yes">show XML</a> |
1648       <a href="?refreshXslt=yes">refresh XSLT</a>
1649     </div>
1650   </xsl:template>
1651 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.