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

Revision 1349 (checked in by johnsa, 6 years ago)

web clients: some stylesheet cleanup, addition of subscription styles to public list view

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