root/trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/calendars.xsl

Revision 2896 (checked in by johnsa, 3 years ago)

user client: completed refactoring for theme

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