root/releases/bedework-3.8/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/calendars.xsl

Revision 3402 (checked in by johnsa, 1 year ago)

web clients: fill in the calendar summary field from the calendar name field if the summary is empty.

Line 
1 <!--
2     Licensed to Jasig under one or more contributor license
3     agreements. See the NOTICE file distributed with this work
4     for additional information regarding copyright ownership.
5     Jasig licenses this file to you under the Apache License,
6     Version 2.0 (the "License"); you may not use this file
7     except in compliance with the License. You may obtain a
8     copy of the License at:
9    
10     http://www.apache.org/licenses/LICENSE-2.0
11    
12     Unless required by applicable law or agreed to in writing,
13     software distributed under the License is distributed on
14     an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15     KIND, either express or implied. See the License for the
16     specific language governing permissions and limitations
17     under the License.
18 -->
19 <xsl:stylesheet
20   version="1.0"
21   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
22   xmlns="http://www.w3.org/1999/xhtml">
23  
24  
25   <!--+++++++++++++++ Calendars ++++++++++++++++++++-->
26
27   <!--
28     Calendar templates depend heavily on calendar types:
29
30     calTypes: 0 - Folder
31               1 - Calendar
32               2 - Trash
33               3 - Deleted
34               4 - Busy
35               5 - Inbox
36               6 - Outbox
37               7 - Alias (internal - the underlying calType will be returned; check for the isSubscription property)
38               8 - External subscription (internal - the underlying calType will be returned; check for the isSubscription property and check on the item's status)
39               9 - Resource collection
40   -->
41
42   <xsl:template match="calendars" mode="manageCalendars">
43     <h2><xsl:copy-of select="$bwStr-Cals-ManageCalendarsSubscriptions"/></h2>
44     <table id="calendarTable">
45       <tr>
46         <td class="cals">
47           <h3><xsl:copy-of select="$bwStr-Cals-Calendars"/></h3>
48           <ul class="calendarTree">
49             <xsl:choose>
50               <xsl:when test="/bedework/page='calendarDescriptions' or
51                               /bedework/page='displayCalendar'">
52                 <xsl:apply-templates select="calendar[number(calType) &lt; 2 or number(calType) = 4 or number(calType) &gt; 6]" mode="listForDisplay"/>
53               </xsl:when>
54               <xsl:otherwise>
55                 <xsl:apply-templates select="calendar" mode="listForUpdate"/>
56               </xsl:otherwise>
57             </xsl:choose>
58           </ul>
59         </td>
60         <td class="calendarContent">
61           <xsl:choose>
62             <xsl:when test="/bedework/page='calendarList' or
63                             /bedework/page='calendarReferenced'">
64               <xsl:call-template name="calendarList"/>
65             </xsl:when>
66             <xsl:when test="/bedework/page='calendarDescriptions'">
67               <xsl:call-template name="calendarDescriptions"/>
68             </xsl:when>
69             <xsl:when test="/bedework/page='displayCalendar'">
70               <xsl:apply-templates select="/bedework/currentCalendar" mode="displayCalendar"/>
71             </xsl:when>
72             <xsl:when test="/bedework/page='deleteCalendarConfirm'">
73               <xsl:apply-templates select="/bedework/currentCalendar" mode="deleteCalendarConfirm"/>
74             </xsl:when>
75             <xsl:when test="/bedework/creating='true'">
76               <xsl:apply-templates select="/bedework/currentCalendar" mode="addCalendar"/>
77             </xsl:when>
78             <xsl:otherwise>
79               <xsl:apply-templates select="/bedework/currentCalendar" mode="modCalendar"/>
80             </xsl:otherwise>
81           </xsl:choose>
82         </td>
83       </tr>
84     </table>
85   </xsl:template>
86
87   <xsl:template match="calendar" mode="myCalendars">
88     <!-- this template receives calType 0,1,4,7,8,9  -->
89     <xsl:variable name="id" select="id"/>
90     <xsl:variable name="userRootCalendar">/user/<xsl:value-of select="/bedework/userid"/></xsl:variable>
91     <li>
92       <xsl:attribute name="class">
93         <xsl:choose>
94           <xsl:when test="disabled = 'true'">unknown</xsl:when>
95           <xsl:when test="lastRefreshStatus &gt; 300">unknown</xsl:when>
96           <xsl:when test="not(path = $userRootCalendar)
97                           and /bedework/selectionState/selectionType = 'collections'
98                           and path = /bedework/selectionState/collection/virtualpath">selected</xsl:when>
99           <xsl:when test="isSubscription = 'true'">
100             <xsl:choose>
101               <xsl:when test="calType = '0'">aliasFolder</xsl:when>
102               <xsl:otherwise>alias</xsl:otherwise>
103             </xsl:choose>
104           </xsl:when>
105           <xsl:when test="calType = '0'">folder</xsl:when>
106           <xsl:otherwise>calendar</xsl:otherwise>
107         </xsl:choose>
108       </xsl:attribute>
109       <xsl:if test="currentAccess/current-user-privilege-set/privilege/write-content">
110         <form name="bwHideDisplayCal" class="bwHideDisplayCal" method="post">
111           <xsl:attribute name="action">
112             <xsl:choose>
113               <xsl:when test="/bedework/page = 'eventList'"><xsl:value-of select="$calendar-setPropsInList"/></xsl:when>
114               <xsl:otherwise><xsl:value-of select="$calendar-setPropsInGrid"/></xsl:otherwise>
115             </xsl:choose>
116           </xsl:attribute>
117           <input type="hidden" name="calPath">
118             <xsl:attribute name="value"><xsl:value-of select="path"/></xsl:attribute>
119           </input>
120           <xsl:choose>
121             <xsl:when test="display = 'true'">
122               <!-- set the value of display to false so that when the form is submitted we toggle
123 -->
124               <input type="hidden" name="display" value="false"/>
125               <input type="checkbox" name="bwDisplaySetter" checked="checked"  onclick="this.form.submit()">
126                 <xsl:if test="(/bedework/page != 'eventscalendar' and
127                                /bedework/page != 'eventList') or
128                                $userRootCalendar = path"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if>
129               </input>
130             </xsl:when>
131             <xsl:otherwise>
132               <!-- set the value of display to true so that when the form is submitted we toggle
133 -->
134               <input type="hidden" name="display" value="true"/>
135               <input type="checkbox" name="bwDisplaySetter" onclick="this.form.submit()">
136                 <xsl:if test="(/bedework/page != 'eventscalendar' and
137                                /bedework/page != 'eventList') or
138                                $userRootCalendar = path"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if>
139               </input>
140             </xsl:otherwise>
141           </xsl:choose>
142         </form>
143         <xsl:text> </xsl:text>
144       </xsl:if>
145       <xsl:variable name="virtualPath"><xsl:call-template name="url-encode"><xsl:with-param name="str">/user<xsl:for-each select="ancestor-or-self::calendar/name">/<xsl:value-of select="."/></xsl:for-each></xsl:with-param></xsl:call-template></xsl:variable>
146       <xsl:variable name="calPath" select="encodedPath"/>
147       <a href="{$setSelection}&amp;virtualPath={$virtualPath}&amp;calUrl={$calPath}">
148         <xsl:if test="lastRefreshStatus &gt;= 300">
149           <xsl:attribute name="title">
150             <xsl:call-template name="httpStatusCodes">
151               <xsl:with-param name="code"><xsl:value-of  select="lastRefreshStatus"/></xsl:with-param>
152             </xsl:call-template>
153           </xsl:attribute>
154         </xsl:if>
155         <xsl:value-of select="summary"/>
156       </a>
157       <xsl:if test="color != '' and color != 'null'">
158         <!-- the spacer gif approach allows us to avoid some IE misbehavior -->
159         <xsl:variable name="color" select="color"/>
160         <img src="{$resourcesRoot}/images/spacer.gif" width="6" height="6" alt="calendar color" class="bwCalendarColor" style="background-color: {$color}; color:black;"/>
161       </xsl:if>
162       <xsl:if test="calendar">
163         <ul>
164           <xsl:apply-templates select="calendar[canAlias = 'true']" mode="myCalendars">
165             <xsl:sort select="summary" order="ascending" case-order="upper-first"/>
166           </xsl:apply-templates>
167         </ul>
168       </xsl:if>
169     </li>
170   </xsl:template>
171
172   <xsl:template match="calendar" mode="mySpecialCalendars">
173     <!-- this template receives calType 2,3,5,6  -->
174     <xsl:variable name="id" select="id"/>
175     <li>
176       <xsl:attribute name="class">
177         <xsl:choose>
178           <xsl:when test="/bedework/selectionState/selectionType = 'collections'
179                           and path = /bedework/selectionState/subscriptions/subscription/calendar/path">selected</xsl:when>
180           <xsl:when test="calType='2' or calType='3'">trash</xsl:when>
181           <xsl:when test="calType='5'">inbox</xsl:when>
182           <xsl:when test="calType='6'">outbox</xsl:when>
183           <xsl:when test="calType='0'">folder</xsl:when>
184           <xsl:otherwise>calendar</xsl:otherwise>
185         </xsl:choose>
186       </xsl:attribute>
187       <xsl:variable name="calPath" select="encodedPath"/>
188       <xsl:choose>
189         <xsl:when test="calType='5'">
190           <a href="{$showInbox}" title="{$bwStr-Cals-IncomingSchedulingRequests}">
191             <xsl:value-of select="summary"/>
192           </a>
193           <xsl:text> </xsl:text>
194           <xsl:if test="/bedework/inboxState/numActive != '0'">
195             <span class="inoutboxActive">(<xsl:value-of select="/bedework/inboxState/numActive"/>)</span>
196           </xsl:if>
197         </xsl:when>
198         <xsl:when test="calType='6'">
199           <a href="{$showOutbox}" title="{$bwStr-Cals-OutgoingSchedulingRequests}">
200             <xsl:value-of select="summary"/>
201           </a>
202           <xsl:text> </xsl:text>
203           <xsl:if test="/bedework/outboxState/numActive != '0'">
204             <span class="inoutboxActive">(<xsl:value-of select="/bedework/outboxState/numActive"/>)</span>
205           </xsl:if>
206         </xsl:when>
207         <xsl:otherwise>
208           <xsl:variable name="virtualPath"><xsl:call-template name="url-encode"><xsl:with-param name="str">/user<xsl:for-each select="ancestor-or-self::calendar/name">/<xsl:value-of select="."/></xsl:for-each></xsl:with-param></xsl:call-template></xsl:variable>
209           <a href="{$setSelection}&amp;virtualPath={$virtualPath}&amp;calUrl={$calPath}">
210             <xsl:attribute name="title">
211               <xsl:choose>
212                 <xsl:when test="calType = 2">Contains items you have access to delete.</xsl:when>
213                 <xsl:when test="calType = 3">Used to mask items you do not have access to truly delete, such as many subscribed events.</xsl:when>
214               </xsl:choose>
215             </xsl:attribute>
216             <xsl:value-of select="summary"/>
217           </a>
218         </xsl:otherwise>
219       </xsl:choose>
220       <xsl:if test="calendar">
221         <ul>
222           <xsl:apply-templates select="calendar" mode="myCalendars"/>
223         </ul>
224       </xsl:if>
225     </li>
226   </xsl:template>
227
228   <xsl:template match="calendar" mode="listForUpdate">
229     <!-- this template receives all calTypes -->
230     <xsl:variable name="calPath" select="encodedPath"/>
231     <li>
232       <xsl:attribute name="class">
233         <xsl:choose>
234           <xsl:when test="disabled = 'true'">unknown</xsl:when>
235           <xsl:when test="lastRefreshStatus &gt;= 300">unknown</xsl:when>
236           <xsl:when test="isSubscription = 'true'">
237             <xsl:choose>
238               <xsl:when test="calType = '0'">aliasFolder</xsl:when>
239               <xsl:otherwise>alias</xsl:otherwise>
240             </xsl:choose>
241           </xsl:when>
242           <xsl:when test="calType = '0'">folder</xsl:when>
243           <xsl:when test="calType='2' or calType='3'">trash</xsl:when>
244           <xsl:when test="calType='5'">inbox</xsl:when>
245           <xsl:when test="calType='6'">outbox</xsl:when>
246           <xsl:otherwise>calendar</xsl:otherwise>
247         </xsl:choose>
248       </xsl:attribute>
249       <a href="{$calendar-fetchForUpdate}&amp;calPath={$calPath}" title="{$bwStr-Cals-Update}">
250         <xsl:value-of select="summary"/>
251       </a>
252       <xsl:if test="calType = '0' and isSubscription = 'false'">
253         <xsl:text> </xsl:text>
254         <a href="{$calendar-initAdd}&amp;calPath={$calPath}" title="{$bwStr-Cals-AddCalendarOrFolder}">
255           <img src="{$resourcesRoot}/images/calAddIcon.gif" width="13" height="13" alt="add a calendar or folder" border="0"/>
256         </a>
257       </xsl:if>
258       <xsl:if test="calendar and isSubscription='false'">
259         <ul>
260           <xsl:apply-templates select="calendar" mode="listForUpdate">
261             <xsl:sort select="summary" order="ascending" case-order="upper-first"/>
262           </xsl:apply-templates>
263         </ul>
264       </xsl:if>
265     </li>
266   </xsl:template>
267
268   <xsl:template match="calendar" mode="listForDisplay">
269     <!-- this template receives calType 0,1,4,7,8,9 -->
270     <xsl:variable name="calPath" select="encodedPath"/>
271     <li>
272       <xsl:attribute name="class">
273         <xsl:choose>
274           <xsl:when test="isSubscription = 'true'">alias</xsl:when>
275           <xsl:when test="calType = '0'">folder</xsl:when>
276           <xsl:otherwise>calendar</xsl:otherwise>
277         </xsl:choose>
278       </xsl:attribute>
279       <a href="{$calendar-fetchForDisplay}&amp;calPath={$calPath}" title="{$bwStr-Cals-Display}">
280         <xsl:value-of select="summary"/>
281       </a>
282       <xsl:if test="calendar">
283         <ul>
284           <xsl:apply-templates select="calendar[number(calType) &lt; 2 or number(calType) = 4 or number(calType) &gt; 6]" mode="listForDisplay">
285             <xsl:sort select="summary" order="ascending" case-order="upper-first"/>
286           </xsl:apply-templates>
287         </ul>
288       </xsl:if>
289     </li>
290   </xsl:template>
291
292   <xsl:template name="selectCalForEvent">
293   <!-- selectCalForEvent creates a calendar tree in a pop-up window.
294       Used when selecting a calendar while adding or editing an event.
295
296       This template will be called when
297       a) we add an event by date with no specific calendar selected
298       b) we import an event
299       c) we add an event ref
300       d) we edit an event and change it's calendar (or change it while adding)
301
302       The intention is to load the calendar listing in a "pop-up" widget as a
303       tree of myCalendars and writable calendars associated with subscriptions.
304       The xml for the tree is already in header.jsp in myCalendars and
305       mySubscriptions.
306        -->
307     <input type="button" onclick="javascript:changeClass('calSelectWidget','visible')" value="select calendar" class="small"/>
308     <div id="calSelectWidget" class="invisible">
309       <h2><xsl:copy-of select="$bwStr-SCfE-SelectACalendar"/></h2>
310       <a href="javascript:changeClass('calSelectWidget','invisible')" id="calSelectWidgetCloser" title="{$bwStr-SCfE-Close}">x</a>
311       <ul class="calendarTree">
312         <xsl:choose>
313           <xsl:when test="/bedework/formElements/form/calendars/select/option">
314             <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar" mode="selectCalForEventCalTree">
315               <xsl:sort select="summary" order="ascending" case-order="upper-first"/>
316             </xsl:apply-templates>
317           </xsl:when>
318           <xsl:otherwise>
319             <li><em><xsl:copy-of select="$bwStr-SCfE-NoWritableCals"/></em></li>
320           </xsl:otherwise>
321         </xsl:choose>
322       </ul>
323     </div>
324   </xsl:template>
325
326   <xsl:template match="calendar" mode="selectCalForEventCalTree">
327     <xsl:variable name="id" select="id"/>
328     <li>
329       <xsl:attribute name="class">
330         <xsl:choose>
331           <xsl:when test="/bedework/selectionState/selectionType = 'calendar'
332                           and name = /bedework/selectionState/subscriptions/subscription/calendar/name">selected</xsl:when>
333           <xsl:when test="isSubscription = 'true'">alias</xsl:when>
334           <xsl:when test="name='Trash'">trash</xsl:when>
335           <xsl:when test="calType = '0'">folder</xsl:when>
336           <xsl:otherwise>calendar</xsl:otherwise>
337         </xsl:choose>
338       </xsl:attribute>
339       <xsl:variable name="calPath" select="path"/>
340       <xsl:variable name="calDisplay" select="summary"/>
341       <xsl:choose>
342         <xsl:when test="path = /bedework/formElements/form/calendars/select//option/@value and (calType != '0')">
343           <a href="javascript:updateEventFormCalendar('{$calPath}','{$calDisplay}')">
344             <strong><xsl:value-of select="summary"/></strong>
345           </a>
346         </xsl:when>
347         <xsl:otherwise>
348           <xsl:value-of select="summary"/>
349         </xsl:otherwise>
350       </xsl:choose>
351       <xsl:if test="calendar">
352         <ul>
353           <xsl:apply-templates select="calendar[calType &lt; 2]" mode="selectCalForEventCalTree">
354             <xsl:sort select="summary" order="ascending" case-order="upper-first"/>
355           </xsl:apply-templates>
356         </ul>
357       </xsl:if>
358     </li>
359   </xsl:template>
360
361   <xsl:template name="selectCalForPublicAlias">
362   <!-- This template is DEPRECATED ... selectCalForPublicAliasCalTree is now used instead.
363 -->
364   <!-- selectCalForPublicAlias creates a calendar tree pop-up window for
365        selecting a public calendar subscription (alias).
366 -->
367
368     <input type="button" onclick="javascript:changeClass('calSelectWidget','visible')" value="select calendar" class="small"/>
369     <div id="calSelectWidget" class="invisible">
370       <h2><xsl:copy-of select="$bwStr-SCPA-SelectACalendar"/></h2>
371       <a href="javascript:changeClass('calSelectWidget','invisible')" id="calSelectWidgetCloser" title="{$bwStr-SCPA-Close}">x</a>
372       <ul class="calendarTree">
373         <xsl:apply-templates select="/bedework/publicCalendars/calendar" mode="selectCalForPublicAliasCalTree"/>
374       </ul>
375       <!-- Uncomment the following to use a three column format
376       <xsl:variable name="topCalsCount" select="count(/bedework/calendars/calendar/calendar)"/>
377       <xsl:variable name="topCalsDivThree" select="floor($topCalsCount div 3)"/>
378       <xsl:variable name="topCalsTopSet" select="number($topCalsCount - $topCalsDivThree)"/>
379       <ul class="calendarTree left">
380         <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true' and (position() &lt;= $topCalsDivThree)]" mode="selectCalForPublicAliasCalTree"/>
381       </ul>
382       <ul class="calendarTree left">
383         <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true' and (position() &gt; $topCalsDivThree) and (position() &lt;= $topCalsTopSet)]" mode="selectCalForPublicAliasCalTree"/>
384       </ul>
385       <ul class="calendarTree left">
386         <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true' and (position() &gt; $topCalsTopSet)]" mode="selectCalForPublicAliasCalTree"/>
387       </ul>
388       -->
389     </div>
390   </xsl:template>
391
392   <xsl:template match="calendar" mode="selectCalForPublicAliasCalTree">
393     <xsl:variable name="id" select="id"/>
394     <li>
395       <xsl:attribute name="class">
396         <xsl:choose>
397           <xsl:when test="name='Trash'">trash</xsl:when>
398           <xsl:when test="isSubscription = 'true'">alias</xsl:when>
399           <xsl:when test="calType = '0'">folder</xsl:when>
400           <xsl:otherwise>calendar</xsl:otherwise>
401         </xsl:choose>
402       </xsl:attribute>
403       <xsl:variable name="calPath" select="path"/>
404       <xsl:variable name="calDisplay" select="path"/>
405       <xsl:variable name="calendarCollection" select="calendarCollection"/>
406       <xsl:choose>
407         <xsl:when test="canAlias = 'true'">
408           <a href="javascript:updatePublicCalendarAlias('{$calPath}','{$calDisplay}','{$calendarCollection}')">
409             <xsl:value-of select="summary"/>
410           </a>
411         </xsl:when>
412         <xsl:otherwise>
413           <xsl:value-of select="summary"/>
414         </xsl:otherwise>
415       </xsl:choose>
416       <xsl:if test="calendar">
417         <ul>
418           <xsl:apply-templates select="calendar" mode="selectCalForPublicAliasCalTree"/>
419         </ul>
420       </xsl:if>
421     </li>
422   </xsl:template>
423
424   <xsl:template match="currentCalendar" mode="addCalendar">
425     <h3><xsl:copy-of select="$bwStr-CuCa-AddCalFolderOrSubscription"/></h3>
426     <form name="addCalForm" method="post" action="{$calendar-update}" onsubmit="return setCalendarAlias(this)">
427       <table class="common">
428         <tr>
429           <th><xsl:copy-of select="$bwStr-CuCa-Name"/></th>
430           <td>
431             <xsl:variable name="curCalName" select="name"/>
432             <input name="calendar.name" value="{$curCalName}" onblur="setCalSummary(this.value, this.form['calendar.summary']);" size="40"/>
433           </td>
434         </tr>
435         <tr>
436           <th><xsl:copy-of select="$bwStr-CuCa-Summary"/></th>
437           <td>
438             <xsl:variable name="curCalSummary" select="summary"/>
439             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
440           </td>
441         </tr>
442         <tr>
443           <th><xsl:copy-of select="$bwStr-CuCa-Description"/></th>
444           <td>
445             <textarea name="calendar.description" cols="30" rows="4">
446               <xsl:value-of select="desc"/>
447               <xsl:if test="normalize-space(desc) = ''">
448                 <xsl:text> </xsl:text>
449                 <!-- keep this non-breaking space to avoid browser
450                 rendering errors when the text area is empty -->
451               </xsl:if>
452             </textarea>
453           </td>
454         </tr>
455         <tr id="bwColorField">
456           <th><xsl:copy-of select="$bwStr-CuCa-Color"/></th>
457           <td>
458             <input type="text" name="calendar.color" id="bwCalColor" value="" size="7"/>
459             <xsl:call-template name="colorPicker">
460               <xsl:with-param name="colorFieldId">bwCalColor</xsl:with-param>
461             </xsl:call-template>
462           </td>
463         </tr>
464         <tr>
465           <th><xsl:copy-of select="$bwStr-CuCa-Display"/></th>
466           <td>
467             <input type="hidden" name="calendar.display">
468               <xsl:attribute name="value"><xsl:value-of select="display"/></xsl:attribute>
469             </input>
470             <input type="checkbox" name="displayHolder" size="40" onclick="setCalDisplayFlag(this.form['calendar.display'],this.checked);">
471               <xsl:if test="display = 'true'">
472                 <xsl:attribute name="checked">checked</xsl:attribute>
473               </xsl:if>
474             </input><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-CuCa-DisplayItemsInThisCollection"/>
475           </td>
476         </tr>
477         <tr>
478           <th><xsl:copy-of select="$bwStr-CuCa-FilterExpression"/></th>
479           <td>
480             <input type="text" name="fexpr" value="" size="40"/>
481           </td>
482         </tr>
483         <tr>
484           <th><xsl:copy-of select="$bwStr-CuCa-Type"/></th>
485           <td>
486             <!-- we will set the value of "calendarCollection on submit.
487                  Value is false only for folders, so we default it to true here.  -->
488             <input type="hidden" value="true" name="calendarCollection"/>
489             <!-- type is defaulted to calendar.  It is changed when a typeSwitch is clicked. -->
490             <input type="hidden" value="calendar" name="type" id="bwCalType"/>
491             <input type="radio" value="calendar" name="typeSwitch" checked="checked" onclick="changeClass('subscriptionTypes','invisible');setField('bwCalType',this.value);"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-CuCa-Calendar"/>
492             <input type="radio" value="folder" name="typeSwitch" onclick="changeClass('subscriptionTypes','invisible');setField('bwCalType',this.value);"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-CuCa-Folder"/>
493             <input type="radio" value="subscription" name="typeSwitch" onclick="changeClass('subscriptionTypes','visible');setField('bwCalType',this.value);"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-CuCa-Subscription"/>
494           </td>
495         </tr>
496       </table>
497       <div id="subscriptionTypes" class="invisible">
498         <!-- If we are making a subscription, we will set the hidden value of "aliasUri" based
499              on the subscription type. -->
500         <input type="hidden" name="aliasUri" value=""/>
501         <p>
502           <strong><xsl:copy-of select="$bwStr-CuCa-SubscriptionType"/></strong><br/>
503           <!-- subType is defaulted to public.  It is changed when a subTypeSwitch is clicked. -->
504           <input type="hidden" value="public" name="subType" id="bwSubType"/>
505           <input type="radio" name="subTypeSwitch" value="public" checked="checked" onclick="changeClass('subscriptionTypePublic','visible');changeClass('subscriptionTypeExternal','invisible');changeClass('subscriptionTypeUser','invisible');setField('bwSubType',this.value);"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-CuCa-PublicCalendar"/>
506           <input type="radio" name="subTypeSwitch" value="user" onclick="changeClass('subscriptionTypePublic','invisible');changeClass('subscriptionTypeExternal','invisible');changeClass('subscriptionTypeUser','visible');setField('bwSubType',this.value);"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-CuCa-UserCalendar"/>
507           <input type="radio" name="subTypeSwitch" value="external" onclick="changeClass('subscriptionTypePublic','invisible');changeClass('subscriptionTypeExternal','visible');changeClass('subscriptionTypeUser','invisible');setField('bwSubType',this.value);"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-CuCa-URL"/>
508         </p>
509
510         <div id="subscriptionTypePublic">
511           <input type="hidden" value="" name="publicAliasHolder" id="publicAliasHolder"/>
512           <div id="bwPublicCalDisplay">
513             <button type="button" onclick="showPublicCalAliasTree();"><xsl:copy-of select="$bwStr-CuCa-SelectAPublicCalOrFolder"/></button>
514           </div>
515           <ul id="publicSubscriptionTree" class="invisible">
516             <xsl:apply-templates select="/bedework/publicCalendars/calendar" mode="selectCalForPublicAliasCalTree"/>
517           </ul>
518         </div>
519
520         <div id="subscriptionTypeUser" class="invisible">
521           <table class="common">
522             <tr>
523               <th><xsl:copy-of select="$bwStr-CuCa-UsersID"/></th>
524               <td>
525                 <input type="text" name="userIdHolder" value="" size="40"/>
526               </td>
527             </tr>
528             <tr>
529               <th><xsl:copy-of select="$bwStr-CuCa-CalendarPath"/></th>
530               <td>
531                 <input type="text" name="userCalHolder" value="calendar" size="40"/><br/>
532                 <span class="note"><xsl:copy-of select="$bwStr-CuCa-DefaultCalendarOrSomeCalendar"/></span>
533               </td>
534             </tr>
535           </table>
536         </div>
537
538
539         <div class="invisible" id="subscriptionTypeExternal">
540           <table class="common">
541             <tr>
542               <th><xsl:copy-of select="$bwStr-CuCa-URLToCalendar"/></th>
543               <td>
544                 <input type="text" name="aliasUriHolder" id="aliasUriHolder" value="" size="40"/>
545               </td>
546             </tr>
547             <tr>
548               <th><xsl:copy-of select="$bwStr-CuCa-ID"/></th>
549               <td>
550                 <input type="text" name="remoteId" value="" size="40"/>
551               </td>
552             </tr>
553             <tr>
554               <th><xsl:copy-of select="$bwStr-CuCa-Password"/></th>
555               <td>
556                 <input type="password" name="remotePw" value="" size="40"/>
557               </td>
558             </tr>
559           </table>
560         </div>
561       </div>
562       <div class="submitButtons">
563         <input type="submit" name="addCalendar" value="{$bwStr-CuCa-Add}"/>
564         <input type="submit" name="cancelled" value="{$bwStr-CuCa-Cancel}"/>
565       </div>
566     </form>
567
568     <div id="sharingBox">
569       <h3><xsl:copy-of select="$bwStr-CuCa-CurrentAccess"/></h3>
570       <xsl:copy-of select="$bwStr-CuCa-SharingMayBeAdded"/>
571     </div>
572   </xsl:template>
573
574   <xsl:template match="currentCalendar" mode="modCalendar">
575     <xsl:variable name="calPath" select="path"/>
576     <xsl:variable name="calPathEncoded" select="encodedPath"/>
577
578     <form name="modCalForm" method="post" action="{$calendar-update}">
579       <xsl:choose>
580         <xsl:when test="isSubscription='true'">
581           <h3><xsl:copy-of select="$bwStr-CuCa-ModifySubscription"/></h3>
582           <input type="hidden" value="true" name="calendarCollection"/>
583         </xsl:when>
584         <xsl:when test="calType = '0'">
585           <h3><xsl:copy-of select="$bwStr-CuCa-ModifyFolder"/></h3>
586           <input type="hidden" value="false" name="calendarCollection"/>
587         </xsl:when>
588         <xsl:otherwise>
589           <h3><xsl:copy-of select="$bwStr-CuCa-ModifyCalendar"/></h3>
590           <input type="hidden" value="true" name="calendarCollection"/>
591         </xsl:otherwise>
592       </xsl:choose>
593
594       <table border="0" id="submitTable">
595         <tr>
596           <td>
597             <xsl:choose>
598               <xsl:when test="isSubscription='true'">
599                 <input type="submit" name="updateCalendar" value="{$bwStr-CuCa-UpdateSubscription}"/>
600               </xsl:when>
601               <xsl:when test="calType = '0'">
602                 <input type="submit" name="updateCalendar" value="{$bwStr-CuCa-UpdateFolder}"/>
603               </xsl:when>
604               <xsl:otherwise>
605                 <input type="submit" name="updateCalendar" value="{$bwStr-CuCa-UpdateCalendar}"/>
606               </xsl:otherwise>
607             </xsl:choose>
608             <input type="submit" name="cancelled" value="{$bwStr-CuCa-Cancel}"/>
609           </td>
610           <td align="right">
611             <xsl:if test="calType != '3' and calType != '5' and calType != '6'">
612               <xsl:choose>
613                 <xsl:when test="isSubscription='true'">
614                   <input type="submit" name="delete" value="{$bwStr-CuCa-DeleteSubscription}"/>
615                 </xsl:when>
616                 <xsl:when test="calType = '0'">
617                   <input type="submit" name="delete" value="{$bwStr-CuCa-DeleteFolder}"/>
618                 </xsl:when>
619                 <xsl:otherwise>
620                   <input type="submit" name="delete" value="{$bwStr-CuCa-DeleteCalendar}"/>
621                 </xsl:otherwise>
622               </xsl:choose>
623             </xsl:if>
624           </td>
625         </tr>
626       </table>
627
628       <table class="common">
629         <tr>
630           <th class="commonHeader" colspan="2">
631             <xsl:value-of select="path"/>
632           </th>
633         </tr>
634         <xsl:if test="lastRefreshStatus &gt;= 300">
635           <tr class="httpStatusMsg">
636             <th><xsl:copy-of select="$bwStr-CuCa-HttpStatus"/></th>
637             <td>
638               <xsl:call-template name="httpStatusCodes">
639                 <xsl:with-param name="code"><xsl:value-of  select="lastRefreshStatus"/></xsl:with-param>
640               </xsl:call-template>
641             </td>
642           </tr>
643         </xsl:if>
644         <tr>
645           <th><xsl:copy-of select="$bwStr-CuCa-Name"/></th>
646           <td>
647             <xsl:value-of select="name"/>
648           </td>
649         </tr>
650         <!-- tr>
651           <th>Mailing List ID:</th>
652           <td>
653             <xsl:value-of select="mailListId"/>
654           </td>
655         </tr -->
656         <tr>
657           <th><xsl:copy-of select="$bwStr-CuCa-Summary"/></th>
658           <td>
659             <xsl:variable name="curCalSummary" select="summary"/>
660             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
661           </td>
662         </tr>
663         <tr>
664           <th><xsl:copy-of select="$bwStr-CuCa-Description"/></th>
665           <td>
666             <textarea name="calendar.description" cols="40" rows="4">
667               <xsl:value-of select="desc"/>
668               <xsl:if test="normalize-space(desc) = ''">
669                 <xsl:text> </xsl:text>
670                 <!-- keep this non-breaking space to avoid browser
671                 rendering errors when the text area is empty -->
672               </xsl:if>
673             </textarea>
674           </td>
675         </tr>
676         <!-- xsl:if test="isSubscription='false'" -->
677           <!-- we can't color subscriptions yet -->
678           <tr>
679             <th><xsl:copy-of select="$bwStr-CuCa-Color"/></th>
680             <td>
681               <input type="text" name="calendar.color" id="bwCalColor" size="7">
682                 <xsl:attribute name="value"><xsl:value-of select="color"/></xsl:attribute>
683                 <xsl:attribute name="style">background-color: <xsl:value-of select="color"/>;color: black;</xsl:attribute>
684               </input>
685               <xsl:call-template name="colorPicker">
686                 <xsl:with-param name="colorFieldId">bwCalColor</xsl:with-param>
687                 <xsl:with-param name="colorValue"><xsl:value-of select="color"/></xsl:with-param>
688               </xsl:call-template>
689             </td>
690           </tr>
691         <!-- /xsl:if -->
692         <tr>
693           <th><xsl:copy-of select="$bwStr-CuCa-Display"/></th>
694           <td>
695             <input type="hidden" name="calendar.display">
696               <xsl:attribute name="value"><xsl:value-of select="display"/></xsl:attribute>
697             </input>
698             <input type="checkbox" name="displayHolder" size="40" onclick="setCalDisplayFlag(this.form['calendar.display'],this.checked)">
699               <xsl:if test="display = 'true'">
700                 <xsl:attribute name="checked">checked</xsl:attribute>
701               </xsl:if>
702             </input><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-CuCa-DisplayItemsInThisCollection"/>
703           </td>
704         </tr>
705         <tr>
706           <xsl:attribute name="class">disabled</xsl:attribute>
707           <th><xsl:copy-of select="$bwStr-CuCa-Disabled"/></th>
708           <td>
709             <input type="radio" name="calendar.disabled" value="false">
710               <xsl:if test="disabled = 'false'">
711                 <xsl:attribute name="checked">checked</xsl:attribute>
712               </xsl:if>
713             </input>
714             <xsl:copy-of select="$bwStr-CuCa-EnabledLabel"/>
715             <input type="radio" name="calendar.disabled" value="true">
716               <xsl:if test="disabled = 'true'">
717                 <xsl:attribute name="checked">checked</xsl:attribute>
718               </xsl:if>
719             </input>
720             <xsl:copy-of select="$bwStr-CuCa-DisabledLabel"/>
721             <xsl:if test="disabled = 'true'">
722               <span class="disabledNote">
723                 <xsl:copy-of select="$bwStr-CuCa-ThisItemIsInaccessible"/>
724               </span>
725             </xsl:if>
726           </td>
727         </tr>
728         <tr>
729           <th><xsl:copy-of select="$bwStr-CuCa-FilterExpression"/></th>
730           <td>
731             <input type="text" name="fexpr" value="" size="40">
732               <xsl:attribute name="value"><xsl:value-of select="filterExpr"/></xsl:attribute>
733             </input>
734           </td>
735         </tr>
736         <xsl:if test="isSubscription = 'true'">
737           <tr>
738             <th><xsl:copy-of select="$bwStr-CuCa-URL"/></th>
739             <td>
740               <input name="aliasUri" value="" size="40">
741                 <xsl:attribute name="value"><xsl:value-of select="aliasUri"/></xsl:attribute>
742               </input>
743             </td>
744           </tr>
745           <xsl:if test="externalSub = 'true'">
746             <tr>
747               <th><xsl:copy-of select="$bwStr-CuCa-ID"/></th>
748               <td>
749                 <input name="remoteId" value="" size="40"/>
750               </td>
751             </tr>
752             <tr>
753               <th><xsl:copy-of select="$bwStr-CuCa-Password"/></th>
754               <td>
755                 <input type="password" name="remotePw" value="" size="40"/>
756               </td>
757             </tr>
758           </xsl:if>
759         </xsl:if>
760       </table>
761
762       <div id="sharingBox">
763         <h3><xsl:copy-of select="$bwStr-CuCa-CurrentAccess"/></h3>
764         <div id="bwCurrentAccessWidget">&#160;</div>
765         <script type="text/javascript">
766           bwAcl.display("bwCurrentAccessWidget");
767         </script>
768         <xsl:call-template name="entityAccessForm">
769           <xsl:with-param name="outputId">bwCurrentAccessWidget</xsl:with-param>
770         </xsl:call-template>
771       </div>
772
773       <div class="note">
774         <xsl:copy-of select="$bwStr-CuCa-AccessNote"/>
775       </div>
776
777       <table border="0" id="submitTable">
778         <tr>
779           <td>
780             <xsl:choose>
781               <xsl:when test="isSubscription='true'">
782                 <input type="submit" name="updateCalendar" value="{$bwStr-CuCa-UpdateSubscription}"/>
783               </xsl:when>
784               <xsl:when test="calType = '0'">
785                 <input type="submit" name="updateCalendar" value="{$bwStr-CuCa-UpdateFolder}"/>
786               </xsl:when>
787               <xsl:otherwise>
788                 <input type="submit" name="updateCalendar" value="{$bwStr-CuCa-UpdateCalendar}"/>
789               </xsl:otherwise>
790             </xsl:choose>
791             <input type="submit" name="cancelled" value="{$bwStr-CuCa-Cancel}"/>
792           </td>
793           <td align="right">
794             <xsl:if test="calType != '3' and calType != '5' and calType != '6'">
795               <xsl:choose>
796                 <xsl:when test="isSubscription='true'">
797                   <input type="submit" name="delete" value="{$bwStr-CuCa-DeleteSubscription}"/>
798                 </xsl:when>
799                 <xsl:when test="calType = '0'">
800                   <input type="submit" name="delete" value="{$bwStr-CuCa-DeleteFolder}"/>
801                 </xsl:when>
802                 <xsl:otherwise>
803                   <input type="submit" name="delete" value="{$bwStr-CuCa-DeleteCalendar}"/>
804                 </xsl:otherwise>
805               </xsl:choose>
806             </xsl:if>
807           </td>
808         </tr>
809       </table>
810     </form>
811     <!-- Method 1 access setting is now deprecated.
812          see the "entityAccessForm" template for more information -->
813     <!--  div id="sharingBox">
814       <xsl:apply-templates select="acl" mode="currentAccess">
815         <xsl:with-param name="action" select="$calendar-setAccess"/>
816         <xsl:with-param name="calPathEncoded" select="$calPathEncoded"/>
817       </xsl:apply-templates>
818       <form name="calendarShareForm" method="post" action="{$calendar-setAccess}" id="shareForm" onsubmit="setAccessHow(this)">
819         <input type="hidden" name="calPath" value="{$calPath}"/>
820         <xsl:call-template name="entityAccessForm">
821           <xsl:with-param name="type">
822             <xsl:choose>
823               <xsl:when test="calType = '5'">inbox</xsl:when>
824               <xsl:when test="calType = '6'">outbox</xsl:when>
825               <xsl:otherwise>normal</xsl:otherwise>
826             </xsl:choose>
827           </xsl:with-param>
828         </xsl:call-template>
829       </form>
830     </div -->
831   </xsl:template>
832
833   <xsl:template name="colorPicker">
834     <xsl:param name="colorFieldId"/><!-- required: id of text field to be updated -->
835     <button type="button" id="bwColorPickerButton" value="{$bwStr-CoPi-Pick}"><img src="{$resourcesRoot}/images/colorIcon.gif" width="16" height="13" alt="pick a color"/></button>
836     <script type="text/javascript">
837       $(document).ready(function() {
838         $('#bwColorPickerButton').ColorPicker({
839                                   onSubmit: function(hsb, hex, rgb, el) {
840               var fullHex = "#" + hex;
841               $('#<xsl:value-of select="$colorFieldId"/>').val(fullHex);
842               $('#<xsl:value-of select="$colorFieldId"/>').css('background-color',fullHex);
843               $(el).ColorPickerHide();
844             },
845             onBeforeShow: function () {
846               var curColor = $('#<xsl:value-of select="$colorFieldId"/>').val();
847               $(this).ColorPickerSetColor(curColor);
848             }
849                                 });
850       });
851     </script>
852   </xsl:template>
853
854   <xsl:template name="calendarList">
855     <h3><xsl:copy-of select="$bwStr-CaLi-ManagingCalendars"/></h3>
856     <ul>
857       <li><xsl:copy-of select="$bwStr-CaLi-SelectFromCalendar"/><xsl:text> </xsl:text>(<img src="{$resourcesRoot}/images/calIcon-sm.gif" width="13" height="13" alt="true" border="0"/>),
858       <xsl:copy-of select="$bwStr-CaLi-Subscription"/><xsl:text> </xsl:text>(<img src="{$resourcesRoot}/images/calIconAlias2-sm.gif" width="17" height="13" alt="true" border="0"/>)<xsl:copy-of select="$bwStr-CaLi-OrFolder"/><xsl:text> </xsl:text>(<img src="{$resourcesRoot}/images/catIcon.gif" width="13" height="13" alt="true" border="0"/>).</li>
859       <li><xsl:copy-of select="$bwStr-CaLi-Select"/><xsl:text> </xsl:text>
860       <img src="{$resourcesRoot}/images/calAddIcon.gif" width="13" height="13" alt="true" border="0"/>
861       <xsl:text> </xsl:text><xsl:copy-of select="$bwStr-CaLi-Icon"/>
862         <ul>
863           <li><xsl:copy-of select="$bwStr-CaLi-Folders"/></li>
864           <li><xsl:copy-of select="$bwStr-CaLi-Calendars"/></li>
865         </ul>
866       </li>
867     </ul>
868   </xsl:template>
869
870   <xsl:template name="calendarDescriptions">
871     <h2><xsl:copy-of select="$bwStr-CaDe-CalInfo"/></h2>
872     <ul>
873       <li><xsl:copy-of select="$bwStr-CaDe-SelectAnItem"/></li>
874     </ul>
875
876     <p><strong><xsl:copy-of select="$bwStr-CaDe-AllCalDescriptions"/></strong></p>
877     <table id="flatCalendarDescriptions" cellspacing="0">
878       <tr>
879         <th><xsl:copy-of select="$bwStr-CaDe-Name"/></th>
880         <th><xsl:copy-of select="$bwStr-CaDe-Description"/></th>
881       </tr>
882       <xsl:for-each select="//calendar[calType &lt; 2]">
883         <xsl:variable name="descClass">
884           <xsl:choose>
885             <xsl:when test="position() mod 2 = 0">even</xsl:when>
886             <xsl:otherwise>odd</xsl:otherwise>
887           </xsl:choose>
888         </xsl:variable>
889         <tr class="{$descClass}">
890           <td>
891             <xsl:value-of select="summary"/>
892           </td>
893           <td>
894             <xsl:value-of select="desc"/>
895           </td>
896         </tr>
897       </xsl:for-each>
898     </table>
899   </xsl:template>
900
901   <xsl:template match="currentCalendar" mode="displayCalendar">
902     <h2><xsl:copy-of select="$bwStr-CuCa-CalendarInformation"/></h2>
903     <table class="common">
904       <tr>
905         <th><xsl:copy-of select="$bwStr-CuCa-Name"/></th>
906         <td>
907           <xsl:value-of select="name"/>
908         </td>
909       </tr>
910       <tr>
911         <th><xsl:copy-of select="$bwStr-CuCa-Path"/></th>
912         <td>
913           <xsl:value-of select="path"/>
914         </td>
915       </tr>
916       <tr>
917         <th><xsl:copy-of select="$bwStr-CuCa-Summary"/></th>
918         <td>
919           <xsl:value-of select="summary"/>
920         </td>
921       </tr>
922       <tr>
923         <th><xsl:copy-of select="$bwStr-CuCa-Description"/></th>
924         <td>
925           <xsl:value-of select="desc"/>
926         </td>
927       </tr>
928     </table>
929   </xsl:template>
930
931   <xsl:template match="currentCalendar" mode="deleteCalendarConfirm">
932     <xsl:choose>
933       <xsl:when test="calType = '0'">
934         <h3><xsl:copy-of select="$bwStr-CuCa-DeleteFolder"/></h3>
935         <p>
936           <xsl:copy-of select="$bwStr-CuCa-TheFollowingFolder"/>
937         </p>
938       </xsl:when>
939       <xsl:otherwise>
940         <h3><xsl:copy-of select="$bwStr-CuCa-DeleteCalendar"/></h3>
941         <p>
942           <xsl:copy-of select="$bwStr-CuCa-TheFollowingCalendar"/>
943         </p>
944       </xsl:otherwise>
945     </xsl:choose>
946
947     <form name="delCalForm" method="post" action="{$calendar-delete}">
948       <input type="hidden" name="deleteContent" value="true"/>
949       <table class="common">
950         <tr>
951           <th><xsl:copy-of select="$bwStr-CuCa-Path"/></th>
952           <td>
953             <xsl:value-of select="path"/>
954           </td>
955         </tr>
956         <tr>
957           <th><xsl:copy-of select="$bwStr-CuCa-Name"/></th>
958           <td>
959             <xsl:value-of select="name"/>
960           </td>
961         </tr>
962         <tr>
963           <th><xsl:copy-of select="$bwStr-CuCa-Summary"/></th>
964           <td>
965             <xsl:value-of select="summary"/>
966           </td>
967         </tr>
968         <tr>
969           <th><xsl:copy-of select="$bwStr-CuCa-Description"/></th>
970           <td>
971             <xsl:value-of select="desc"/>
972           </td>
973         </tr>
974       </table>
975
976       <table border="0" id="submitTable">
977         <tr>
978           <td>
979             <input type="submit" name="cancelled" value="{$bwStr-CuCa-Cancel}"/>
980           </td>
981           <td align="right">
982             <xsl:choose>
983               <xsl:when test="calType = '0'">
984                 <input type="submit" name="delete" value="{$bwStr-CuCa-YesDeleteFolder}"/>
985               </xsl:when>
986               <xsl:otherwise>
987                 <input type="submit" name="delete" value="{$bwStr-CuCa-YesDeleteCalendar}"/>
988               </xsl:otherwise>
989             </xsl:choose>
990           </td>
991         </tr>
992       </table>
993     </form>
994
995   </xsl:template>
996
997   <xsl:template match="calendars" mode="exportCalendars">
998     <h2><xsl:copy-of select="$bwStr-Cals-ExportCals"/></h2>
999     <form name="eventForm" id="exportCalendarForm" action="{$export}" method="post">
1000       <input type="hidden" name="calPath" value=""/>
1001       <input type="hidden" name="nocache" value="no"/>
1002       <input type="hidden" name="contentName" value="calendar.ics"/>
1003
1004       <table class="common" cellspacing="0">
1005         <tr>
1006           <th class="commonHeader">
1007               <xsl:copy-of select="$bwStr-Cals-EventDateLimits"/>
1008               <input type="radio" name="dateLimits" value="active" checked="checked" onclick="changeClass('exportDateRange','invisible')"/> <xsl:copy-of select="$bwStr-Cals-TodayForward"/>
1009               <input type="radio" name="dateLimits" value="none" onclick="changeClass('exportDateRange','invisible')"/> <xsl:copy-of select="$bwStr-Cals-AllDates"/>
1010               <input type="radio" name="dateLimits" value="limited" onclick="changeClass('exportDateRange','visible')"/> <xsl:copy-of select="$bwStr-Cals-DateRange"/>
1011           </th>
1012         </tr>
1013         <tr id="exportDateRange" class="invisible">
1014           <td class="dates">
1015             <xsl:copy-of select="$bwStr-Cals-Start"/>
1016             <div class="dateFields">
1017               <xsl:copy-of select="/bedework/formElements/form/start/month/*"/>
1018               <xsl:copy-of select="/bedework/formElements/form/start/day/*"/>
1019               <xsl:copy-of select="/bedework/formElements/form/start/yearText/*"/>
1020             </div>
1021             &#160;&#160;
1022             <xsl:copy-of select="$bwStr-Cals-End"/>
1023             <div class="dateFields">
1024               <xsl:copy-of select="/bedework/formElements/form/end/month/*"/>
1025               <xsl:copy-of select="/bedework/formElements/form/end/day/*"/>
1026               <xsl:copy-of select="/bedework/formElements/form/end/yearText/*"/>
1027             </div>
1028           </td>
1029         </tr>
1030         <tr>
1031           <th class="borderRight">
1032             <xsl:copy-of select="$bwStr-Cals-MyCalendars"/>
1033           </th>
1034         </tr>
1035         <tr>
1036           <td class="borderRight">
1037             <!-- My Calendars -->
1038             <ul class="calendarTree">
1039               <!-- list normal calendars first -->
1040               <xsl:for-each select="/bedework/myCalendars/calendars/calendar//calendar[calType = '1']">
1041                 <li class="calendar">
1042                   <xsl:variable name="calPath" select="path"/>
1043                   <xsl:variable name="name" select="name"/>
1044                   <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')">
1045                     <xsl:value-of select="summary"/>
1046                   </a>
1047                 </li>
1048               </xsl:for-each>
1049             </ul>
1050             <ul class="calendarTree">
1051               <!-- list special calendars next -->
1052               <xsl:for-each select="/bedework/myCalendars/calendars/calendar//calendar[calType &gt; 1]">
1053                 <li class="calendar">
1054                   <xsl:variable name="calPath" select="path"/>
1055                   <xsl:variable name="name" select="name"/>
1056                   <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')">
1057                     <xsl:value-of select="summary"/>
1058                   </a>
1059                 </li>
1060               </xsl:for-each>
1061             </ul>
1062           </td>
1063           <!-- td>
1064             <ul class="calendarTree">
1065               <xsl:apply-templates select="./calendar" mode="buildExportTree"/>
1066             </ul>
1067           </td-->
1068         </tr>
1069       </table>
1070     </form>
1071   </xsl:template>
1072
1073   <xsl:template match="calendar" mode="buildExportTree">
1074     <xsl:choose>
1075       <xsl:when test="calType = '0'">
1076         <li class="folder">
1077           <xsl:value-of select="summary"/>
1078           <xsl:if test="calendar">
1079             <ul>
1080               <xsl:apply-templates select="calendar" mode="buildExportTree"/>
1081             </ul>
1082           </xsl:if>
1083         </li>
1084       </xsl:when>
1085       <xsl:otherwise>
1086         <li class="calendar">
1087           <xsl:variable name="calPath" select="path"/>
1088           <xsl:variable name="name" select="name"/>
1089           <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')">
1090             <xsl:value-of select="summary"/>
1091           </a>
1092         </li>
1093       </xsl:otherwise>
1094     </xsl:choose>
1095   </xsl:template>
1096  
1097  
1098 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.