root/trunk/bedework/deployment/webpublic/uportal2/resources/demoskins/SoEDepartmental/default/default/default.xsl

Revision 952 (checked in by douglm, 7 years ago)

--

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="html"
5   indent="yes"
6   media-type="text/html"
7   doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
8   doctype-system="http://www.w3.org/TR/html4/loose.dtd"
9   standalone="yes"
10 />
11
12 <!-- =========================================================
13
14         DEMONSTRATION "DEPARTMENTAL" CALENDAR STYLESHEET
15
16      This stylesheet is for the "soe" (School of Engineering)
17      calendar suite; it is an example of a departmental skin.
18
19      This skin, along with the preferences for the Calendar
20      Suite owner differ from the main public skin (default.xsl) in the
21      following ways:
22        - different header, title, and footer
23        - default view = Month
24        - default layout = list view (rather than calendar grid)
25        - different color scheme
26
27      Otherwise, for the sake of demonstration, we've left most of the
28      functionality of the public client in place.
29
30      For detailed instructions on how to work with the XSLT
31      stylesheets included with this distribution, please see the
32      Bedework Design Guide at
33      http://www.bedework.org/bedework/update.do?artcenterkey=24
34
35 ===============================================================  -->
36
37 <!-- **********************************************************************
38   Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
39
40   Redistribution and use of this distribution in source and binary forms,
41   with or without modification, are permitted provided that:
42      The above copyright notice and this permission notice appear in all
43       copies and supporting documentation;
44
45       The name, identifiers, and trademarks of Rensselaer Polytechnic
46       Institute are not used in advertising or publicity without the
47       express prior written permission of Rensselaer Polytechnic Institute;
48
49   DISCLAIMER: The software is distributed" AS IS" without any express or
50   implied warranty, including but not limited to, any implied warranties
51   of merchantability or fitness for a particular purpose or any warrant)'
52   of non-infringement of any current or pending patent rights. The authors
53   of the software make no representations about the suitability of this
54   software for any particular purpose. The entire risk as to the quality
55   and performance of the software is with the user. Should the software
56   prove defective, the user assumes the cost of all necessary servicing,
57   repair or correction. In particular, neither Rensselaer Polytechnic
58   Institute, nor the authors of the software are liable for any indirect,
59   special, consequential, or incidental damages related to the software,
60   to the maximum extent the law permits. -->
61
62   <!-- ================================= -->
63   <!--  DEMO PUBLIC CALENDAR STYLESHEET  -->
64   <!-- ================================= -->
65
66   <!-- DEFINE INCLUDES -->
67   <xsl:include href="errors.xsl"/>
68
69   <!-- DEFINE GLOBAL CONSTANTS -->
70
71   <!-- URL of the XSL template directory -->
72   <!-- The approot is an appropriate place to put
73        included stylesheets and xml fragments. These are generally
74        referenced relatively (like errors.xsl and messages.xsl above);
75        this variable is here for your convenience if you choose to
76        reference it explicitly.  It is not used in this stylesheet, however,
77        and can be safely removed if you so choose. -->
78   <xsl:variable name="appRoot" select="/bedework/approot"/>
79
80   <!-- URL of html resources (images, css, other html); by default this is
81        set to the application root -->
82   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
83
84   <!-- Properly encoded prefixes to the application actions; use these to build
85        urls; allows the application to be used without cookies or within a portal. -->
86   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
87   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/setSelection"/>
88   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/fetchPublicCalendars"/>
89   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/setViewPeriod"/>
90   <xsl:variable name="eventView" select="/bedework/urlPrefixes/eventView"/>
91   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/addEventRef"/>
92   <xsl:variable name="export" select="/bedework/urlPrefixes/export/a/@href"/>
93   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mailEvent"/>
94   <xsl:variable name="showPage" select="/bedework/urlPrefixes/showPage"/>
95   <xsl:variable name="stats" select="/bedework/urlPrefixes/stats"/>
96
97   <!-- Other generally useful global variables -->
98   <xsl:variable name="privateCal">/ucal</xsl:variable>
99   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
100   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
101   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
102   <xsl:variable name="skin">default</xsl:variable>
103
104
105   <!-- MAIN TEMPLATE -->
106   <xsl:template match="/">
107     <html lang="en">
108       <head>
109         <title>School of Engineering: Example Bedework Departmental Calendar Suite</title>
110         <link rel="stylesheet" type="text/css" href="{$resourcesRoot}/default/default/soe.css" />
111         <link rel="icon" type="image/ico" href="{$resourcesRoot}/images/bedework.ico" />
112       </head>
113       <body>
114         <xsl:call-template name="headBar"/>
115         <xsl:if test="/bedework/error">
116           <div id="errors">
117             <xsl:apply-templates select="/bedework/error"/>
118           </div>
119         </xsl:if>
120         <xsl:call-template name="tabs"/>
121         <xsl:call-template name="navigation"/>
122         <xsl:choose>
123           <xsl:when test="/bedework/page='event'">
124             <!-- show an event -->
125             <xsl:apply-templates select="/bedework/event"/>
126           </xsl:when>
127           <xsl:when test="/bedework/page='showSysStats'">
128             <!-- show system stats -->
129             <xsl:call-template name="stats"/>
130           </xsl:when>
131           <xsl:when test="/bedework/page='calendarList'">
132             <!-- show a list of all calendars -->
133             <xsl:apply-templates select="/bedework/calendars"/>
134           </xsl:when>
135           <xsl:otherwise>
136             <!-- otherwise, show the eventsCalendar -->
137             <xsl:if test="/bedework/periodname!='Year'">
138               <xsl:call-template name="searchBar"/>
139             </xsl:if>
140             <!-- main eventCalendar content -->
141             <xsl:choose>
142               <xsl:when test="/bedework/periodname='Day'">
143                 <xsl:call-template name="listView"/>
144               </xsl:when>
145               <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
146                 <xsl:choose>
147                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='cal'">
148                     <xsl:call-template name="weekView"/>
149                   </xsl:when>
150                   <xsl:otherwise>
151                     <xsl:call-template name="listView"/>
152                   </xsl:otherwise>
153                 </xsl:choose>
154               </xsl:when>
155               <xsl:when test="/bedework/periodname='Month'">
156                 <xsl:choose>
157                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
158                     <xsl:call-template name="listView"/>
159                   </xsl:when>
160                   <xsl:otherwise>
161                     <xsl:call-template name="monthView"/>
162                   </xsl:otherwise>
163                 </xsl:choose>
164               </xsl:when>
165               <xsl:otherwise>
166                 <xsl:call-template name="yearView"/>
167               </xsl:otherwise>
168             </xsl:choose>
169           </xsl:otherwise>
170         </xsl:choose>
171         <!-- footer -->
172         <xsl:call-template name="footer"/>
173       </body>
174     </html>
175   </xsl:template>
176
177   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
178   <!-- these templates are separated out for convenience and to simplify the default template -->
179
180   <xsl:template name="headBar">
181     <div id="headBar">
182       <div id="bedeworkLogo">
183         <a href="http://www.bedework.org/">
184           <img src="{$resourcesRoot}/images/soecal/soeBedeworkLogo.gif" width="296" height="69" border="0" alt="Bedework" align="right"/>
185         </a>
186       </div>
187       <h1>Example Departmental Calendar Suite</h1>
188       <!--<ul id="schoolLinks">
189         <li><a href="{$privateCal}">Personal Calendar</a></li>
190         <li><a href="http://www.yourschoolhere.edu">School Home</a></li>
191         <li><a href="http://www.bedework.org/">Other Link</a></li>
192         <li>
193           <a href="http://helpdesk.rpi.edu/update.do?catcenterkey=51">
194             Example Calendar Help
195           </a>
196         </li>
197       </ul> -->
198     </div>
199     <!--  Turn off the date range table for this departmental view -->
200     <!--<table id="curDateRangeTable"  cellspacing="0">
201       <td class="sideBarOpenCloseIcon">
202         &#160; -->
203         <!--
204         we may choose to implement calendar selection in the public calendar
205         using a sidebar; leave this comment here for now.
206         <xsl:choose>
207           <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
208             <a href="?setappvar=sidebar(opened)">
209               <img alt="open sidebar" src="{$resourcesRoot}/resources/sideBarArrowOpen.gif" width="21" height="16" border="0" align="left"/>
210             </a>
211           </xsl:when>
212           <xsl:otherwise>
213             <a href="?setappvar=sidebar(closed)">
214               <img alt="close sidebar" src="{$resourcesRoot}/resources/sideBarArrowClose.gif" width="21" height="16" border="0" align="left"/>
215             </a>
216           </xsl:otherwise>
217         </xsl:choose>-->
218       <!-- </td>
219       <td class="date">
220         <xsl:choose>
221           <xsl:when test="/bedework/page='event'">
222             Event Information
223           </xsl:when>
224           <xsl:when test="/bedework/page='showSysStats' or
225                           /bedework/page='calendars'">
226             &#160;
227           </xsl:when>
228           <xsl:otherwise>
229             <xsl:value-of select="/bedework/firstday/longdate"/>
230             <xsl:if test="/bedework/periodname!='Day'">
231               -
232               <xsl:value-of select="/bedework/lastday/longdate"/>
233             </xsl:if>
234           </xsl:otherwise>
235         </xsl:choose>
236       </td>
237       <td class="rssPrint">
238         <a href="javascript:window.print()" title="print this view">
239           <img alt="print this view" src="{$resourcesRoot}/images/std-print-icon.gif" width="20" height="14" border="0"/> print
240         </a>
241         <a class="rss" href="{$setSelection}&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
242       </td>
243     </table>-->
244   </xsl:template>
245
246   <xsl:template name="tabs">
247     <xsl:choose>
248       <xsl:when test="/bedework/page='eventscalendar'">
249         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
250           <tr>
251             <td>
252               <xsl:choose>
253                 <xsl:when test="/bedework/periodname='Day'">
254                   <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>
255                 </xsl:when>
256                 <xsl:otherwise>
257                   <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>
258                 </xsl:otherwise>
259               </xsl:choose>
260             </td>
261             <td>
262               <xsl:choose>
263                 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
264                   <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>
265                  </xsl:when>
266                 <xsl:otherwise>
267                   <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>
268                  </xsl:otherwise>
269               </xsl:choose>
270             </td>
271             <td>
272               <xsl:choose>
273                 <xsl:when test="/bedework/periodname='Month'">
274                   <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>
275                 </xsl:when>
276                 <xsl:otherwise>
277                   <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>
278                 </xsl:otherwise>
279               </xsl:choose>
280             </td>
281             <td>
282               <xsl:choose>
283                 <xsl:when test="/bedework/periodname='Year'">
284                   <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>
285                 </xsl:when>
286                 <xsl:otherwise>
287                   <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>
288                 </xsl:otherwise>
289               </xsl:choose>
290             </td>
291             <td class="rssPrint">
292               <a href="javascript:window.print()" title="print this view">
293                 <img alt="print this view" src="{$resourcesRoot}/images/std-print-icon.gif" width="20" height="14" border="0"/> print
294               </a>
295               <a class="rss" href="{$setSelection}&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
296             </td>
297           </tr>
298         </table>
299       </xsl:when>
300       <xsl:otherwise>
301         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
302           <tr>
303             <td>
304               <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>
305             </td>
306             <td>
307               <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>
308             </td>
309             <td>
310               <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>
311             </td>
312             <td>
313               <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>
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="{$setSelection}&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
320             </td>
321           </tr>
322         </table>
323       </xsl:otherwise>
324     </xsl:choose>
325   </xsl:template>
326
327   <xsl:template name="navigation">
328     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
329       <tr>
330         <td class="leftCell">
331           <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>
332           <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>
333           <xsl:choose>
334             <xsl:when test="/bedework/periodname='Year'">
335               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
336             </xsl:when>
337             <xsl:when test="/bedework/periodname='Month'">
338               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
339             </xsl:when>
340             <xsl:when test="/bedework/periodname='Week'">
341               Week of <xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
342             </xsl:when>
343             <xsl:otherwise>
344               <xsl:value-of select="/bedework/firstday/longdate"/>
345             </xsl:otherwise>
346           </xsl:choose>
347         </td>
348         <td class="todayButton">
349           <a href="{$setViewPeriod}&amp;viewType=todayView&amp;date={$curdate}">
350             <img src="{$resourcesRoot}/images/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
351           </a>
352         </td>
353         <td align="right" class="gotoForm">
354           <form name="calForm" method="post" action="{$setViewPeriod}">
355              <table border="0" cellpadding="0" cellspacing="0">
356               <tr>
357                 <xsl:if test="/bedework/periodname!='Year'">
358                   <td>
359                     <select name="viewStartDate.month">
360                       <xsl:for-each select="/bedework/monthvalues/val">
361                         <xsl:variable name="temp" select="."/>
362                         <xsl:variable name="pos" select="position()"/>
363                         <xsl:choose>
364                           <xsl:when test="/bedework/monthvalues[start=$temp]">
365                             <option value="{$temp}" selected="selected">
366                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
367                             </option>
368                           </xsl:when>
369                           <xsl:otherwise>
370                             <option value="{$temp}">
371                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
372                             </option>
373                           </xsl:otherwise>
374                         </xsl:choose>
375                       </xsl:for-each>
376                     </select>
377                   </td>
378                   <xsl:if test="/bedework/periodname!='Month'">
379                     <td>
380                       <select name="viewStartDate.day">
381                         <xsl:for-each select="/bedework/dayvalues/val">
382                           <xsl:variable name="temp" select="."/>
383                           <xsl:variable name="pos" select="position()"/>
384                           <xsl:choose>
385                             <xsl:when test="/bedework/dayvalues[start=$temp]">
386                               <option value="{$temp}" selected="selected">
387                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
388                               </option>
389                             </xsl:when>
390                             <xsl:otherwise>
391                               <option value="{$temp}">
392                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
393                               </option>
394                             </xsl:otherwise>
395                           </xsl:choose>
396                         </xsl:for-each>
397                       </select>
398                     </td>
399                   </xsl:if>
400                 </xsl:if>
401                 <td>
402                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
403                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
404                 </td>
405                 <td>
406                   <input name="submit" type="submit" value="go"/>
407                 </td>
408               </tr>
409             </table>
410           </form>
411         </td>
412         <td class="rightCell">
413         </td>
414       </tr>
415     </table>
416   </xsl:template>
417
418   <xsl:template name="searchBar">
419     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="searchBarTable">
420        <tr>
421          <td class="leftCell">
422            <xsl:choose>
423              <xsl:when test="/bedework/selectionState/selectionType = 'calendar'">
424                Calendar: <xsl:value-of select="/bedework/selectionState/subscriptions/subscription/calendar/name"/>
425                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
426              </xsl:when>
427              <xsl:when test="/bedework/selectionState/selectionType = 'search'">
428                Current search: <xsl:value-of select="/bedework/search"/>
429                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
430              </xsl:when>
431              <xsl:when test="/bedework/selectionState/selectionType = 'subscription'">
432                Subscription: (not implemented yet)
433                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
434              </xsl:when>
435              <xsl:when test="/bedework/selectionState/selectionType = 'filter'">
436                Filter: (not implemented yet)
437                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
438              </xsl:when>
439              <xsl:otherwise><!-- view -->
440                View:
441                <form name="selectViewForm" method="post" action="{$setSelection}">
442                 <select name="viewName" onChange="submit()" >
443                   <xsl:for-each select="/bedework/views/view">
444                     <xsl:variable name="name" select="name"/>
445                     <xsl:choose>
446                       <xsl:when test="name=/bedework/selectionState/view/name">
447                         <option value="{$name}" selected="selected"><xsl:value-of select="name"/></option>
448                       </xsl:when>
449                       <xsl:otherwise>
450                         <option value="{$name}"><xsl:value-of select="name"/></option>
451                       </xsl:otherwise>
452                     </xsl:choose>
453                   </xsl:for-each>
454                 </select>
455               </form>
456               <span class="calLinks"><a href="{$setSelection}">default view</a> | <a href="{$fetchPublicCalendars}">available calendars</a></span>
457              </xsl:otherwise>
458            </xsl:choose>
459          </td>
460          <td class="rightCell">
461             <xsl:choose>
462               <xsl:when test="/bedework/periodname='Day'">
463                 <img src="{$resourcesRoot}/images/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
464               </xsl:when>
465               <xsl:when test="/bedework/periodname='Year'">
466                 <img src="{$resourcesRoot}/images/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
467               </xsl:when>
468               <xsl:when test="/bedework/periodname='Month'">
469                 <xsl:choose>
470                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
471                     <a href="{$setup}&amp;setappvar=monthViewMode(cal)" title="toggle list/calendar view">
472                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
473                     </a>
474                   </xsl:when>
475                   <xsl:otherwise>
476                     <a href="{$setup}&amp;setappvar=monthViewMode(list)" title="toggle list/calendar view">
477                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
478                     </a>
479                   </xsl:otherwise>
480                 </xsl:choose>
481               </xsl:when>
482               <xsl:otherwise>
483                 <xsl:choose>
484                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='cal'">
485                     <a href="{$setup}&amp;setappvar=weekViewMode(list)" title="toggle list/calendar view">
486                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
487                     </a>
488                   </xsl:when>
489                   <xsl:otherwise>
490                     <a href="{$setup}&amp;setappvar=weekViewMode(cal)" title="toggle list/calendar view">
491                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
492                     </a>
493                   </xsl:otherwise>
494                 </xsl:choose>
495               </xsl:otherwise>
496             </xsl:choose>
497             <xsl:choose>
498               <xsl:when test="/bedework/periodname='Year' or
499                               (/bedework/periodname='Month' and
500                               (/bedework/appvar[key='monthViewMode']/value='cal' or
501                                not(/bedework/appvar[key='monthViewMode']))) or
502                               (/bedework/periodname='Week' and
503                               (/bedework/appvar[key='weekViewMode']/value='cal' or
504                                not(/bedework/appvar[key='weekViewMode'])))">
505                 <xsl:choose>
506                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
507                     <img src="{$resourcesRoot}/images/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
508                   </xsl:when>
509                   <xsl:otherwise>
510                     <img src="{$resourcesRoot}/images/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
511                   </xsl:otherwise>
512                 </xsl:choose>
513               </xsl:when>
514               <xsl:otherwise>
515                 <xsl:choose>
516                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
517                     <a href="{$setup}&amp;setappvar=summaryMode(summary)" title="toggle summary/detailed view">
518                       <img src="{$resourcesRoot}/images/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
519                     </a>
520                   </xsl:when>
521                   <xsl:otherwise>
522                     <a href="{$setup}&amp;setappvar=summaryMode(details)" title="toggle summary/detailed view">
523                       <img src="{$resourcesRoot}/images/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
524                     </a>
525                   </xsl:otherwise>
526                 </xsl:choose>
527               </xsl:otherwise>
528             </xsl:choose>
529             <a href="setup.do"><img src="{$resourcesRoot}/images/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
530           </td>
531        </tr>
532     </table>
533   </xsl:template>
534
535   <!--==== SINGLE EVENT ====-->
536   <xsl:template match="event">
537     <xsl:variable name="statusClass">
538       <xsl:choose>
539         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
540         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
541         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
542       </xsl:choose>
543     </xsl:variable>
544     <h2 class="{$statusClass}">
545       <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
546       <xsl:choose>
547         <xsl:when test="link != ''">
548           <xsl:variable name="link" select="link"/>
549           <a href="{$link}">
550             <xsl:value-of select="summary"/>
551           </a>
552         </xsl:when>
553         <xsl:otherwise>
554           <xsl:value-of select="summary"/>
555         </xsl:otherwise>
556       </xsl:choose>
557     </h2>
558     <table id="eventTable" cellpadding="0" cellspacing="0">
559       <tr>
560         <td class="fieldname">When:</td>
561         <td class="fieldval">
562           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
563           <xsl:if test="start/allday = 'false'">
564             <span class="time"><xsl:value-of select="start/time"/></span>
565           </xsl:if>
566           <xsl:if test="(end/longdate != start/longdate) or
567                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
568           <xsl:if test="end/longdate != start/longdate">
569             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
570           </xsl:if>
571           <xsl:choose>
572             <xsl:when test="start/allday = 'true'">
573               <span class="time"><em>(all day)</em></span>
574             </xsl:when>
575             <xsl:when test="end/longdate != start/longdate">
576               <span class="time"><xsl:value-of select="end/time"/></span>
577             </xsl:when>
578             <xsl:when test="end/time != start/time">
579               <span class="time"><xsl:value-of select="end/time"/></span>
580             </xsl:when>
581           </xsl:choose>
582         </td>
583         <th class="icalIcon" rowspan="2">
584           <div id="eventIcons">
585             <xsl:variable name="id" select="id"/>
586             <xsl:variable name="subscriptionId" select="subscription/id"/>
587             <xsl:variable name="calPath" select="calendar/encodedPath"/>
588             <xsl:variable name="guid" select="guid"/>
589             <xsl:variable name="recurrenceId" select="recurrenceId"/>
590             <a href="{$privateCal}/addEventRef.do?subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
591               <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon.gif" width="20" height="26" border="0" alt="Add event to MyCalendar"/>
592             add to my calendar</a>
593             <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
594             <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">
595               <img src="{$resourcesRoot}/images/std-ical_icon.gif" width="20" height="26" border="0" alt="Download this event"/>
596              download</a>
597           </div>
598         </th>
599       </tr>
600       <tr>
601         <td class="fieldname">Where:</td>
602         <td class="fieldval">
603           <xsl:choose>
604             <xsl:when test="location/link=''">
605               <xsl:value-of select="location/address"/>
606             </xsl:when>
607             <xsl:otherwise>
608               <xsl:variable name="locationLink" select="location/link"/>
609               <a href="{$locationLink}">
610                 <xsl:value-of select="location/address"/>
611               </a>
612             </xsl:otherwise>
613           </xsl:choose>
614           <xsl:if test="location/subaddress!=''">
615             <br/><xsl:value-of select="location/subaddress"/>
616           </xsl:if>
617         </td>
618       </tr>
619       <tr>
620         <td class="fieldname">Description:</td>
621         <td colspan="2" class="fieldval description">
622           <xsl:call-template name="replace">
623             <xsl:with-param name="string" select="description"/>
624             <xsl:with-param name="pattern" select="'&#xA;'"/>
625             <xsl:with-param name="replacement"><br/></xsl:with-param>
626           </xsl:call-template>
627         </td>
628       </tr>
629       <xsl:if test="status !='' and status != 'CONFIRMED'">
630         <tr>
631           <td class="fieldname">Status:</td>
632           <td class="fieldval">
633             <xsl:value-of select="status"/>
634           </td>
635         </tr>
636       </xsl:if>
637       <xsl:if test="cost!=''">
638         <tr>
639           <td class="fieldname">Cost:</td>
640           <td colspan="2" class="fieldval"><xsl:value-of select="cost"/></td>
641         </tr>
642       </xsl:if>
643       <xsl:if test="link != ''">
644         <tr>
645           <td class="fieldname">See:</td>
646           <td colspan="2" class="fieldval">
647             <xsl:variable name="link" select="link"/>
648             <a href="{$link}"><xsl:value-of select="link"/></a>
649           </td>
650         </tr>
651       </xsl:if>
652       <xsl:if test="sponsor/name!='none'">
653         <tr>
654           <td class="fieldname">Contact:</td>
655           <td colspan="2" class="fieldval">
656             <xsl:choose>
657               <xsl:when test="sponsor/link=''">
658                 <xsl:value-of select="sponsor/name"/>
659               </xsl:when>
660               <xsl:otherwise>
661                 <xsl:variable name="sponsorLink" select="sponsor/link"/>
662                 <a href="{$sponsorLink}">
663                   <xsl:value-of select="sponsor/name"/>
664                 </a>
665               </xsl:otherwise>
666             </xsl:choose>
667             <xsl:if test="sponsor/phone!=''">
668               <br /><xsl:value-of select="sponsor/phone"/>
669             </xsl:if>
670             <!-- If you want to display email addresses, uncomment the
671                  following 8 lines. -->
672             <!-- <xsl:if test="sponsor/email!=''">
673               <br />
674               <xsl:variable name="email" select="sponsor/email"/>
675               <xsl:variable name="subject" select="summary"/>
676               <a href="mailto:{$email}&amp;subject={$subject}">
677                 <xsl:value-of select="sponsor/email"/>
678               </a>
679             </xsl:if> -->
680           </td>
681         </tr>
682       </xsl:if>
683       <tr>
684         <td class="fieldname">Calendar:</td>
685         <td class="fieldval">
686           <xsl:variable name="calUrl" select="calendar/path"/>
687           <a href="{$setSelection}&amp;calUrl={$calUrl}">
688             <xsl:value-of select="calendar/name"/>
689           </a>
690         </td>
691       </tr>
692     </table>
693   </xsl:template>
694
695   <!--==== LIST VIEW  (for day, week, and month) ====-->
696   <xsl:template name="listView">
697     <table id="listTable" border="0" cellpadding="0" cellspacing="0">
698       <xsl:choose>
699         <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)">
700           <tr>
701             <td class="noEventsCell">
702               No events to display.
703             </td>
704           </tr>
705         </xsl:when>
706         <xsl:otherwise>
707           <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[event]">
708             <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
709               <tr>
710                 <td colspan="5" class="dateRow">
711                    <xsl:variable name="date" select="date"/>
712                    <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$date}">
713                      <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
714                    </a>
715                 </td>
716               </tr>
717             </xsl:if>
718             <xsl:for-each select="event">
719               <xsl:variable name="id" select="id"/>
720               <xsl:variable name="subscriptionId" select="subscription/id"/>
721               <xsl:variable name="calPath" select="calendar/encodedPath"/>
722               <xsl:variable name="guid" select="guid"/>
723               <xsl:variable name="recurrenceId" select="recurrenceId"/>
724               <tr>
725                 <xsl:variable name="dateRangeStyle">
726                   <xsl:choose>
727                     <xsl:when test="start/shortdate = parent::day/shortdate">
728                       <xsl:choose>
729                         <xsl:when test="start/allday = 'true'">dateRangeCrossDay</xsl:when>
730                         <xsl:when test="start/hour24 &lt; 6">dateRangeEarlyMorning</xsl:when>
731                         <xsl:when test="start/hour24 &lt; 12">dateRangeMorning</xsl:when>
732                         <xsl:when test="start/hour24 &lt; 18">dateRangeAfternoon</xsl:when>
733                         <xsl:otherwise>dateRangeEvening</xsl:otherwise>
734                       </xsl:choose>
735                     </xsl:when>
736                     <xsl:otherwise>dateRangeCrossDay</xsl:otherwise>
737                   </xsl:choose>
738                 </xsl:variable>
739                 <xsl:choose>
740                   <xsl:when test="start/allday = 'true' and
741                                   start/shortdate = end/shortdate">
742                     <td class="{$dateRangeStyle} center" colspan="3">
743                       all day
744                     </td>
745                   </xsl:when>
746                   <xsl:when test="start/shortdate = end/shortdate and
747                                   start/time = end/time">
748                     <td class="{$dateRangeStyle} center" colspan="3">
749                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
750                         <xsl:value-of select="start/time"/>
751                       </a>
752                     </td>
753                   </xsl:when>
754                   <xsl:otherwise>
755                     <td class="{$dateRangeStyle} right">
756                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
757                       <xsl:choose>
758                         <xsl:when test="start/allday = 'true' and
759                                         parent::day/shortdate = start/shortdate">
760                           today
761                         </xsl:when>
762                         <xsl:when test="parent::day/shortdate != start/shortdate">
763                           <span class="littleArrow">&#171;</span>&#160;
764                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
765                         </xsl:when>
766                         <xsl:otherwise>
767                           <xsl:value-of select="start/time"/>
768                         </xsl:otherwise>
769                       </xsl:choose>
770                       </a>
771                     </td>
772                     <td class="{$dateRangeStyle} center">
773                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a>
774                     </td>
775                     <td class="{$dateRangeStyle} left">
776                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
777                       <xsl:choose>
778                         <xsl:when test="end/allday = 'true' and
779                                         parent::day/shortdate = end/shortdate">
780                           today
781                         </xsl:when>
782                         <xsl:when test="parent::day/shortdate != end/shortdate">
783                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
784                           &#160;<span class="littleArrow">&#187;</span>
785                         </xsl:when>
786                         <xsl:otherwise>
787                           <xsl:value-of select="end/time"/>
788                         </xsl:otherwise>
789                       </xsl:choose>
790                       </a>
791                     </td>
792                   </xsl:otherwise>
793                 </xsl:choose>
794                 <xsl:variable name="descriptionClass">
795                   <xsl:choose>
796                     <xsl:when test="status='CANCELLED'">description bwStatusCancelled</xsl:when>
797                     <xsl:when test="status='TENTATIVE'">description bwStatusTentative</xsl:when>
798                     <xsl:otherwise>description</xsl:otherwise>
799                   </xsl:choose>
800                 </xsl:variable>
801                 <td class="{$descriptionClass}">
802                   <xsl:if test="status='CANCELLED'"><strong>CANCELLED: </strong></xsl:if>
803                   <xsl:choose>
804                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
805                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
806                         <strong>
807                           <xsl:value-of select="summary"/>:
808                         </strong>
809                         <xsl:value-of select="description"/>&#160;
810                         <em>
811                           <xsl:value-of select="location/address"/>
812                           <xsl:if test="location/subaddress != ''">
813                             , <xsl:value-of select="location/subaddress"/>
814                           </xsl:if>.&#160;
815                           <xsl:if test="cost!=''">
816                             <xsl:value-of select="cost"/>.&#160;
817                           </xsl:if>
818                           <xsl:if test="sponsor/name!='none'">
819                             Contact: <xsl:value-of select="sponsor/name"/>
820                           </xsl:if>
821                         </em>
822                       </a>
823                       <xsl:if test="link != ''">
824                         <xsl:variable name="link" select="link"/>
825                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
826                       </xsl:if>
827                     </xsl:when>
828                     <xsl:otherwise>
829                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
830                         <xsl:value-of select="summary"/>
831                         <xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if>
832                       </a>
833                     </xsl:otherwise>
834                   </xsl:choose>
835                 </td>
836                 <td class="icons">
837                   <variable name="confId" select="/bedework/confirmationid"/>
838                   <a href="{$privateCal}/addEventRef.do?subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
839                     <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="Add event to MyCalendar"/>
840                   </a>
841                   <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
842                   <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">
843                     <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"/>
844                   </a>
845                 </td>
846               </tr>
847             </xsl:for-each>
848           </xsl:for-each>
849         </xsl:otherwise>
850       </xsl:choose>
851     </table>
852   </xsl:template>
853
854   <!--==== WEEK CALENDAR VIEW ====-->
855   <xsl:template name="weekView">
856     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
857       <tr>
858         <xsl:for-each select="/bedework/daynames/val">
859           <th class="dayHeading"><xsl:value-of select="."/></th>
860         </xsl:for-each>
861       </tr>
862       <tr>
863         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day">
864           <xsl:variable name="dayPos" select="position()"/>
865           <xsl:if test="filler='false'">
866             <td>
867               <xsl:variable name="dayDate" select="date"/>
868               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink">
869                 <xsl:value-of select="value"/>
870               </a>
871               <ul>
872                 <xsl:apply-templates select="event" mode="calendarLayout">
873                   <xsl:with-param name="dayPos" select="$dayPos"/>
874                 </xsl:apply-templates>
875               </ul>
876             </td>
877           </xsl:if>
878         </xsl:for-each>
879       </tr>
880     </table>
881   </xsl:template>
882
883   <!--==== MONTH CALENDAR VIEW ====-->
884   <xsl:template name="monthView">
885     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
886       <tr>
887         <xsl:for-each select="/bedework/daynames/val">
888           <th class="dayHeading"><xsl:value-of select="."/></th>
889         </xsl:for-each>
890       </tr>
891       <xsl:for-each select="/bedework/eventscalendar/year/month/week">
892         <tr>
893           <xsl:for-each select="day">
894             <xsl:variable name="dayPos" select="position()"/>
895             <xsl:choose>
896               <xsl:when test="filler='true'">
897                 <td class="filler">&#160;</td>
898               </xsl:when>
899               <xsl:otherwise>
900                 <td>
901                   <xsl:variable name="dayDate" select="date"/>
902                   <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink">
903                     <xsl:value-of select="value"/>
904                   </a>
905                   <ul>
906                     <xsl:apply-templates select="event" mode="calendarLayout">
907                       <xsl:with-param name="dayPos" select="$dayPos"/>
908                     </xsl:apply-templates>
909                   </ul>
910                 </td>
911               </xsl:otherwise>
912             </xsl:choose>
913           </xsl:for-each>
914         </tr>
915       </xsl:for-each>
916     </table>
917   </xsl:template>
918
919   <xsl:template match="event" mode="calendarLayout">
920     <xsl:param name="dayPos"/>
921     <xsl:variable name="subscriptionId" select="subscription/id"/>
922     <xsl:variable name="calPath" select="calendar/encodedPath"/>
923     <xsl:variable name="guid" select="guid"/>
924     <xsl:variable name="recurrenceId" select="recurrenceId"/>
925     <xsl:variable name="eventClass">
926       <xsl:choose>
927         <!-- Special styles for the month grid -->
928         <xsl:when test="status='CANCELLED'">eventCancelled</xsl:when>
929         <xsl:when test="status='TENTATIVE'">eventTentative</xsl:when>
930         <xsl:when test="calendar/name='Holidays'">holiday</xsl:when>
931         <!-- Alternating colors for all standard events -->
932         <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when>
933         <xsl:otherwise>eventLinkB</xsl:otherwise>
934       </xsl:choose>
935     </xsl:variable>
936     <li>
937       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" class="{$eventClass}">
938         <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
939         <xsl:value-of select="summary"/>
940         <xsl:variable name="eventTipClass">
941           <xsl:choose>
942             <xsl:when test="$dayPos &gt; 5">eventTipReverse</xsl:when>
943             <xsl:otherwise>eventTip</xsl:otherwise>
944           </xsl:choose>
945         </xsl:variable>
946         <span class="{$eventTipClass}">
947           <xsl:if test="status='CANCELLED'"><span class="eventTipStatusCancelled">CANCELLED</span></xsl:if>
948           <xsl:if test="status='TENTATIVE'"><span class="eventTipStatusTentative">TENTATIVE</span></xsl:if>
949           <strong><xsl:value-of select="summary"/></strong><br/>
950           Time:
951           <xsl:choose>
952             <xsl:when test="start/allday = 'false'">
953               <xsl:value-of select="start/time"/>
954               <xsl:if test="start/time != end/time">
955                 - <xsl:value-of select="end/time"/>
956               </xsl:if>
957             </xsl:when>
958             <xsl:otherwise>
959               all day
960             </xsl:otherwise>
961           </xsl:choose><br/>
962           <xsl:if test="location/address">
963             Location: <xsl:value-of select="location/address"/><br/>
964           </xsl:if>
965           Calendar: <xsl:value-of select="calendar/name"/>
966         </span>
967       </a>
968     </li>
969   </xsl:template>
970
971   <!--==== YEAR VIEW ====-->
972   <xsl:template name="yearView">
973     <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0">
974       <tr>
975         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &lt;= 3]"/>
976       </tr>
977       <tr>
978         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 3) and (position() &lt;= 6)]"/>
979       </tr>
980       <tr>
981         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 6) and (position() &lt;= 9)]"/>
982       </tr>
983       <tr>
984         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &gt; 9]"/>
985       </tr>
986     </table>
987   </xsl:template>
988
989   <!-- year view month tables -->
990   <xsl:template match="month">
991     <td>
992       <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0">
993         <tr>
994           <td colspan="8" class="monthName">
995             <xsl:variable name="firstDayOfMonth" select="week/day/date"/>
996             <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$firstDayOfMonth}">
997               <xsl:value-of select="longname"/>
998             </a>
999           </td>
1000         </tr>
1001         <tr>
1002           <th>&#160;</th>
1003           <xsl:for-each select="/bedework/shortdaynames/val">
1004             <th><xsl:value-of select="."/></th>
1005           </xsl:for-each>
1006         </tr>
1007         <xsl:for-each select="week">
1008           <tr>
1009             <td class="weekCell">
1010               <xsl:variable name="firstDayOfWeek" select="day/date"/>
1011               <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$firstDayOfWeek}">
1012                 <xsl:value-of select="value"/>
1013               </a>
1014             </td>
1015             <xsl:for-each select="day">
1016               <xsl:choose>
1017                 <xsl:when test="filler='true'">
1018                   <td class="filler">&#160;</td>
1019                 </xsl:when>
1020                 <xsl:otherwise>
1021                   <td>
1022                     <xsl:variable name="dayDate" select="date"/>
1023                     <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}">
1024                       <xsl:value-of select="value"/>
1025                     </a>
1026                   </td>
1027                 </xsl:otherwise>
1028               </xsl:choose>
1029             </xsl:for-each>
1030           </tr>
1031         </xsl:for-each>
1032       </table>
1033     </td>
1034   </xsl:template>
1035
1036   <!--==== CALENDARS PAGE ====-->
1037   <xsl:template match="calendars">
1038     <xsl:variable name="topLevelCalCount" select="count(calendar/calendar)"/>
1039     <table id="calPageTable" border="0" cellpadding="0" cellspacing="0">
1040       <tr>
1041         <th colspan="2">
1042           All Calendars
1043         </th>
1044       </tr>
1045       <tr>
1046         <td colspan="2" class="infoCell">
1047           Select a calendar from the list below to see only that calendar's events.
1048         </td>
1049       </tr>
1050       <tr>
1051         <td class="leftCell">
1052           <ul class="calendarTree">
1053             <xsl:apply-templates select="calendar/calendar[position() &lt;= ceiling($topLevelCalCount div 2)]" mode="calTree"/>
1054           </ul>
1055         </td>
1056         <td>
1057           <ul class="calendarTree">
1058             <xsl:apply-templates select="calendar/calendar[position() &gt; ceiling($topLevelCalCount div 2)]" mode="calTree"/>
1059           </ul>
1060         </td>
1061       </tr>
1062     </table>
1063   </xsl:template>
1064
1065   <xsl:template match="calendar" mode="calTree">
1066     <xsl:variable name="itemClass">
1067       <xsl:choose>
1068         <xsl:when test="calendarCollection='false'">folder</xsl:when>
1069         <xsl:otherwise>calendar</xsl:otherwise>
1070       </xsl:choose>
1071     </xsl:variable>
1072     <xsl:variable name="url" select="path"/>
1073     <li class="{$itemClass}">
1074       <a href="{$setSelection}&amp;calUrl={$url}"><xsl:value-of select="name"/></a>
1075       <xsl:if test="calendar">
1076         <ul>
1077           <xsl:apply-templates select="calendar" mode="calTree"/>
1078         </ul>
1079       </xsl:if>
1080     </li>
1081   </xsl:template>
1082
1083   <!--+++++++++++++++ System Stats ++++++++++++++++++++-->
1084   <xsl:template name="stats">
1085     <div id="stats">
1086       <h2>System Statistics</h2>
1087
1088       <p>
1089         Stats collection:
1090       </p>
1091       <ul>
1092         <li>
1093           <a href="{$stats}&amp;enable=yes">enable</a> |
1094           <a href="{$stats}&amp;disable=yes">disable</a>
1095         </li>
1096         <li><a href="{$stats}&amp;fetch=yes">fetch statistics</a></li>
1097         <li><a href="{$stats}&amp;dump=yes">dump stats to log</a></li>
1098       </ul>
1099       <table id="statsTable" cellpadding="0">
1100         <xsl:for-each select="/bedework/sysStats/*">
1101           <xsl:choose>
1102             <xsl:when test="name(.) = 'header'">
1103               <tr>
1104                 <th colspan="2">
1105                   <xsl:value-of select="."/>
1106                 </th>
1107               </tr>
1108             </xsl:when>
1109             <xsl:otherwise>
1110               <tr>
1111                 <td class="label">
1112                   <xsl:value-of select="label"/>
1113                 </td>
1114                 <td class="value">
1115                   <xsl:value-of select="value"/>
1116                 </td>
1117               </tr>
1118             </xsl:otherwise>
1119           </xsl:choose>
1120         </xsl:for-each>
1121       </table>
1122     </div>
1123   </xsl:template>
1124
1125   <!--==== UTILITY TEMPLATES ====-->
1126
1127   <!-- search and replace template taken from
1128        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
1129   <xsl:template name="replace">
1130     <xsl:param name="string" select="''"/>
1131     <xsl:param name="pattern" select="''"/>
1132     <xsl:param name="replacement" select="''"/>
1133     <xsl:choose>
1134       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
1135         <xsl:value-of select="substring-before($string, $pattern)"/>
1136         <xsl:copy-of select="$replacement"/>
1137         <xsl:call-template name="replace">
1138           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
1139           <xsl:with-param name="pattern" select="$pattern"/>
1140           <xsl:with-param name="replacement" select="$replacement"/>
1141         </xsl:call-template>
1142       </xsl:when>
1143       <xsl:otherwise>
1144         <xsl:value-of select="$string"/>
1145       </xsl:otherwise>
1146     </xsl:choose>
1147   </xsl:template>
1148
1149   <!--==== FOOTER ====-->
1150
1151   <xsl:template name="footer">
1152     <div id="footer">
1153       Demonstration calendar; place footer information here.
1154     </div>
1155     <div id="subFoot">
1156       Based on the <a href="http://www.bedework.org/">Bedework Calendar</a> |
1157       <a href="?noxslt=yes">show XML</a> |
1158       <a href="?refreshXslt=yes">refresh XSLT</a>
1159     </div>
1160   </xsl:template>
1161 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.