root/trunk/calendar3/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

Revision 319 (checked in by johnsa, 7 years ago)

Beginning the process of implementing real subscriptions (and calendars) in the personal client. Much of the code base is directly from the admin client (and may want to be common code at some point in the future).

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   <!--  Rensselaer PERSONAL CALENDAR STYLESHEET  -->
13   <!-- ========================================= -->
14
15   <!-- DEFINE INCLUDES -->
16   <xsl:include href="errors.xsl"/>
17   <xsl:include href="messages.xsl"/>
18
19   <!-- DEFINE GLOBAL CONSTANTS -->
20   <!-- URL of html resources (images, css, other html); by default this is
21        set to the application root, but for the personal calendar
22        this should be changed to point to a
23        web server over https to avoid mixed content errors, e.g.,
24   <xsl:variable name="resourcesRoot" select="'https://mywebserver.edu/myresourcesdir'"/>
25     -->
26   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
27
28   <!-- URL of the XSL template directory -->
29   <!-- The approot is an appropriate place to put
30        included stylesheets and xml fragments. These are generally
31        referenced relatively (like errors.xsl and messages.xsl above);
32        this variable is here for your convenience if you choose to
33        reference it explicitly.  It is not used in this stylesheet, however,
34        and can be safely removed if you so choose. -->
35   <xsl:variable name="appRoot" select="/bedework/approot"/>
36
37   <!-- Properly encoded prefixes to the application actions; use these to build
38        urls; allows the application to be used without cookies or within a portal. -->
39   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
40   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/setSelection"/>
41   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/fetchPublicCalendars"/>
42   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/setViewPeriod"/>
43   <xsl:variable name="eventView" select="/bedework/urlPrefixes/eventView"/>
44   <xsl:variable name="initEvent" select="/bedework/urlPrefixes/initEvent"/>
45   <xsl:variable name="addEvent" select="/bedework/urlPrefixes/addEvent"/>
46   <xsl:variable name="addEventUsingPage" select="/bedework/urlPrefixes/addEventUsingPage"/>
47   <xsl:variable name="editEvent" select="/bedework/urlPrefixes/editEvent"/>
48   <xsl:variable name="delEvent" select="/bedework/urlPrefixes/delEvent"/>
49   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/addEventRef"/>
50   <xsl:variable name="export" select="/bedework/urlPrefixes/export"/>
51   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mailEvent"/>
52   <xsl:variable name="showPage" select="/bedework/urlPrefixes/showPage"/>
53   <xsl:variable name="manageLocations" select="/bedework/urlPrefixes/manageLocations"/>
54   <xsl:variable name="addLocation" select="/bedework/urlPrefixes/addLocation"/>
55   <xsl:variable name="editLocation" select="/bedework/urlPrefixes/editLocation"/>
56   <xsl:variable name="delLocation" select="/bedework/urlPrefixes/delLocation"/>
57   <xsl:variable name="initEventAlarm" select="/bedework/urlPrefixes/initEventAlarm"/>
58   <xsl:variable name="setAlarm" select="/bedework/urlPrefixes/setAlarm"/>
59   <xsl:variable name="initUpload" select="/bedework/urlPrefixes/initUpload"/>
60   <xsl:variable name="upload" select="/bedework/urlPrefixes/upload"/>
61
62   <xsl:variable name="subscriptions-fetch" select="/bedework/urlPrefixes/subscriptions/fetch/a/@href"/>
63   <xsl:variable name="subscriptions-fetchForUpdate" select="/bedework/urlPrefixes/subscriptions/fetchForUpdate/a/@href"/>
64   <xsl:variable name="subscriptions-initAdd" select="/bedework/urlPrefixes/subscriptions/initAdd/a/@href"/>
65   <xsl:variable name="subscriptions-subscribe" select="/bedework/urlPrefixes/subscriptions/subscribe/a/@href"/>
66
67   <!-- URL of the web application - includes web context
68   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/> -->
69
70   <!-- Other generally useful global variables -->
71   <xsl:variable name="confId" select="/bedework/confirmationid"/>
72   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
73   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
74   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
75   <xsl:variable name="skin">default</xsl:variable>
76   <xsl:variable name="publicCal">/cal</xsl:variable>
77
78  <!-- BEGIN MAIN TEMPLATE -->
79   <xsl:template match="/">
80     <html lang="en">
81       <head>
82         <xsl:call-template name="headSection"/>
83       </head>
84       <body>
85         <xsl:call-template name="headBar"/>
86         <xsl:if test="/bedework/message">
87           <div id="messages">
88             <p><xsl:apply-templates select="/bedework/message"/></p>
89           </div>
90         </xsl:if>
91         <xsl:if test="/bedework/error">
92           <div id="errors">
93             <p><xsl:apply-templates select="/bedework/error"/></p>
94           </div>
95         </xsl:if>
96         <table id="bodyBlock" cellspacing="0">
97           <tr>
98             <xsl:choose>
99               <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
100                 <td id="sideBarClosed">
101                   <img src="{$resourcesRoot}/resources/spacer.gif" width="1" height="1" border="0" alt="*"/>
102                 </td>
103               </xsl:when>
104               <xsl:otherwise>
105                 <td id="sideBar">
106                   <xsl:call-template name="sideBar"/>
107                 </td>
108               </xsl:otherwise>
109             </xsl:choose>
110             <td id="bodyContent">
111               <xsl:call-template name="tabs"/>
112               <xsl:choose>
113                 <xsl:when test="/bedework/page='event'">
114                   <!-- show an event -->
115                   <xsl:apply-templates select="/bedework/event"/>
116                 </xsl:when>
117                 <xsl:when test="/bedework/page='addEvent'">
118                   <xsl:call-template name="addEvent"/>
119                 </xsl:when>
120                 <xsl:when test="/bedework/page='editEvent'">
121                   <!-- edit an event -->
122                   <xsl:apply-templates select="/bedework/formElements"/>
123                 </xsl:when>
124                 <xsl:when test="/bedework/page='alarmOptions'">
125                   <xsl:call-template name="alarmOptions" />
126                 </xsl:when>
127                 <xsl:when test="/bedework/page='upload'">
128                   <xsl:call-template name="upload" />
129                 </xsl:when>
130                 <xsl:when test="/bedework/page='manageLocations'">
131                   <xsl:call-template name="manageLocations" />
132                 </xsl:when>
133                 <xsl:when test="/bedework/page='editLocation'">
134                   <!-- edit an event -->
135                   <xsl:apply-templates select="/bedework/locationform"/>
136                 </xsl:when>
137                 <xsl:when test="/bedework/page='subscriptions' or /bedework/page='modSubscription'">
138                   <xsl:apply-templates select="/bedework/subscriptions"/>
139                 </xsl:when>
140                 <xsl:when test="/bedework/page='calendars'">
141                   <xsl:apply-templates select="/bedework/calendars"/>
142                 </xsl:when>
143                 <xsl:when test="/bedework/page='other'">
144                   <!-- show an arbitrary page -->
145                   <xsl:call-template name="selectPage"/>
146                 </xsl:when>
147                 <xsl:otherwise>
148                   <!-- otherwise, show the eventsCalendar -->
149                   <xsl:call-template name="navigation"/>
150                   <xsl:call-template name="userBar"/>
151                   <!-- main eventCalendar content -->
152                   <xsl:choose>
153                     <xsl:when test="/bedework/periodname='Day'">
154                       <xsl:call-template name="listView"/>
155                     </xsl:when>
156                     <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
157                       <xsl:choose>
158                         <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
159                           <xsl:call-template name="listView"/>
160                         </xsl:when>
161                         <xsl:otherwise>
162                           <xsl:call-template name="weekView"/>
163                         </xsl:otherwise>
164                       </xsl:choose>
165                     </xsl:when>
166                     <xsl:when test="/bedework/periodname='Month'">
167                       <xsl:choose>
168                         <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
169                           <xsl:call-template name="listView"/>
170                         </xsl:when>
171                         <xsl:otherwise>
172                           <xsl:call-template name="monthView"/>
173                         </xsl:otherwise>
174                       </xsl:choose>
175                     </xsl:when>
176                     <xsl:otherwise>
177                       <xsl:call-template name="yearView"/>
178                     </xsl:otherwise>
179                   </xsl:choose>
180                 </xsl:otherwise>
181               </xsl:choose>
182             </td>
183           </tr>
184         </table>
185         <!-- footer -->
186         <xsl:call-template name="footer"/>
187       </body>
188     </html>
189   </xsl:template>
190
191   <!--==== HEAD SECTION  ====-->
192
193   <xsl:template name="headSection">
194      <title>Bedework: Personal Calendar Client</title>
195       <meta name="robots" content="noindex,nofollow"/>
196       <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css"/>
197       <link rel="stylesheet" type="text/css" media="print" href="{$resourcesRoot}/default/default/print.css" />
198       <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
199       <xsl:if test="/bedework/page='addEvent' or /bedework/page='editEvent'">
200         <script type="text/javascript" src="{$resourcesRoot}/resources/includes.js"></script>
201         <script type="text/javascript" src="{$resourcesRoot}/resources/bwClock.js"></script>
202         <link rel="stylesheet" href="{$resourcesRoot}/resources/bwClock.css"/>
203         <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js"></script>
204         <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/>
205         <script type="text/javascript" src="{$resourcesRoot}/resources/browserSniffer.js"></script>
206       </xsl:if>
207   </xsl:template>
208
209   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
210
211   <xsl:template name="headBar">
212     <h1 id="titleBar">
213       BEDEWORK PERSONAL CLIENT
214     </h1>
215     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="logoTable">
216       <tr>
217         <td colspan="3" id="logoCell"><a href="http://www.bedework.org/"><img src="{$resourcesRoot}/resources/bedeworkLogo.gif" width="292" height="75" border="0" alt="Bedework"/></a></td>
218         <td colspan="2" id="schoolLinksCell">
219           <h2>Personal Calendar</h2>
220           <a href="{$publicCal}">Public Calendar</a> |
221           <a href="http://www.yourschoolhere.edu">School Home</a> |
222           <a href="http://www.washington.edu/ucal/">Other Link</a> |
223           <a href="http://helpdesk.rpi.edu/update.do?catcenterkey=51">
224             Example Calendar Help
225           </a>
226         </td>
227       </tr>
228     </table>
229     <table width="100%" border="0" cellpadding="0" cellspacing="0">
230       <tr>
231         <td width="50%"><img alt="" src="{$resourcesRoot}/resources/metacal-topBorder.gif" width="100%" height="23" border="0"/></td>
232         <td><img src="{$resourcesRoot}/resources/metacal-topTitlePersonal.gif" width="221" height="23" border="0" alt="Bedework Personal Events Calendar"/></td>
233         <td width="50%"><img alt="" src="{$resourcesRoot}/resources/metacal-topBorder.gif" width="100%" height="23" border="0"/></td>
234       </tr>
235     </table>
236     <div id="curDateRange">
237       <div id="sideBarOpenCloseIcon">
238         <xsl:choose>
239           <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
240             <a href="?setappvar=sidebar(opened)">
241               <img alt="open sidebar" src="{$resourcesRoot}/resources/std-sidebaropen-icon.gif" width="13" height="13" border="0" align="left"/>
242             </a>
243           </xsl:when>
244           <xsl:otherwise>
245             <a href="?setappvar=sidebar(closed)">
246               <img alt="close sidebar" src="{$resourcesRoot}/resources/std-sidebarclose-icon.gif" width="13" height="13" border="0" align="left"/>
247             </a>
248           </xsl:otherwise>
249         </xsl:choose>
250       </div>
251       <xsl:value-of select="/bedework/firstday/longdate"/>
252       <xsl:if test="/bedework/periodname!='Day'">
253         -
254         <xsl:value-of select="/bedework/lastday/longdate"/>
255       </xsl:if>
256     </div>
257   </xsl:template>
258
259   <xsl:template name="sideBar">
260     <table id="sideBarTabs" cellspacing="0">
261       <tr>
262         <td class="selected first">Menu</td>
263         <td>Calendars</td>
264       </tr>
265     </table>
266     <ul id="sideBarMenu">
267       <li><a href="{$initEvent}">Add Event</a></li>
268       <li><a href="{$initUpload}">Upload Events (iCal)</a></li>
269       <li><a href="{$manageLocations}">Manage Locations</a></li>
270       <li><a href="{$subscriptions-fetch}">Manage Subscriptions</a></li>
271       <li>Preferences</li>
272     </ul>
273   </xsl:template>
274
275   <xsl:template name="tabs">
276     <xsl:choose>
277       <xsl:when test="/bedework/page='eventscalendar'">
278         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
279           <tr>
280             <td>
281               <xsl:choose>
282                 <xsl:when test="/bedework/periodname='Day'">
283                   <a href="{$setViewPeriod}?viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-on.gif" width="91" height="20" border="0" alt="DAY"/></a>
284                 </xsl:when>
285                 <xsl:otherwise>
286                   <a href="{$setViewPeriod}?viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
287                 </xsl:otherwise>
288               </xsl:choose>
289             </td>
290             <td>
291               <xsl:choose>
292                 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
293                   <a href="{$setViewPeriod}?viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-on.gif" width="92" height="20" border="0" alt="WEEK"/></a>
294                  </xsl:when>
295                 <xsl:otherwise>
296                   <a href="{$setViewPeriod}?viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
297                  </xsl:otherwise>
298               </xsl:choose>
299             </td>
300             <td>
301               <xsl:choose>
302                 <xsl:when test="/bedework/periodname='Month'">
303                   <a href="{$setViewPeriod}?viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-on.gif" width="90" height="20" border="0" alt="MONTH"/></a>
304                 </xsl:when>
305                 <xsl:otherwise>
306                   <a href="{$setViewPeriod}?viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
307                 </xsl:otherwise>
308               </xsl:choose>
309             </td>
310             <td>
311               <xsl:choose>
312                 <xsl:when test="/bedework/periodname='Year'">
313                   <a href="{$setViewPeriod}?viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-on.gif" width="92" height="20" border="0" alt="YEAR"/></a>
314                 </xsl:when>
315                 <xsl:otherwise>
316                   <a href="{$setViewPeriod}?viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
317                 </xsl:otherwise>
318               </xsl:choose>
319             </td>
320             <td class="centerCell">
321               &#160;
322             </td>
323             <td class="rssPrint">
324               <a href="javascript:window.print()" title="print this view">
325                 <img alt="print this view" src="{$resourcesRoot}/resources/std-print-icon.gif" width="20" height="14" border="0"/> print
326               </a>
327               <a class="rss" href="{$setSelection}?calId=&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
328             </td>
329
330             <td class="rightCell">
331               &#160;
332             </td>
333           </tr>
334         </table>
335       </xsl:when>
336       <xsl:otherwise>
337         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
338           <tr>
339             <td>
340               <a href="{$setViewPeriod}?viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
341             </td>
342             <td>
343               <a href="{$setViewPeriod}?viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
344             </td>
345             <td>
346               <a href="{$setViewPeriod}?viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
347             </td>
348             <td>
349               <a href="{$setViewPeriod}?viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
350             </td>
351             <td class="centerCell">
352                 &#160;<!--<a href="http://www.rpi.edu/dept/cct/apps/pubeventsxml/calendarfeatures.html">login</a>-->
353             </td>
354             <td class="rightCell">
355               &#160;
356             </td>
357           </tr>
358         </table>
359       </xsl:otherwise>
360     </xsl:choose>
361   </xsl:template>
362
363   <xsl:template name="navigation">
364     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
365       <tr>
366         <td class="leftCell">
367           <a href="{$setViewPeriod}?date={$prevdate}"><img src="{$resourcesRoot}/resources/std-arrow-left.gif" alt="previous" width="13" height="16" class="prevImg" border="0"/></a>
368           <a href="{$setViewPeriod}?date={$nextdate}"><img src="{$resourcesRoot}/resources/std-arrow-right.gif" alt="next" width="13" height="16" class="nextImg" border="0"/></a>
369           <xsl:choose>
370             <xsl:when test="/bedework/periodname='Day'">
371               <xsl:value-of select="substring(/bedework/eventscalendar/year/month/week/day/name,1,3)"/>, <xsl:value-of select="/bedework/eventscalendar/year/month/shortname"/>&#160;<xsl:value-of select="/bedework/eventscalendar/year/month/week/day/value"/>, <xsl:value-of select="/bedework/eventscalendar/year/value"/>
372             </xsl:when>
373             <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
374               Week of <xsl:value-of select="/bedework/eventscalendar/year/month/shortname"/>&#160;<xsl:value-of select="/bedework/eventscalendar/year/month/week/day/value"/>, <xsl:value-of select="/bedework/eventscalendar/year/value"/>
375             </xsl:when>
376             <xsl:when test="/bedework/periodname='Month'">
377               <xsl:value-of select="/bedework/eventscalendar/year/month/longname"/>, <xsl:value-of select="/bedework/eventscalendar/year/value"/>
378             </xsl:when>
379             <xsl:otherwise>
380               <xsl:value-of select="/bedework/eventscalendar/year/value"/>
381             </xsl:otherwise>
382           </xsl:choose>
383         </td>
384         <td align="right" class="gotoForm">
385           <form name="calForm" method="get" action="{$setViewPeriod}">
386              <table border="0" cellpadding="0" cellspacing="0">
387               <tr>
388                 <xsl:if test="/bedework/periodname!='Year'">
389                   <td>
390                     <select name="viewStartDate.month">
391                       <xsl:for-each select="/bedework/monthvalues/val">
392                         <xsl:variable name="temp" select="."/>
393                         <xsl:variable name="pos" select="position()"/>
394                         <xsl:choose>
395                           <xsl:when test="/bedework/monthvalues[start=$temp]">
396                             <option value="{$temp}" selected="selected">
397                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
398                             </option>
399                           </xsl:when>
400                           <xsl:otherwise>
401                             <option value="{$temp}">
402                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
403                             </option>
404                           </xsl:otherwise>
405                         </xsl:choose>
406                       </xsl:for-each>
407                     </select>
408                   </td>
409                   <xsl:if test="/bedework/periodname!='Month'">
410                     <td>
411                       <select name="viewStartDate.day">
412                         <xsl:for-each select="/bedework/dayvalues/val">
413                           <xsl:variable name="temp" select="."/>
414                           <xsl:variable name="pos" select="position()"/>
415                           <xsl:choose>
416                             <xsl:when test="/bedework/dayvalues[start=$temp]">
417                               <option value="{$temp}" selected="selected">
418                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
419                               </option>
420                             </xsl:when>
421                             <xsl:otherwise>
422                               <option value="{$temp}">
423                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
424                               </option>
425                             </xsl:otherwise>
426                           </xsl:choose>
427                         </xsl:for-each>
428                       </select>
429                     </td>
430                   </xsl:if>
431                 </xsl:if>
432                 <td>
433                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
434                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
435                 </td>
436                 <td>
437                   <input name="submit" type="submit" value="go"/>
438                 </td>
439               </tr>
440             </table>
441           </form>
442         </td>
443         <td class="todayButton">
444           <a href="{$setViewPeriod}?viewType=todayView&amp;date={$curdate}">
445             <img src="{$resourcesRoot}/resources/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
446           </a>
447         </td>
448         <!--
449         <td class="rightCell">
450           <form method="post" action="{$setSelection}">
451             <select name="calId" onChange="submit()" >
452               <option>select a calendar</option>
453               <xsl:for-each select="/bedework/calendars/calendar">
454                 <xsl:variable name="id" select="id"/>
455                 <xsl:choose>
456                   <xsl:when test="title=/bedework/title">
457                     <option value="{$id}" selected="selected"><xsl:value-of select="title"/></option>
458                   </xsl:when>
459                   <xsl:otherwise>
460                     <option value="{$id}"><xsl:value-of select="title"/></option>
461                   </xsl:otherwise>
462                 </xsl:choose>
463               </xsl:for-each>
464             </select>
465           </form>
466           <span class="calLinks"><a href="{$setSelection}?calId=">show all</a> | <a href="{$fetchPublicCalendars}">calendar list</a></span>
467         </td> -->
468       </tr>
469     </table>
470   </xsl:template>
471
472   <xsl:template name="userBar">
473     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="userBarTable">
474        <tr>
475          <td class="leftCell">
476            Logged in as:
477            <xsl:text> </xsl:text>
478            <strong><xsl:value-of select="/bedework/userid"/></strong>
479            <xsl:text> </xsl:text>
480            <span class="logout"><a href="{$setup}?logout=true">logout</a></span>
481            <!--<xsl:choose>
482              <xsl:when test="/bedework/title!=''">
483                Calendar: <xsl:value-of select="/bedework/title"/>
484                <span class="link">[<a href="{$setSelection}?calId=">clear</a>]</span>
485              </xsl:when>
486              <xsl:when test="/bedework/search!=''">
487                Current search: <xsl:value-of select="/bedework/search"/>
488                <span class="link">[<a href="{$setSelection}?calId=">clear</a>]</span>
489              </xsl:when>
490              <xsl:otherwise>
491                Current calendar: All
492              </xsl:otherwise>
493            </xsl:choose> -->
494          </td>
495          <td class="rightCell">
496            <xsl:choose>
497             <xsl:when test="/bedework/periodname='Day'">
498               <img src="{$resourcesRoot}/resources/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
499             </xsl:when>
500             <xsl:when test="/bedework/periodname='Year'">
501               <img src="{$resourcesRoot}/resources/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
502             </xsl:when>
503             <xsl:when test="/bedework/periodname='Month'">
504               <xsl:choose>
505                 <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
506                   <a href="{$setup}?setappvar=monthViewMode(cal)" title="toggle list/calendar view">
507                     <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
508                   </a>
509                 </xsl:when>
510                 <xsl:otherwise>
511                   <a href="{$setup}?setappvar=monthViewMode(list)" title="toggle list/calendar view">
512                     <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
513                   </a>
514                 </xsl:otherwise>
515               </xsl:choose>
516             </xsl:when>
517             <xsl:otherwise>
518               <xsl:choose>
519                 <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
520                   <a href="{$setup}?setappvar=weekViewMode(cal)" title="toggle list/calendar view">
521                     <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
522                   </a>
523                 </xsl:when>
524                 <xsl:otherwise>
525                   <a href="{$setup}?setappvar=weekViewMode(list)" title="toggle list/calendar view">
526                     <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
527                   </a>
528                 </xsl:otherwise>
529               </xsl:choose>
530             </xsl:otherwise>
531           </xsl:choose>
532            <xsl:choose>
533               <xsl:when test="/bedework/periodname='Year' or
534                               (/bedework/periodname='Month' and
535                               (/bedework/appvar[key='monthViewMode']/value='cal' or
536                                count(/bedework/appvar[key='monthViewMode'])=0)) or
537                               (/bedework/periodname='Week' and
538                               (/bedework/appvar[key='weekViewMode']/value='cal' or
539                                count(/bedework/appvar[key='weekViewMode'])=0))">
540                 <xsl:choose>
541                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
542                     <img src="{$resourcesRoot}/resources/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
543                   </xsl:when>
544                   <xsl:otherwise>
545                     <img src="{$resourcesRoot}/resources/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
546                   </xsl:otherwise>
547                 </xsl:choose>
548               </xsl:when>
549               <xsl:otherwise>
550                 <xsl:choose>
551                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
552                     <a href="{$setup}?setappvar=summaryMode(summary)" title="toggle summary/detailed view">
553                       <img src="{$resourcesRoot}/resources/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
554                     </a>
555                   </xsl:when>
556                   <xsl:otherwise>
557                     <a href="{$setup}?setappvar=summaryMode(details)" title="toggle summary/detailed view">
558                       <img src="{$resourcesRoot}/resources/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
559                     </a>
560                   </xsl:otherwise>
561                 </xsl:choose>
562               </xsl:otherwise>
563             </xsl:choose>
564             <a href="setup.do"><img src="{$resourcesRoot}/resources/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
565          </td>
566        </tr>
567     </table>
568   </xsl:template>
569
570   <!--==== LIST VIEW  (for day, week, and month) ====-->
571   <xsl:template name="listView">
572     <table id="listTable" border="0" cellpadding="0" cellspacing="0">
573       <xsl:choose>
574         <xsl:when test="count(/bedework/eventscalendar/year/month/week/day/event)=0">
575           <tr>
576             <td class="noEventsCell">
577               There are no events posted
578               <xsl:choose>
579                 <xsl:when test="/bedework/periodname='Day'">
580                   today<xsl:if test="/bedework/title!=''"> for <strong><xsl:value-of select="/bedework/title"/></strong></xsl:if><xsl:if test="/bedework/search!=''"> for search term <strong>"<xsl:value-of select="/bedework/search"/>"</strong></xsl:if>.
581                 </xsl:when>
582                 <xsl:when test="/bedework/periodname='Month'">
583                   this month<xsl:if test="/bedework/title!=''"> for <strong><xsl:value-of select="/bedework/title"/></strong></xsl:if><xsl:if test="/bedework/search!=''"> for search term <strong>"<xsl:value-of select="/bedework/search"/>"</strong></xsl:if>.
584                 </xsl:when>
585                 <xsl:otherwise>
586                   this week<xsl:if test="/bedework/title!=''"> for <strong><xsl:value-of select="/bedework/title"/></strong></xsl:if><xsl:if test="/bedework/search!=''"> for search term <strong>"<xsl:value-of select="/bedework/search"/>"</strong></xsl:if>.
587                 </xsl:otherwise>
588               </xsl:choose>
589             </td>
590           </tr>
591         </xsl:when>
592         <xsl:otherwise>
593           <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[count(event)!=0]">
594             <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
595               <tr>
596                 <td colspan="6" class="dateRow">
597                    <xsl:variable name="date" select="date"/>
598                    <a href="{$setViewPeriod}?viewType=dayView&amp;date={$date}">
599                      <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
600                    </a>
601                 </td>
602               </tr>
603             </xsl:if>
604             <xsl:for-each select="event">
605               <xsl:variable name="id" select="id"/>
606               <xsl:variable name="subscriptionId" select="subscription/id"/>
607               <xsl:variable name="calendarId" select="calendar/id"/>
608               <xsl:variable name="guid" select="guid"/>
609               <xsl:variable name="recurrenceId" select="recurrenceId"/>
610               <tr>
611                 <xsl:variable name="dateRangeStyle">
612                   <xsl:choose>
613                     <xsl:when test="start/shortdate = parent::day/shortdate">
614                       <xsl:choose>
615                         <xsl:when test="start/allday = 'true'">dateRangeCrossDay</xsl:when>
616                         <xsl:when test="start/hour24 &lt; 6">dateRangeEarlyMorning</xsl:when>
617                         <xsl:when test="start/hour24 &lt; 12">dateRangeMorning</xsl:when>
618                         <xsl:when test="start/hour24 &lt; 18">dateRangeAfternoon</xsl:when>
619                         <xsl:otherwise>dateRangeEvening</xsl:otherwise>
620                       </xsl:choose>
621                     </xsl:when>
622                     <xsl:otherwise>dateRangeCrossDay</xsl:otherwise>
623                   </xsl:choose>
624                 </xsl:variable>
625                 <xsl:choose>
626                   <xsl:when test="start/allday = 'true' and
627                                   start/shortdate = end/shortdate">
628                     <td class="{$dateRangeStyle} center" colspan="3">
629                       all day
630                     </td>
631                   </xsl:when>
632                   <xsl:otherwise>
633                     <td class="{$dateRangeStyle} right">
634                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
635                       <xsl:choose>
636                         <xsl:when test="start/allday = 'true' and
637                                         parent::day/shortdate = start/shortdate">
638                           today
639                         </xsl:when>
640                         <xsl:when test="parent::day/shortdate != start/shortdate">
641                           <span class="littleArrow">&#171;</span>&#160;
642                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
643                         </xsl:when>
644                         <xsl:otherwise>
645                           <xsl:value-of select="start/time"/>
646                         </xsl:otherwise>
647                       </xsl:choose>
648                       </a>
649                     </td>
650                     <td class="{$dateRangeStyle} center">
651                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a>
652                     </td>
653                     <td class="{$dateRangeStyle} left">
654                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
655                       <xsl:choose>
656                         <xsl:when test="end/allday = 'true' and
657                                         parent::day/shortdate = end/shortdate">
658                           today
659                         </xsl:when>
660                         <xsl:when test="parent::day/shortdate != end/shortdate">
661                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
662                           &#160;<span class="littleArrow">&#187;</span>
663                         </xsl:when>
664                         <xsl:otherwise>
665                           <xsl:value-of select="end/time"/>
666                         </xsl:otherwise>
667                       </xsl:choose>
668                       </a>
669                     </td>
670                   </xsl:otherwise>
671                 </xsl:choose>
672                 <xsl:variable name="descriptionClass">
673                   <xsl:choose>
674                     <xsl:when test="priority='cancelled'">description cancelled</xsl:when>
675                     <xsl:otherwise>description</xsl:otherwise>
676                   </xsl:choose>
677                 </xsl:variable>
678                 <td class="{$descriptionClass}">
679                   <xsl:choose>
680                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
681                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
682                         <strong><xsl:value-of select="summary"/>: </strong>
683                         <xsl:value-of select="description"/>&#160;
684                         <em>
685                           <xsl:value-of select="location/address"/>
686                           <xsl:if test="location/subaddress != ''">
687                             , <xsl:value-of select="location/subaddress"/>
688                           </xsl:if>.&#160;
689                           <xsl:if test="cost!=''">
690                             <xsl:value-of select="cost"/>.&#160;
691                           </xsl:if>
692                           <xsl:if test="sponsor/name!='none'">
693                             Contact: <xsl:value-of select="sponsor/name"/>
694                           </xsl:if>
695                         </em>
696                       </a>
697                       <xsl:if test="link != ''">
698                         <xsl:variable name="link" select="link"/>
699                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
700                       </xsl:if>
701                     </xsl:when>
702                     <xsl:otherwise>
703                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
704                         <xsl:value-of select="summary"/>, <xsl:value-of select="location/address"/>
705                       </a>
706                     </xsl:otherwise>
707                   </xsl:choose>
708                 </td>
709                 <td class="eventLinks">
710                   <xsl:call-template name="eventLinks"/>
711                 </td>
712                 <td class="smallIcon">
713                   <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
714                   <a href="{$export}?subid={$subscriptionId}&amp;calid={$calendarId}&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">
715                     <img src="{$resourcesRoot}/resources/std-ical_icon_small.gif" width="12" height="16" border="0" alt="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars"/>
716                   </a>
717                 </td>
718               </tr>
719             </xsl:for-each>
720           </xsl:for-each>
721         </xsl:otherwise>
722       </xsl:choose>
723     </table>
724   </xsl:template>
725
726   <xsl:template name="eventLinks">
727     <xsl:variable name="subscriptionId" select="subscription/id"/>
728           <xsl:variable name="calendarId" select="calendar/id"/>
729     <xsl:variable name="guid" select="guid"/>
730     <xsl:variable name="recurrenceId" select="recurrenceId"/>
731     <xsl:choose>
732       <xsl:when test="kind='0'">
733         <a href="{$editEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">Edit</a> |
734         <xsl:choose>
735           <xsl:when test="recurring=true">
736             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete All</a>
737           </xsl:when>
738           <xsl:otherwise>
739             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete</a>
740           </xsl:otherwise>
741         </xsl:choose>
742       </xsl:when>
743       <xsl:when test="kind='1'">
744         <xsl:choose>
745           <xsl:when test="recurring=true">
746             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;confirmationid={$confId}">Remove All</a>
747           </xsl:when>
748           <xsl:otherwise>
749             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Remove</a>
750           </xsl:otherwise>
751         </xsl:choose>
752       </xsl:when>
753       <xsl:otherwise>
754         <a href="{$fetchPublicCalendars}">Subscription</a>
755       </xsl:otherwise>
756     </xsl:choose>
757   </xsl:template>
758
759   <!--==== WEEK CALENDAR VIEW ====-->
760   <xsl:template name="weekView">
761     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
762       <tr>
763         <xsl:for-each select="/bedework/daynames/val">
764           <th class="dayHeading"><xsl:value-of select="."/></th>
765         </xsl:for-each>
766       </tr>
767       <tr>
768         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day">
769           <xsl:variable name="dayPos" select="position()"/>
770           <xsl:if test="filler='false'">
771             <td>
772               <xsl:variable name="dayDate" select="date"/>
773               <a href="{$initEvent}?date={$dayDate}" class="gridAdd">[add]</a>
774               <a href="{$setViewPeriod}?viewType=dayView&amp;date={$dayDate}" class="dayLink">
775                 <xsl:value-of select="value"/>
776               </a>
777               <ul>
778                 <xsl:apply-templates select="event" mode="calendarLayout">
779                   <xsl:with-param name="dayPos" select="$dayPos"/>
780                 </xsl:apply-templates>
781               </ul>
782             </td>
783           </xsl:if>
784         </xsl:for-each>
785       </tr>
786     </table>
787   </xsl:template>
788
789   <!--==== MONTH CALENDAR VIEW ====-->
790   <xsl:template name="monthView">
791     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
792       <tr>
793         <xsl:for-each select="/bedework/daynames/val">
794           <th class="dayHeading"><xsl:value-of select="."/></th>
795         </xsl:for-each>
796       </tr>
797       <xsl:for-each select="/bedework/eventscalendar/year/month/week">
798         <tr>
799           <xsl:for-each select="day">
800             <xsl:variable name="dayPos" select="position()"/>
801             <xsl:choose>
802               <xsl:when test="filler='true'">
803                 <td class="filler">&#160;</td>
804               </xsl:when>
805               <xsl:otherwise>
806                 <td>
807                   <xsl:variable name="dayDate" select="date"/>
808                   <a href="{$initEvent}?date={$dayDate}" class="gridAdd">[add]</a>
809                   <a href="{$setViewPeriod}?viewType=dayView&amp;date={$dayDate}" class="dayLink">
810                     <xsl:value-of select="value"/>
811                   </a>
812                   <ul>
813                     <xsl:apply-templates select="event" mode="calendarLayout">
814                       <xsl:with-param name="dayPos" select="$dayPos"/>
815                     </xsl:apply-templates>
816                   </ul>
817                 </td>
818               </xsl:otherwise>
819             </xsl:choose>
820           </xsl:for-each>
821         </tr>
822       </xsl:for-each>
823     </table>
824   </xsl:template>
825
826   <xsl:template match="event" mode="calendarLayout">
827     <xsl:param name="dayPos"/>
828     <xsl:variable name="subscriptionId" select="subscription/id"/>
829     <xsl:variable name="calendarId" select="calendar/id"/>
830     <xsl:variable name="guid" select="guid"/>
831     <xsl:variable name="recurrenceId" select="recurrenceId"/>
832     <xsl:variable name="eventClass">
833       <xsl:choose>
834         <!-- Special styles for the month grid -->
835         <xsl:when test="status='cancelled'">eventCancelled</xsl:when>
836         <xsl:when test="calendar/name='Holidays'">holiday</xsl:when>
837         <!-- Alternating colors for all standard events -->
838         <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when>
839         <xsl:otherwise>eventLinkB</xsl:otherwise>
840       </xsl:choose>
841     </xsl:variable>
842     <li>
843       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" class="{$eventClass}">
844         <xsl:value-of select="summary"/>
845         <xsl:variable name="eventTipClass">
846           <xsl:choose>
847             <xsl:when test="$dayPos &gt; 5">eventTipReverse</xsl:when>
848             <xsl:otherwise>eventTip</xsl:otherwise>
849           </xsl:choose>
850         </xsl:variable>
851         <span class="{$eventTipClass}">
852           <strong><xsl:value-of select="summary"/></strong><br/>
853           Time:
854           <xsl:choose>
855             <xsl:when test="start/allday = 'false'">
856               <xsl:value-of select="start/time"/>
857                - <xsl:value-of select="end/time"/>
858             </xsl:when>
859             <xsl:otherwise>
860               all day
861             </xsl:otherwise>
862           </xsl:choose><br/>
863           <xsl:if test="location/address">
864             Location: <xsl:value-of select="location/address"/><br/>
865           </xsl:if>
866           Calendar: <xsl:value-of select="calendar/name"/>
867           Type:
868           <xsl:choose>
869             <xsl:when test="kind='0'">
870               personal event, editable
871             </xsl:when>
872             <xsl:when test="kind='1'">
873               public event
874             </xsl:when>
875             <xsl:otherwise>
876               subscription
877             </xsl:otherwise>
878           </xsl:choose>
879         </span>
880       </a>
881     </li>
882   </xsl:template>
883
884   <!--==== YEAR VIEW ====-->
885   <xsl:template name="yearView">
886     <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0">
887       <tr>
888         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &lt;= 3]"/>
889       </tr>
890       <tr>
891         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 3) and (position() &lt;= 6)]"/>
892       </tr>
893       <tr>
894         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 6) and (position() &lt;= 9)]"/>
895       </tr>
896       <tr>
897         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &gt; 9]"/>
898       </tr>
899     </table>
900   </xsl:template>
901
902   <!-- year view month tables -->
903   <xsl:template match="month">
904     <td>
905       <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0">
906         <tr>
907           <td colspan="8" class="monthName">
908             <xsl:variable name="firstDayOfMonth" select="week/day/date"/>
909             <a href="{$setViewPeriod}?viewType=monthView&amp;date={$firstDayOfMonth}">
910               <xsl:value-of select="longname"/>
911             </a>
912           </td>
913         </tr>
914         <tr>
915           <th>&#160;</th>
916           <xsl:for-each select="/bedework/shortdaynames/val">
917             <th><xsl:value-of select="."/></th>
918           </xsl:for-each>
919         </tr>
920         <xsl:for-each select="week">
921           <tr>
922             <td class="weekCell">
923               <xsl:variable name="firstDayOfWeek" select="day/date"/>
924               <a href="{$setViewPeriod}?viewType=weekView&amp;date={$firstDayOfWeek}">
925                 <xsl:value-of select="value"/>
926               </a>
927             </td>
928             <xsl:for-each select="day">
929               <xsl:choose>
930                 <xsl:when test="filler='true'">
931                   <td class="filler">&#160;</td>
932                 </xsl:when>
933                 <xsl:otherwise>
934                   <td>
935                     <xsl:variable name="dayDate" select="date"/>
936                     <a href="{$setViewPeriod}?viewType=dayView&amp;date={$dayDate}">
937                       <xsl:value-of select="value"/>
938                     </a>
939                   </td>
940                 </xsl:otherwise>
941               </xsl:choose>
942             </xsl:for-each>
943           </tr>
944         </xsl:for-each>
945       </table>
946     </td>
947   </xsl:template>
948
949   <!--==== CALENDAR LISTING / MANAGE SUBSCRIPTIONS ====-->
950   <!-- DEPRECATED
951   <xsl:template match="calendars">
952     <xsl:variable name="publicCalCount" select="count(calendar[name='public']/calendar)"/>
953     <table id="calPageTable" border="0" cellpadding="0" cellspacing="0">
954       <tr>
955         <th colspan="2">
956           Calendar Subscriptions
957         </th>
958       </tr>
959       <tr>
960         <td colspan="2" class="infoCell">
961           Add and remove subscriptions to public calendars
962         </td>
963       </tr>
964       <tr>
965         <td class="leftCell">
966           <ul class="calendarTree">
967             <xsl:apply-templates select="calendar[name='public']/calendar[position() &lt;= ceiling($publicCalCount div 2)]" mode="calTree"/>
968           </ul>
969         </td>
970         <td>
971           <ul class="calendarTree">
972             <xsl:apply-templates select="calendar[name='public']/calendar[position() &gt; ceiling($publicCalCount div 2)]" mode="calTree"/>
973           </ul>
974         </td>
975       </tr>
976     </table>
977   </xsl:template>
978
979   <xsl:template match="calendar" mode="calTree">
980    <xsl:variable name="itemClass">
981       <xsl:choose>
982         <xsl:when test="calendarCollection='false'">folder</xsl:when>
983         <xsl:otherwise>calendar</xsl:otherwise>
984       </xsl:choose>
985     </xsl:variable>
986     <xsl:variable name="id" select="id"/>
987     <xsl:variable name="name" select="name"/>
988     <li class="{$itemClass}">
989       <a href="{$subscribe}?calid={$id}&amp;name={$name}"><xsl:value-of select="name"/></a>
990       <xsl:if test="calendar">
991         <ul>
992           <xsl:apply-templates select="calendar" mode="calTree"/>
993         </ul>
994       </xsl:if>
995     </li>
996   </xsl:template> -->
997
998   <!--==== SINGLE EVENT ====-->
999   <xsl:template match="event">
1000     <xsl:variable name="subscriptionId" select="subscription/id"/>
1001     <xsl:variable name="calendarId" select="calendar/id"/>
1002     <xsl:variable name="guid" select="guid"/>
1003     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1004     <table id="commonTable" cellpadding="0" cellspacing="0">
1005       <tr>
1006         <th colspan="3" id="commonHeader">
1007           <div id="eventActions">
1008             <xsl:choose>
1009               <xsl:when test="kind='0'">
1010                 <a href="{$editEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1011                   Edit Event
1012                 </a> |
1013                 <xsl:choose>
1014                   <xsl:when test="recurring=true">
1015                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;confirmationid={$confId}">
1016                       Delete All (recurring)
1017                     </a>
1018                   </xsl:when>
1019                   <xsl:otherwise>
1020                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1021                       Delete Event
1022                     </a>
1023                   </xsl:otherwise>
1024                 </xsl:choose>
1025               </xsl:when>
1026               <xsl:when test="kind='1'">
1027                 <xsl:choose>
1028                   <xsl:when test="recurring=true">
1029                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;confirmationid={$confId}">
1030                       Remove All (recurring)
1031                     </a>
1032                   </xsl:when>
1033                   <xsl:otherwise>
1034                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1035                       Remove
1036                     </a>
1037                   </xsl:otherwise>
1038                 </xsl:choose>
1039               </xsl:when>
1040               <xsl:otherwise>
1041                 <a href="{$fetchPublicCalendars}">
1042                   Manage Subscriptions
1043                 </a>
1044               </xsl:otherwise>
1045             </xsl:choose>
1046           </div>
1047           <xsl:choose>
1048             <xsl:when test="kind='0'">
1049               Private Event
1050             </xsl:when>
1051             <xsl:when test="kind='1'">
1052               Public Event
1053             </xsl:when>
1054             <xsl:otherwise>
1055               Public Event from Subscription
1056             </xsl:otherwise>
1057           </xsl:choose>
1058         </th>
1059       </tr>
1060       <tr>
1061         <th class="fieldname">Event:</th>
1062         <th class="fieldval">
1063           <xsl:choose>
1064             <xsl:when test="link != ''">
1065               <xsl:variable name="link" select="link"/>
1066               <a href="{$link}">
1067                 <xsl:value-of select="summary"/>
1068               </a>
1069             </xsl:when>
1070             <xsl:otherwise>
1071               <xsl:value-of select="summary"/>
1072             </xsl:otherwise>
1073           </xsl:choose>
1074         </th>
1075         <th class="icon" rowspan="2">
1076           <xsl:variable name="icalName" select="concat($guid,'.ics')"/>
1077           <a href="{$eventView}?subid={$subscriptionId}&amp;&amp;nocache=no&amp;skinName=ical&amp;contentType=text/calendar&amp;contentName={$icalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
1078             <img src="{$resourcesRoot}/resources/std-ical-icon.gif" width="20" height="26" border="0" align="left" alt="Download this event"/>
1079           </a><!-- <br />
1080           [<a href="">help</a>] -->
1081         </th>
1082       </tr>
1083       <tr>
1084         <td class="fieldname">When:</td>
1085         <td class="fieldval">
1086           <!-- was using abbrev dayname: substring(start/dayname,1,3) -->
1087           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
1088           <span class="time"><xsl:value-of select="start/time"/></span>
1089           <xsl:if test="end/time != '' or end/longdate != start/longdate"> - </xsl:if>
1090           <xsl:if test="end/longdate != start/longdate"><xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text></xsl:if>
1091           <xsl:if test="end/time != ''"><span class="time"><xsl:value-of select="end/time"/></span></xsl:if>
1092         </td>
1093       </tr>
1094       <tr>
1095         <td class="fieldname">Where:</td>
1096         <td colspan="3" class="fieldval">
1097           <xsl:choose>
1098             <xsl:when test="location/link=''">
1099               <xsl:value-of select="location/address"/>
1100             </xsl:when>
1101             <xsl:otherwise>
1102               <xsl:variable name="locationLink" select="location/link"/>
1103               <a href="{$locationLink}">
1104                 <xsl:value-of select="location/address"/>
1105               </a>
1106             </xsl:otherwise>
1107           </xsl:choose>
1108           <xsl:if test="location/subaddress!=''">
1109             <br/><xsl:value-of select="location/subaddress"/>
1110           </xsl:if>
1111         </td>
1112       </tr>
1113       <tr>
1114         <td class="fieldname">Description:</td>
1115         <td colspan="3" class="fieldval">
1116           <xsl:value-of select="description"/>
1117         </td>
1118       </tr>
1119        <xsl:if test="cost!=''">
1120         <tr>
1121           <td class="fieldname">Cost:</td>
1122           <td colspan="2" class="fieldval"><xsl:value-of select="cost"/></td>
1123         </tr>
1124       </xsl:if>
1125       <xsl:if test="link != ''">
1126         <tr>
1127           <td class="fieldname">See:</td>
1128           <td colspan="3" class="fieldval">
1129             <xsl:variable name="link" select="link"/>
1130             <a href="{$link}"><xsl:value-of select="link"/></a>
1131           </td>
1132         </tr>
1133       </xsl:if>
1134       <xsl:if test="sponsor/name!='none'">
1135         <tr>
1136           <td class="fieldname">Contact:</td>
1137           <td colspan="3" class="fieldval">
1138             <xsl:choose>
1139               <xsl:when test="sponsor/link=''">
1140                 <xsl:value-of select="sponsor/name"/>
1141               </xsl:when>
1142               <xsl:otherwise>
1143                 <xsl:variable name="sponsorLink" select="sponsor/link"/>
1144                 <a href="{$sponsorLink}">
1145                   <xsl:value-of select="sponsor/name"/>
1146                 </a>
1147               </xsl:otherwise>
1148             </xsl:choose>
1149             <xsl:if test="sponsor/phone!=''">
1150               <br /><xsl:value-of select="sponsor/phone"/>
1151             </xsl:if>
1152             <xsl:if test="sponsor/email!=''">
1153               <br />
1154               <xsl:variable name="email" select="sponsor/email"/>
1155               <xsl:variable name="subject" select="summary"/>
1156               <a href="mailto:{$email}?subject={$subject}">
1157                 <xsl:value-of select="sponsor/email"/>
1158               </a>
1159             </xsl:if>
1160           </td>
1161         </tr>
1162       </xsl:if>
1163       <xsl:if test="calendar/name!=''">
1164         <tr>
1165           <td class="fieldname">Calendar:</td>
1166           <td class="fieldval"><xsl:value-of select="calendar/name"/></td>
1167         </tr>
1168       </xsl:if>
1169     </table>
1170   </xsl:template>
1171
1172  <!--==== ADD EVENT ====-->
1173   <xsl:template name="addEvent">
1174     <form name="eventForm" method="post" action="{$addEventUsingPage}" id="standardForm">
1175       <input type="hidden" name="confirmationid" value="{$confId}"/>
1176       <input type="hidden" name="endType" value="date"/>
1177       <table id="commonTable" cellpadding="0" cellspacing="0">
1178         <tr>
1179           <th colspan="2" id="commonHeader">Add Event</th>
1180         </tr>
1181         <tr>
1182           <td class="fieldname">
1183             Title:
1184           </td>
1185           <td class="fieldval">
1186             <xsl:variable name="title" select="/bedework/eventform/form/title/input/@value"/>
1187             <input type="text" name="newEvent.summary" size="80" value="{$title}"/>
1188           </td>
1189         </tr>
1190         <tr>
1191           <td class="fieldname">
1192             Date &amp; Time:
1193           </td>
1194           <td class="fieldval">
1195             <!-- Set the timefields class for the first load of the page;
1196                  subsequent changes will take place using javascript without a
1197                  page reload. -->
1198             <xsl:variable name="timeFieldsClass">
1199               <xsl:choose>
1200                 <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1201                 <xsl:otherwise>timeFields</xsl:otherwise>
1202               </xsl:choose>
1203             </xsl:variable>
1204             <xsl:choose>
1205               <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">
1206                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
1207                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
1208                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
1209               </xsl:when>
1210               <xsl:otherwise>
1211                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
1212                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
1213                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
1214               </xsl:otherwise>
1215             </xsl:choose>
1216             all day event<br/>
1217             <div class="dateStartEndBox">
1218               <strong>Start:</strong>
1219               <div class="dateFields">
1220                 <span class="startDateLabel">Date </span>
1221                 <xsl:copy-of select="/bedework/formElements/form/start/month/*"/>
1222                 <xsl:copy-of select="/bedework/formElements/form/start/day/*"/>
1223                 <xsl:choose>
1224                   <xsl:when test="/bedework/creating = 'true'">
1225                     <xsl:copy-of select="/bedework/formElements/form/start/year/*"/>
1226                   </xsl:when>
1227                   <xsl:otherwise>
1228                     <xsl:copy-of select="/bedework/formElements/form/start/yearText/*"/>
1229                   </xsl:otherwise>
1230                 </xsl:choose>
1231               </div>
1232               <script language="JavaScript" type="text/javascript">
1233               <xsl:comment>
1234                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', 'startDateCalWidgetCallback');
1235               </xsl:comment>
1236               </script>
1237               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1238               <div class="{$timeFieldsClass}" id="startTimeFields">
1239                 <span id="calWidgetStartTimeHider" class="show">
1240                   <xsl:copy-of select="/bedework/formElements/form/start/hour/*"/>
1241                   <xsl:copy-of select="/bedework/formElements/form/start/minute/*"/>
1242                   <xsl:if test="/bedework/formElements/form/start/ampm">
1243                     <xsl:copy-of select="/bedework/formElements/form/start/ampm/*"/>
1244                   </xsl:if>
1245                   <xsl:text> </xsl:text>
1246                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1247                 </span>
1248               </div>
1249             </div>
1250             <div class="dateStartEndBox">
1251               <strong>End:</strong>
1252               <xsl:choose>
1253                 <xsl:when test="/bedework/formElements/form/end/type='E'">
1254                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1255                 </xsl:when>
1256                 <xsl:otherwise>
1257                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1258                 </xsl:otherwise>
1259               </xsl:choose>
1260               Date
1261               <xsl:variable name="endDateTimeClass">
1262                 <xsl:choose>
1263                   <xsl:when test="/bedework/formElements/form/end/type='E'">shown</xsl:when>
1264                   <xsl:otherwise>invisible</xsl:otherwise>
1265                 </xsl:choose>
1266               </xsl:variable>
1267               <div class="{$endDateTimeClass}" id="endDateTime">
1268                 <div class="dateFields">
1269                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/month/*"/>
1270                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/day/*"/>
1271                   <xsl:choose>
1272                     <xsl:when test="/bedework/creating = 'true'">
1273                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/year/*"/>
1274                     </xsl:when>
1275                     <xsl:otherwise>
1276                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/yearText/*"/>
1277                     </xsl:otherwise>
1278                   </xsl:choose>
1279                 </div>
1280                 <script language="JavaScript" type="text/javascript">
1281                 <xsl:comment>
1282                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', 'endDateCalWidgetCallback');
1283                 </xsl:comment>
1284                 </script>
1285                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1286                 <div class="{$timeFieldsClass}" id="endTimeFields">
1287                   <span id="calWidgetEndTimeHider" class="show">
1288                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/hour/*"/>
1289                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/minute/*"/>
1290                     <xsl:if test="/bedework/formElements/form/end/dateTime/ampm">
1291                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/ampm/*"/>
1292                     </xsl:if>
1293                     <xsl:text> </xsl:text>
1294                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1295                   </span>
1296                 </div>
1297               </div><br/>
1298               <div id="clock" class="invisible">
1299                 <xsl:call-template name="clock"/>
1300               </div>
1301               <div class="dateFields">
1302                 <xsl:choose>
1303                   <xsl:when test="/bedework/formElements/form/end/type='D'">
1304                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1305                   </xsl:when>
1306                   <xsl:otherwise>
1307                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1308                   </xsl:otherwise>
1309                 </xsl:choose>
1310                 Duration
1311                 <xsl:variable name="endDurationClass">
1312                   <xsl:choose>
1313                     <xsl:when test="/bedework/formElements/form/end/type='D'">shown</xsl:when>
1314                     <xsl:otherwise>invisible</xsl:otherwise>
1315                   </xsl:choose>
1316                 </xsl:variable>
1317                 <xsl:variable name="durationHrMinClass">
1318                   <xsl:choose>
1319                     <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1320                     <xsl:otherwise>shown</xsl:otherwise>
1321                   </xsl:choose>
1322                 </xsl:variable>
1323                 <div class="{$endDurationClass}" id="endDuration">
1324                   <xsl:choose>
1325                     <xsl:when test="/bedework/formElements/form/end/duration/weeks/input/@value = '0'">
1326                     <!-- we are using day, hour, minute format -->
1327                     <!-- must send either no week value or week value of 0 (zero) -->
1328                       <div class="durationBox">
1329                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1330                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1331                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1332                         <span id="durationHrMin" class="{$durationHrMinClass}">
1333                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1334                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1335                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1336                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
1337                         </span>
1338                       </div>
1339                       <span class="durationSpacerText">or</span>
1340                       <div class="durationBox">
1341                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
1342                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1343                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
1344                       </div>
1345                     </xsl:when>
1346                     <xsl:otherwise>
1347                       <!-- we are using week format -->
1348                       <div class="durationBox">
1349                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
1350                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1351                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
1352                         <span id="durationHrMin" class="{$durationHrMinClass}">
1353                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1354                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
1355                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1356                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
1357                         </span>
1358                       </div>
1359                       <span class="durationSpacerText">or</span>
1360                       <div class="durationBox">
1361                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
1362                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1363                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
1364                       </div>
1365                     </xsl:otherwise>
1366                   </xsl:choose>
1367                 </div>
1368               </div><br/>
1369               <div class="dateFields" id="noDuration">
1370                 <xsl:choose>
1371                   <xsl:when test="/bedework/formElements/form/end/type='N'">
1372                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1373                   </xsl:when>
1374                   <xsl:otherwise>
1375                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1376                   </xsl:otherwise>
1377                 </xsl:choose>
1378                 This event has no duration / end date
1379               </div>
1380             </div>
1381           </td>
1382         </tr>
1383         <!--  Status  -->
1384         <tr>
1385           <td class="fieldname">
1386             Status:
1387           </td>
1388           <td class="fieldval">
1389             <xsl:choose>
1390               <xsl:when test="/bedework/formElements/form/status = 'TENTATIVE'">
1391                 <input type="radio" name="event.status" value="CONFIRMED"/>confirmed <input type="radio" name="event.status" value="TENTATIVE" checked="checked"/>tentative <input type="radio" name="event.status" value="CANCELLED"/>cancelled
1392               </xsl:when>
1393               <xsl:when test="/bedework/formElements/form/status = 'CANCELLED'">
1394                 <input type="radio" name="event.status" value="CONFIRMED"/>confirmed <input type="radio" name="event.status" value="TENTATIVE"/>tentative <input type="radio" name="event.status" value="CANCELLED" checked="checked"/>cancelled
1395               </xsl:when>
1396               <xsl:otherwise>
1397                 <input type="radio" name="event.status" value="CONFIRMED" checked="checked"/>confirmed <input type="radio" name="event.status" value="TENTATIVE"/>tentative <input type="radio" name="event.status" value="CANCELLED"/>cancelled
1398               </xsl:otherwise>
1399             </xsl:choose>
1400           </td>
1401         </tr>
1402         <tr>
1403           <td class="fieldname">Description:</td>
1404           <td class="fieldval">
1405             <xsl:copy-of select="/bedeworkadmin/formElements/form/desc/*"/>
1406           </td>
1407         </tr>
1408         <tr>
1409           <td class="fieldname">Location:</td>
1410           <td class="fieldval" align="left">
1411             <span class="std-text">choose: </span>
1412             <span id="eventFormLocationList">
1413               <xsl:copy-of select="/bedework/formElements/form/location/locationmenu/*"/>
1414             </span>
1415             <span class="std-text"> or add new: </span>
1416             <xsl:copy-of select="/bedework/formElements/form/location/locationtext/*"/>
1417           </td>
1418         </tr>
1419         <tr>
1420           <td class="fieldname">Event Link:</td>
1421           <td class="fieldval">
1422             <xsl:variable name="link" select="/bedework/formElements/form/link/input/@value"/>
1423             <input type="text" name="newEvent.link" size="80" value="{$link}"/>
1424           </td>
1425         </tr>
1426         <tr>
1427           <td class="fieldname">&#160;</td>
1428           <td class="fieldval">
1429             <input name="submit" type="submit" value="Submit Event"/>&#160;
1430             <input name="cancelled" type="submit" value="Cancel"/>
1431           </td>
1432         </tr>
1433       </table>
1434     </form>
1435   </xsl:template>
1436
1437   <xsl:template name="clock">
1438     <div id="bwClock">
1439       <!-- Bedework 24-Hour Clock time selection widget
1440            used with resources/bwClock.js and resources/bwClock.css -->
1441       <div id="bwClockClock">
1442         <img id="clockMap" src="{$resourcesRoot}/resources/clockMap.gif" width="368" height="368" border="0" alt="" usemap="#bwClockMap" />
1443       </div>
1444       <div id="bwClockCover">
1445         <!-- this is a special effect div used simply to cover the pixelated edge
1446              where the clock meets the clock box title -->
1447       </div>
1448       <div id="bwClockBox">
1449         <h2>
1450           Bedework 24-Hour Clock
1451         </h2>
1452         <div id="bwClockDateTypeIndicator">
1453           type
1454         </div>
1455         <div id="bwClockTime">
1456           select time
1457         </div>
1458         <div id="bwClockCloseText">
1459           close
1460         </div>
1461         <div id="bwClockCloseButton">
1462           <a href="javascript:bwClockClose();">X</a>
1463         </div>
1464       </div>
1465       <map name="bwClockMap" id="bwClockMap">
1466         <area shape="rect" alt="close clock" title="close clock" coords="160,167, 200,200" href="javascript:bwClockClose()"/>
1467         <area shape="poly" alt="minute 00:55" title="minute 00:55" coords="156,164, 169,155, 156,107, 123,128" href="javascript:bwClockUpdateDateTimeForm('minute','55')" />
1468         <area shape="poly" alt="minute 00:50" title="minute 00:50" coords="150,175, 156,164, 123,128, 103,161" href="javascript:bwClockUpdateDateTimeForm('minute','50')" />
1469         <area shape="poly" alt="minute 00:45" title="minute 00:45" coords="150,191, 150,175, 103,161, 103,206" href="javascript:bwClockUpdateDateTimeForm('minute','45')" />
1470         <area shape="poly" alt="minute 00:40" title="minute 00:40" coords="158,208, 150,191, 105,206, 123,237" href="javascript:bwClockUpdateDateTimeForm('minute','40')" />
1471         <area shape="poly" alt="minute 00:35" title="minute 00:35" coords="171,218, 158,208, 123,238, 158,261" href="javascript:bwClockUpdateDateTimeForm('minute','35')" />
1472         <area shape="poly" alt="minute 00:30" title="minute 00:30" coords="193,218, 172,218, 158,263, 209,263" href="javascript:bwClockUpdateDateTimeForm('minute','30')" />
1473         <area shape="poly" alt="minute 00:25" title="minute 00:25" coords="209,210, 193,218, 209,261, 241,240" href="javascript:bwClockUpdateDateTimeForm('minute','25')" />
1474         <area shape="poly" alt="minute 00:20" title="minute 00:20" coords="216,196, 209,210, 241,240, 261,206" href="javascript:bwClockUpdateDateTimeForm('minute','20')" />
1475         <area shape="poly" alt="minute 00:15" title="minute 00:15" coords="216,178, 216,196, 261,206, 261,159" href="javascript:bwClockUpdateDateTimeForm('minute','15')" />
1476         <area shape="poly" alt="minute 00:10" title="minute 00:10" coords="209,164, 216,178, 261,159, 240,126" href="javascript:bwClockUpdateDateTimeForm('minute','10')" />
1477         <area shape="poly" alt="minute 00:05" title="minute 00:05" coords="196,155, 209,164, 238,126, 206,107" href="javascript:bwClockUpdateDateTimeForm('minute','05')" />
1478         <area shape="poly" alt="minute 00:00" title="minute 00:00" coords="169,155, 196,155, 206,105, 156,105" href="javascript:bwClockUpdateDateTimeForm('minute','00')" />
1479         <area shape="poly" alt="11 PM, 2300 hour" title="11 PM, 2300 hour" coords="150,102, 172,96, 158,1, 114,14" href="javascript:bwClockUpdateDateTimeForm('hour','23')" />
1480         <area shape="poly" alt="10 PM, 2200 hour" title="10 PM, 2200 hour" coords="131,114, 150,102, 114,14, 74,36" href="javascript:bwClockUpdateDateTimeForm('hour','22')" />
1481         <area shape="poly" alt="9 PM, 2100 hour" title="9 PM, 2100 hour" coords="111,132, 131,114, 74,36, 40,69" href="javascript:bwClockUpdateDateTimeForm('hour','21')" />
1482         <area shape="poly" alt="8 PM, 2000 hour" title="8 PM, 2000 hour" coords="101,149, 111,132, 40,69, 15,113" href="javascript:bwClockUpdateDateTimeForm('hour','20')" />
1483         <area shape="poly" alt="7 PM, 1900 hour" title="7 PM, 1900 hour" coords="95,170, 101,149, 15,113, 1,159" href="javascript:bwClockUpdateDateTimeForm('hour','19')" />
1484         <area shape="poly" alt="6 PM, 1800 hour" title="6 PM, 1800 hour" coords="95,196, 95,170, 0,159, 0,204" href="javascript:bwClockUpdateDateTimeForm('hour','18')" />
1485         <area shape="poly" alt="5 PM, 1700 hour" title="5 PM, 1700 hour" coords="103,225, 95,196, 1,205, 16,256" href="javascript:bwClockUpdateDateTimeForm('hour','17')" />
1486         <area shape="poly" alt="4 PM, 1600 hour" title="4 PM, 1600 hour" coords="116,245, 103,225, 16,256, 41,298" href="javascript:bwClockUpdateDateTimeForm('hour','16')" />
1487         <area shape="poly" alt="3 PM, 1500 hour" title="3 PM, 1500 hour" coords="134,259, 117,245, 41,298, 76,332" href="javascript:bwClockUpdateDateTimeForm('hour','15')" />
1488         <area shape="poly" alt="2 PM, 1400 hour" title="2 PM, 1400 hour" coords="150,268, 134,259, 76,333, 121,355" href="javascript:bwClockUpdateDateTimeForm('hour','14')" />
1489         <area shape="poly" alt="1 PM, 1300 hour" title="1 PM, 1300 hour" coords="169,273, 150,268, 120,356, 165,365" href="javascript:bwClockUpdateDateTimeForm('hour','13')" />
1490         <area shape="poly" alt="Noon, 1200 hour" title="Noon, 1200 hour" coords="193,273, 169,273, 165,365, 210,364" href="javascript:bwClockUpdateDateTimeForm('hour','12')" />
1491         <area shape="poly" alt="11 AM, 1100 hour" title="11 AM, 1100 hour" coords="214,270, 193,273, 210,363, 252,352" href="javascript:bwClockUpdateDateTimeForm('hour','11')" />
1492         <area shape="poly" alt="10 AM, 1000 hour" title="10 AM, 1000 hour" coords="232,259, 214,270, 252,352, 291,330" href="javascript:bwClockUpdateDateTimeForm('hour','10')" />
1493         <area shape="poly" alt="9 AM, 0900 hour" title="9 AM, 0900 hour" coords="251,240, 232,258, 291,330, 323,301" href="javascript:bwClockUpdateDateTimeForm('hour','09')" />
1494         <area shape="poly" alt="8 AM, 0800 hour" title="8 AM, 0800 hour" coords="263,219, 251,239, 323,301, 349,261" href="javascript:bwClockUpdateDateTimeForm('hour','08')" />
1495         <area shape="poly" alt="7 AM, 0700 hour" title="7 AM, 0700 hour" coords="269,194, 263,219, 349,261, 363,212" href="javascript:bwClockUpdateDateTimeForm('hour','07')" />
1496         <area shape="poly" alt="6 AM, 0600 hour" title="6 AM, 0600 hour" coords="269,172, 269,193, 363,212, 363,155" href="javascript:bwClockUpdateDateTimeForm('hour','06')" />
1497         <area shape="poly" alt="5 AM, 0500 hour" title="5 AM, 0500 hour" coords="263,150, 269,172, 363,155, 351,109" href="javascript:bwClockUpdateDateTimeForm('hour','05')" />
1498         <area shape="poly" alt="4 AM, 0400 hour" title="4 AM, 0400 hour" coords="251,130, 263,150, 351,109, 325,68" href="javascript:bwClockUpdateDateTimeForm('hour','04')" />
1499         <area shape="poly" alt="3 AM, 0300 hour" title="3 AM, 0300 hour" coords="234,112, 251,130, 325,67, 295,37" href="javascript:bwClockUpdateDateTimeForm('hour','03')" />
1500         <area shape="poly" alt="2 AM, 0200 hour" title="2 AM, 0200 hour" coords="221,102, 234,112, 295,37, 247,11" href="javascript:bwClockUpdateDateTimeForm('hour','02')" />
1501         <area shape="poly" alt="1 AM, 0100 hour" title="1 AM, 0100 hour" coords="196,96, 221,102, 247,10, 209,-1, 201,61, 206,64, 205,74, 199,75" href="javascript:bwClockUpdateDateTimeForm('hour','01')" />
1502         <area shape="poly" alt="Midnight, 0000 hour" title="Midnight, 0000 hour" coords="172,96, 169,74, 161,73, 161,65, 168,63, 158,-1, 209,-1, 201,61, 200,62, 206,64, 205,74, 198,75, 196,96, 183,95" href="javascript:bwClockUpdateDateTimeForm('hour','00')" />
1503       </map>
1504     </div>
1505   </xsl:template>
1506
1507   <!--==== EDIT EVENT ====-->
1508   <xsl:template match="formElements">
1509     <form name="eventForm" method="post" action="{$editEvent}" id="standardForm">
1510       <input type="hidden" name="updateEvent" value="true"/>
1511       <input type="hidden" name="confirmationid" value="{$confId}"/>
1512       <input type="hidden" name="endType" value="date"/>
1513       <table id="commonTable" cellpadding="0" cellspacing="0">
1514         <tr>
1515           <th colspan="2" id="commonHeader">
1516             <div id="eventActions">
1517               <xsl:variable name="subscriptionId" select="subscriptionId"/>
1518               <xsl:variable name="calendarId" select="calendarId"/>
1519               <xsl:variable name="guid" select="guid"/>
1520               <xsl:variable name="recurrenceId" select="recurrenceId"/>
1521               <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1522                 View Event
1523               </a> |
1524               <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1525                 Delete Event
1526               </a>
1527             </div>
1528             Edit Event
1529           </th>
1530         </tr>
1531         <tr>
1532           <td class="fieldname">
1533             Title:
1534           </td>
1535           <td class="fieldval">
1536             <xsl:variable name="title" select="form/title/input/@value"/>
1537             <input type="text" name="editEvent.summary" size="80" value="{$title}"/>
1538           </td>
1539         </tr>
1540         <tr>
1541           <td class="fieldname">
1542             Date &amp; Time:
1543           </td>
1544           <td class="fieldval">
1545             <!-- Set the timefields class for the first load of the page;
1546                  subsequent changes will take place using javascript without a
1547                  page reload. -->
1548             <xsl:variable name="timeFieldsClass">
1549               <xsl:choose>
1550                 <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
1551                 <xsl:otherwise>timeFields</xsl:otherwise>
1552               </xsl:choose>
1553             </xsl:variable>
1554             <xsl:choose>
1555               <xsl:when test="form/allDay/input/@checked='checked'">
1556                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
1557                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
1558                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
1559               </xsl:when>
1560               <xsl:otherwise>
1561                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
1562                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
1563                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
1564               </xsl:otherwise>
1565             </xsl:choose>
1566             all day event<br/>
1567             <div class="dateStartEndBox">
1568               <strong>Start:</strong>
1569               <div class="dateFields">
1570                 <span class="startDateLabel">Date </span>
1571                 <xsl:copy-of select="form/start/month/*"/>
1572                 <xsl:copy-of select="form/start/day/*"/>
1573                 <xsl:choose>
1574                   <xsl:when test="/bedework/creating = 'true'">
1575                     <xsl:copy-of select="form/start/year/*"/>
1576                   </xsl:when>
1577                   <xsl:otherwise>
1578                     <xsl:copy-of select="form/start/yearText/*"/>
1579                   </xsl:otherwise>
1580                 </xsl:choose>
1581               </div>
1582               <script language="JavaScript" type="text/javascript">
1583               <xsl:comment>
1584                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', 'startDateCalWidgetCallback');
1585               </xsl:comment>
1586               </script>
1587               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1588               <div class="{$timeFieldsClass}" id="startTimeFields">
1589                 <span id="calWidgetStartTimeHider" class="show">
1590                   <xsl:copy-of select="form/start/hour/*"/>
1591                   <xsl:copy-of select="form/start/minute/*"/>
1592                   <xsl:if test="form/start/ampm">
1593                     <xsl:copy-of select="form/start/ampm/*"/>
1594                   </xsl:if>
1595                   <xsl:text> </xsl:text>
1596                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1597                 </span>
1598               </div>
1599             </div>
1600             <div class="dateStartEndBox">
1601               <strong>End:</strong>
1602               <xsl:choose>
1603                 <xsl:when test="form/end/type='E'">
1604                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1605                 </xsl:when>
1606                 <xsl:otherwise>
1607                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1608                 </xsl:otherwise>
1609               </xsl:choose>
1610               Date
1611               <xsl:variable name="endDateTimeClass">
1612                 <xsl:choose>
1613                   <xsl:when test="form/end/type='E'">shown</xsl:when>
1614                   <xsl:otherwise>invisible</xsl:otherwise>
1615                 </xsl:choose>
1616               </xsl:variable>
1617               <div class="{$endDateTimeClass}" id="endDateTime">
1618                 <div class="dateFields">
1619                   <xsl:copy-of select="form/end/dateTime/month/*"/>
1620                   <xsl:copy-of select="form/end/dateTime/day/*"/>
1621                   <xsl:choose>
1622                     <xsl:when test="/bedework/creating = 'true'">
1623                       <xsl:copy-of select="form/end/dateTime/year/*"/>
1624                     </xsl:when>
1625                     <xsl:otherwise>
1626                       <xsl:copy-of select="form/end/dateTime/yearText/*"/>
1627                     </xsl:otherwise>
1628                   </xsl:choose>
1629                 </div>
1630                 <script language="JavaScript" type="text/javascript">
1631                 <xsl:comment>
1632                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', 'endDateCalWidgetCallback');
1633                 </xsl:comment>
1634                 </script>
1635                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1636                 <div class="{$timeFieldsClass}" id="endTimeFields">
1637                   <span id="calWidgetEndTimeHider" class="show">
1638                     <xsl:copy-of select="form/end/dateTime/hour/*"/>
1639                     <xsl:copy-of select="form/end/dateTime/minute/*"/>
1640                     <xsl:if test="form/end/dateTime/ampm">
1641                       <xsl:copy-of select="form/end/dateTime/ampm/*"/>
1642                     </xsl:if>
1643                     <xsl:text> </xsl:text>
1644                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1645                   </span>
1646                 </div>
1647               </div><br/>
1648               <div id="clock" class="invisible">
1649                 <xsl:call-template name="clock"/>
1650               </div>
1651               <div class="dateFields">
1652                 <xsl:choose>
1653                   <xsl:when test="form/end/type='D'">
1654                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1655                   </xsl:when>
1656                   <xsl:otherwise>
1657                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1658                   </xsl:otherwise>
1659                 </xsl:choose>
1660                 Duration
1661                 <xsl:variable name="endDurationClass">
1662                   <xsl:choose>
1663                     <xsl:when test="form/end/type='D'">shown</xsl:when>
1664                     <xsl:otherwise>invisible</xsl:otherwise>
1665                   </xsl:choose>
1666                 </xsl:variable>
1667                 <xsl:variable name="durationHrMinClass">
1668                   <xsl:choose>
1669                     <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
1670                     <xsl:otherwise>shown</xsl:otherwise>
1671                   </xsl:choose>
1672                 </xsl:variable>
1673                 <div class="{$endDurationClass}" id="endDuration">
1674                   <xsl:choose>
1675                     <xsl:when test="form/end/duration/weeks/input/@value = '0'">
1676                     <!-- we are using day, hour, minute format -->
1677                     <!-- must send either no week value or week value of 0 (zero) -->
1678                       <div class="durationBox">
1679                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1680                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
1681                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1682                         <span id="durationHrMin" class="{$durationHrMinClass}">
1683                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
1684                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1685                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
1686                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
1687                         </span>
1688                       </div>
1689                       <span class="durationSpacerText">or</span>
1690                       <div class="durationBox">
1691                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
1692                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
1693                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
1694                       </div>
1695                     </xsl:when>
1696                     <xsl:otherwise>
1697                       <!-- we are using week format -->
1698                       <div class="durationBox">
1699                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
1700                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
1701                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
1702                         <span id="durationHrMin" class="{$durationHrMinClass}">
1703                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
1704                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
1705                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
1706                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
1707                         </span>
1708                       </div>
1709                       <span class="durationSpacerText">or</span>
1710                       <div class="durationBox">
1711                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
1712                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
1713                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
1714                       </div>
1715                     </xsl:otherwise>
1716                   </xsl:choose>
1717                 </div>
1718               </div><br/>
1719               <div class="dateFields" id="noDuration">
1720                 <xsl:choose>
1721                   <xsl:when test="form/end/type='N'">
1722                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1723                   </xsl:when>
1724                   <xsl:otherwise>
1725                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1726                   </xsl:otherwise>
1727                 </xsl:choose>
1728                 This event has no duration / end date
1729               </div>
1730             </div>
1731           </td>
1732         </tr>
1733         <!--  Status  -->
1734         <tr>
1735           <td class="fieldname">
1736             Status:
1737           </td>
1738           <td class="fieldval">
1739             <xsl:choose>
1740               <xsl:when test="form/status = 'TENTATIVE'">
1741                 <input type="radio" name="editEvent.status" value="CONFIRMED"/>confirmed <input type="radio" name="editEvent.status" value="TENTATIVE" checked="checked"/>tentative <input type="radio" name="editEvent.status" value="CANCELLED"/>cancelled
1742               </xsl:when>
1743               <xsl:when test="form/status = 'CANCELLED'">
1744                 <input type="radio" name="editEvent.status" value="CONFIRMED"/>confirmed <input type="radio" name="editEvent.status" value="TENTATIVE"/>tentative <input type="radio" name="editEvent.status" value="CANCELLED" checked="checked"/>cancelled
1745               </xsl:when>
1746               <xsl:otherwise>
1747                 <input type="radio" name="editEvent.status" value="CONFIRMED" checked="checked"/>confirmed <input type="radio" name="editEvent.status" value="TENTATIVE"/>tentative <input type="radio" name="editEvent.status" value="CANCELLED"/>cancelled
1748               </xsl:otherwise>
1749             </xsl:choose>
1750           </td>
1751         </tr>
1752         <tr>
1753           <td class="fieldname">Description:</td>
1754           <td class="fieldval">
1755             <xsl:copy-of select="/bedeworkadmin/formElements/form/desc/*"/>
1756           </td>
1757         </tr>
1758         <tr>
1759           <td class="fieldname">Location:</td>
1760           <td class="fieldval" align="left">
1761             <span class="std-text">choose: </span>
1762             <span id="eventFormLocationList">
1763               <xsl:copy-of select="form/location/locationmenu/*"/>
1764             </span>
1765             <span class="std-text"> or add new: </span>
1766             <xsl:copy-of select="form/location/locationtext/*"/>
1767           </td>
1768         </tr>
1769         <tr>
1770           <td class="fieldname">Event Link:</td>
1771           <td class="fieldval">
1772             <xsl:variable name="link" select="form/link/input/@value"/>
1773             <input type="text" name="editEvent.link" size="80" value="{$link}"/>
1774           </td>
1775         </tr>
1776         <tr>
1777           <td class="fieldname">&#160;</td>
1778           <td class="fieldval">
1779             <input name="submit" type="submit" value="Submit Event"/>&#160;
1780             <input name="cancelled" type="submit" value="Cancel"/>
1781           </td>
1782         </tr>
1783       </table>
1784     </form>
1785   </xsl:template>
1786
1787   <!--+++++++++++++++ Subscriptions ++++++++++++++++++++-->
1788   <xsl:template match="subscriptions">
1789     <table id="subsTable">
1790       <tr>
1791         <td class="cals">
1792           <h3>Public calendars</h3>
1793           <p class="smaller">
1794             Select a calendar below to add a <em><strong>new</strong></em>
1795             internal subscription. <!-- or
1796             <a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">
1797             subscribe to an external calendar</a>.-->
1798           </p>
1799           <ul id="calendarTree">
1800             <xsl:apply-templates select="/bedeworkadmin/subscriptions/subscribe/calendars/calendar" mode="subscribe"/>
1801           </ul>
1802         </td>
1803         <td class="subs">
1804           <xsl:choose>
1805             <xsl:when test="/bedeworkadmin/page='subscriptions'">
1806               <xsl:call-template name="subscriptionList"/>
1807             </xsl:when>
1808             <xsl:when test="/bedeworkadmin/creating='true'">
1809               <xsl:apply-templates select="subscription" mode="addSubscription"/>
1810             </xsl:when>
1811             <xsl:otherwise>
1812               <xsl:apply-templates select="subscription" mode="modSubscription"/>
1813             </xsl:otherwise>
1814           </xsl:choose>
1815         </td>
1816       </tr>
1817     </table>
1818   </xsl:template>
1819
1820   <xsl:template match="calendar" mode="subscribe">
1821     <xsl:variable name="id" select="id"/>
1822     <xsl:variable name="itemClass">
1823       <xsl:choose>
1824         <xsl:when test="calendarCollection='false'">folder</xsl:when>
1825         <xsl:otherwise>calendar</xsl:otherwise>
1826       </xsl:choose>
1827     </xsl:variable>
1828     <li class="{$itemClass}">
1829       <a href="{$subscriptions-initAdd}&amp;calId={$id}">
1830         <xsl:value-of select="name"/>
1831       </a>
1832       <xsl:if test="calendar">
1833         <ul>
1834           <xsl:apply-templates select="calendar" mode="subscribe">
1835             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
1836           </xsl:apply-templates>
1837         </ul>
1838       </xsl:if>
1839     </li>
1840   </xsl:template>
1841
1842   <xsl:template match="subscription" mode="addSubscription">
1843     <h2>Add New Subscription</h2>
1844     <p class="note">*the subsciption name must be unique</p>
1845     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
1846       <table class="eventFormTable">
1847         <tr>
1848           <th>Name*:</th>
1849           <td>
1850             <xsl:variable name="subName" select="name"/>
1851             <input type="text" value="{$subName}" name="subscription.name" size="60"/>
1852           </td>
1853         </tr>
1854         <xsl:if test="internal='false'">
1855           <tr>
1856             <th>Uri:</th>
1857             <td>
1858               <xsl:variable name="subUri" select="uri"/>
1859               <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
1860             </td>
1861           </tr>
1862         </xsl:if>
1863         <tr>
1864           <th>Display:</th>
1865           <td>
1866             <input type="radio" value="true" name="subscription.display"/> yes
1867             <input type="radio" value="false" name="subscription.display" checked="checked"/> no
1868           </td>
1869         </tr>
1870         <tr>
1871           <th>Style:</th>
1872           <td>
1873             <xsl:variable name="subStyle" select="style"/>
1874             <input type="text" value="{$subStyle}" name="subscription.style" size="60"/>
1875           </td>
1876         </tr>
1877         <tr>
1878           <th>Unremovable:</th>
1879           <td>
1880             <input type="radio" value="true" name="unremoveable" size="60"/> true
1881             <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
1882           </td>
1883         </tr>
1884       </table>
1885       <table border="0" id="submitTable">
1886         <tr>
1887           <td>
1888             <input type="submit" name="addSubscription" value="Add Subscription"/>
1889             <input type="submit" name="cancelled" value="Cancel"/>
1890             <input type="reset" value="Clear"/>
1891           </td>
1892         </tr>
1893       </table>
1894     </form>
1895   </xsl:template>
1896
1897   <xsl:template match="subscription" mode="modSubscription">
1898     <h2>Modify Subscription</h2>
1899     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
1900       <table class="eventFormTable">
1901         <tr>
1902           <th>Name*:</th>
1903           <td>
1904             <xsl:value-of select="name"/>
1905             <xsl:variable name="subName" select="name"/>
1906             <input type="hidden" value="{$subName}" name="name"/>
1907           </td>
1908         </tr>
1909         <xsl:choose>
1910           <xsl:when test="internal='false'">
1911             <tr>
1912               <th>Uri:</th>
1913               <td>
1914                 <xsl:variable name="subUri" select="uri"/>
1915                 <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
1916               </td>
1917             </tr>
1918           </xsl:when>
1919           <xsl:otherwise>
1920             <tr>
1921               <th>Uri:</th>
1922               <td>
1923                 <xsl:value-of select="uri"/>
1924               </td>
1925             </tr>
1926           </xsl:otherwise>
1927         </xsl:choose>
1928         <tr>
1929           <th>Display:</th>
1930           <td>
1931             <xsl:choose>
1932               <xsl:when test="display='true'">
1933                 <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
1934                 <input type="radio" value="false" name="subscription.display"/> no
1935               </xsl:when>
1936               <xsl:otherwise>
1937                 <input type="radio" value="true" name="subscription.display"/> yes
1938                 <input type="radio" value="false" name="subscription.display" checked="checked"/> no
1939               </xsl:otherwise>
1940             </xsl:choose>
1941           </td>
1942         </tr>
1943         <tr>
1944           <th>Style:</th>
1945           <td>
1946             <xsl:variable name="subStyle" select="style"/>
1947             <input type="text" value="{$subStyle}" name="subscription.style" size="60"/>
1948           </td>
1949         </tr>
1950         <tr>
1951           <th>Unremovable:</th>
1952           <td>
1953             <xsl:choose>
1954               <xsl:when test="unremoveable='true'">
1955                 <input type="radio" value="true" name="unremoveable" size="60" checked="checked"/> true
1956                 <input type="radio" value="false" name="unremoveable" size="60"/> false
1957               </xsl:when>
1958               <xsl:otherwise>
1959                 <input type="radio" value="true" name="unremoveable" size="60"/> true
1960                 <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
1961               </xsl:otherwise>
1962             </xsl:choose>
1963           </td>
1964         </tr>
1965       </table>
1966       <table border="0" id="submitTable">
1967         <tr>
1968           <td>
1969             <input type="submit" name="updateSubscription" value="Update Subscription"/>
1970             <input type="submit" name="cancelled" value="Cancel"/>
1971             <input type="reset" value="Reset"/>
1972           </td>
1973           <td align="right">
1974             <input type="submit" name="delete" value="Delete Subscription"/>
1975           </td>
1976         </tr>
1977       </table>
1978     </form>
1979   </xsl:template>
1980
1981   <xsl:template name="subscriptionList">
1982     <h3>Current subscriptions</h3>
1983     <table id="commonListTable">
1984       <tr>
1985         <th>Name</th>
1986         <th>URI</th>
1987         <th>Style</th>
1988         <th>Display</th>
1989         <th>Unremovable</th>
1990         <th>External</th>
1991         <th>Deleted?</th>
1992       </tr>
1993       <xsl:for-each select="subscription">
1994         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
1995         <tr>
1996           <td>
1997             <xsl:variable name="subname" select="name"/>
1998             <a href="{$subscriptions-fetchForUpdate}&amp;subname={$subname}">
1999               <xsl:value-of select="name"/>
2000             </a>
2001           </td>
2002           <td>
2003             <xsl:value-of select="uri"/>
2004           </td>
2005           <td>
2006             <xsl:value-of select="style"/>
2007           </td>
2008           <td class="center">
2009             <xsl:if test="display='true'">
2010               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2011             </xsl:if>
2012           </td>
2013           <td class="center">
2014             <xsl:if test="unremoveable='true'">
2015               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2016             </xsl:if>
2017           </td>
2018           <td class="center">
2019             <xsl:if test="internal='false'">
2020               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2021             </xsl:if>
2022           </td>
2023           <td class="center">
2024             <xsl:if test="calendarDeleted='true'">
2025               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2026             </xsl:if>
2027           </td>
2028         </tr>
2029       </xsl:for-each>
2030     </table>
2031     <!--<h4><a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">Subscribe to a remote calendar</a> (by URI)</h4>-->
2032   </xsl:template>
2033
2034   <!--==== ALARM OPTIONS ====-->
2035   <xsl:template name="alarmOptions">
2036     <form method="get" action="{$setAlarm}" id="standardForm">
2037       <input type="hidden" name="updateAlarmOptions" value="true"/>
2038       <table id="commonTable" cellpadding="0" cellspacing="0">
2039         <tr>
2040           <th colspan="2" id="commonHeader">Alarm options</th>
2041         </tr>
2042         <tr>
2043           <td class="fieldname">
2044             Alarm Date/Time:
2045             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDate/*"/>
2046           </td>
2047           <td class="fieldval">
2048             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmdate/*"/>
2049             <span class="std-text">at  </span>
2050             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmtime/*"/>
2051           </td>
2052         </tr>
2053         <tr>
2054           <td class="fieldname">
2055             or Before/After event:
2056             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDuration/*"/>
2057           </td>
2058           <td align="left">
2059             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/days/*"/>
2060             days
2061             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/hours/*"/>
2062             hours
2063             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/minutes/*"/>
2064             minutes
2065             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/seconds/*"/>
2066             seconds OR:
2067             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/weeks/*"/>
2068             weeks
2069             &#160;
2070             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationBefore/*"/>
2071             before
2072             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationAfter/*"/>
2073             after
2074             &#160;
2075             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelStart/*"/>
2076             start
2077             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelEnd/*"/>
2078             end
2079           </td>
2080         </tr>
2081         <tr>
2082           <td>
2083             <span class="required-field" title="required">*</span>
2084             Email Address:
2085           </td>
2086           <td align="left">
2087             <xsl:copy-of select="/bedework/alarmoptionsform/form/email/*"/>
2088           </td>
2089         </tr>
2090         <tr>
2091           <td>
2092             Subject:
2093           </td>
2094           <td align="left">
2095             <xsl:copy-of select="/bedework/alarmoptionsform/form/subject/*"/>
2096           </td>
2097         </tr>
2098         <tr>
2099           <td>&#160;</td>
2100           <td>
2101             <input name="submit" type="submit" value="Continue"/>&#160;
2102             <input name="cancelled" type="submit" value="Cancel"/>
2103           </td>
2104         </tr>
2105         <tr>
2106           <td class="footnoteCell">
2107             <span style="color:red;">*</span> = required field
2108           </td>
2109         </tr>
2110       </table>
2111     </form>
2112   </xsl:template>
2113
2114   <!--==== UPLOAD ====-->
2115   <xsl:template name="upload">
2116     <form method="post" action="{$upload}" id="standardForm"  enctype="multipart/form-data">
2117       <table id="commonTable" cellpadding="0" cellspacing="0">
2118         <tr>
2119           <tr>
2120             <th colspan="2" id="commonHeader">Upload iCAL File</th>
2121           </tr>
2122           <td class="fieldname">
2123             Filename:
2124           </td>
2125           <td align="left">
2126             <input type="file" name="uploadFile" size="80" />
2127           </td>
2128         </tr>
2129         <tr>
2130           <td>&#160;</td>
2131           <td>
2132             <input name="submit" type="submit" value="Continue"/>&#160;
2133             <input name="cancelled" type="submit" value="Cancel"/>
2134           </td>
2135         </tr>
2136       </table>
2137     </form>
2138   </xsl:template>
2139
2140   <!--==== EMAIL OPTIONS ====-->
2141   <xsl:template name="emailOptions">
2142     <form method="get" action="{$mailEvent}" id="standardForm">
2143       <input type="hidden" name="updateEmailOptions" value="true"/>
2144       <table id="commonTable" cellpadding="0" cellspacing="0">
2145         <tr>
2146           <th colspan="2" id="commonHeader">Update email options</th>
2147         </tr>
2148         <tr>
2149           <td>
2150             <span class="required-field" title="required">*</span>
2151             Email Address:
2152           </td>
2153           <td align="left">
2154             <xsl:copy-of select="/bedework/emailoptionsform/form/email/*"/>
2155           </td>
2156         </tr>
2157         <tr>
2158           <td>
2159             Subject:
2160           </td>
2161           <td align="left">
2162             <xsl:copy-of select="/bedework/emailoptionsform/form/subject/*"/>
2163           </td>
2164         </tr>
2165         <tr>
2166           <td>&#160;</td>
2167           <td>
2168             <input name="submit" type="submit" value="Continue"/>&#160;
2169             <input name="cancelled" type="submit" value="Cancel"/>
2170           </td>
2171         </tr>
2172         <tr>
2173           <td class="footnoteCell">
2174             <span style="color:red;">*</span> = required field
2175           </td>
2176         </tr>
2177       </table>
2178     </form>
2179   </xsl:template>
2180
2181   <!--==== MANAGE LOCATIONS ====-->
2182   <xsl:template name="manageLocations">
2183     <form name="addLocationForm" method="post" action="{$addLocation}" id="standardForm">
2184       <input type="hidden" name="confirmationid" value="{$confId}"/>
2185       <table border="0" id="commonTable">
2186         <colgroup>
2187           <col span="1" class="fieldname"/>
2188           <col span="1" class="fieldval"/>
2189        </colgroup>
2190         <tr>
2191           <th colspan="2" id="commonHeader">Manage Locations</th>
2192         </tr>
2193         <tr>
2194           <th colspan="2" class="form-header">Add Location</th>
2195         </tr>
2196         <tr>
2197           <td>
2198             Main Address:
2199           </td>
2200           <td>
2201             <input size="60" name="newLocation.address" type="text"/>
2202           </td>
2203         </tr>
2204         <tr>
2205           <td>
2206             Subaddress:
2207           </td>
2208           <td>
2209             <input size="60" name="newLocation.subaddress" type="text"/>
2210           </td>
2211         </tr>
2212         <tr>
2213           <td>
2214             Location Link:
2215           </td>
2216           <td>
2217             <input size="60" name="newLocation.link" type="text"/>
2218           </td>
2219         </tr>
2220         <tr>
2221           <td colspan="2" class="plain">
2222             <input name="submit" type="submit" value="Submit Location"/>&#160;
2223             <input name="cancelled" type="submit" value="Cancel"/>
2224           </td>
2225         </tr>
2226         <tr>
2227           <th colspan="2" class="form-header">Edit/Delete Locations</th>
2228         </tr>
2229         <td colspan="2" class="plain">
2230           <ul>
2231             <xsl:for-each select="/bedework/eventform/form/location/locationmenu/select/option[@value>'3']">
2232               <xsl:sort select="."/>
2233               <li>
2234                 <xsl:variable name="locationId" select="@value"/>
2235                 <a href="{$editLocation}?locationId={$locationId}"><xsl:value-of select="."/></a>
2236               </li>
2237             </xsl:for-each>
2238           </ul>
2239         </td>
2240       </table>
2241     </form>
2242   </xsl:template>
2243
2244   <!--==== EDIT LOCATION ====-->
2245   <xsl:template match="locationform">
2246     <form name="editLocationForm" method="post" action="{$editLocation}" id="standardForm">
2247       <input type="hidden" name="updateLocation" value="true"/>
2248       <input type="hidden" name="confirmationid" value="{$confId}"/>
2249       <table id="commonTable" cellpadding="0" cellspacing="0">
2250         <tr>
2251           <th colspan="2" id="commonHeader">
2252             <xsl:variable name="locId" select="/bedework/locationform/form/id"/>
2253             <div id="eventActions">
2254               <a href="{$delLocation}?locationId={$locId}">Delete Location</a>
2255             </div>
2256             Edit Location
2257           </th>
2258         </tr>
2259         <tr>
2260           <td>
2261             <span class="required-field" title="required">*</span>
2262             Address:
2263           </td>
2264           <td align="left">
2265             <xsl:copy-of select="/bedework/locationform/form/address/*"/>
2266           </td>
2267         </tr>
2268         <tr>
2269           <td>
2270             Subaddress:
2271           </td>
2272           <td align="left">
2273             <xsl:copy-of select="/bedework/locationform/form/subaddress/*"/>
2274           </td>
2275         </tr>
2276         <tr>
2277           <td>Location's URL:</td>
2278           <td>
2279             <xsl:copy-of select="/bedework/locationform/form/link/*"/>
2280           </td>
2281         </tr>
2282         <tr>
2283           <td>&#160;</td>
2284           <td>
2285             <input name="submit" type="submit" value="Submit Location"/>&#160;
2286             <input name="cancelled" type="submit" value="Cancel"/>
2287           </td>
2288         </tr>
2289         <tr>
2290           <td class="footnoteCell">
2291             <span style="color:red;">*</span> = required field
2292           </td>
2293         </tr>
2294       </table>
2295     </form>
2296   </xsl:template>
2297
2298   <!--==== SIDE CALENDAR MENU ====-->
2299   <xsl:template match="calendar" mode="sideList">
2300     <xsl:variable name="id" select="id"/>
2301     <div class="std-text">
2302       <a href="{$setSelection}?calId={$id}"><xsl:value-of select="title"/></a>
2303     </div>
2304   </xsl:template>
2305
2306   <!--==== STAND-ALONE PAGES ====-->
2307   <!-- not currently in use -->
2308   <xsl:template name="selectPage">
2309     <!-- <xsl:choose>
2310       <xsl:when test="/bedework/appvar[key='page']">
2311         <xsl:choose>
2312           <xsl:otherwise>
2313             <xsl:call-template name="noPage"/>
2314           </xsl:otherwise>
2315         </xsl:choose>
2316       </xsl:when>
2317       <xsl:otherwise> -->
2318         <xsl:call-template name="noPage"/>
2319       <!--</xsl:otherwise>
2320     </xsl:choose>-->
2321   </xsl:template>
2322
2323   <xsl:template name="noPage">
2324     <p>
2325       Error: there is no page with that name.  Please select a navigational
2326       link to continue.
2327     </p>
2328   </xsl:template>
2329
2330   <!--==== FOOTER ====-->
2331   <xsl:template name="footer">
2332     <div id="footer">
2333       Demonstration calendar; place footer information here.
2334     </div>
2335     <table id="skinSelectorTable" border="0" cellpadding="0" cellspacing="0">
2336       <tr>
2337         <td class="leftCell">
2338           <a href="http://www.bedework.org/">Bedework Calendar</a> |
2339           <a href="/ucal/showMain.rdo?refreshXslt=yes">refresh XSLT</a>
2340         </td>
2341         <td class="rightCell">
2342           <!--<form name="skinSelectForm" method="get" action="{$setup}">
2343             skin selector:
2344             <select name="skinNameSticky" onChange="submit()">
2345               <option>select a skin</option>
2346               <option value="default">Demo Calendar</option>
2347               <option value="rensselaer">Rensselaer</option>
2348               <option value="washington">Washington</option>
2349             </select>
2350           </form>-->
2351         </td>
2352       </tr>
2353     </table>
2354   </xsl:template>
2355 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.