| 1 | <?xml version='1.0'?> |
|---|
| 2 | <!-- |
|---|
| 3 | |
|---|
| 4 | This file is part of CDS Indico. |
|---|
| 5 | Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. |
|---|
| 6 | |
|---|
| 7 | CDS Indico is free software; you can redistribute it and/or |
|---|
| 8 | modify it under the terms of the GNU General Public License as |
|---|
| 9 | published by the Free Software Foundation; either version 2 of the |
|---|
| 10 | License, or (at your option) any later version. |
|---|
| 11 | |
|---|
| 12 | CDS Indico is distributed in the hope that it will be useful, but |
|---|
| 13 | WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 15 | General Public License for more details. |
|---|
| 16 | |
|---|
| 17 | You should have received a copy of the GNU General Public License |
|---|
| 18 | along with CDS Indico; if not, write to the Free Software Foundation, Inc., |
|---|
| 19 | 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 20 | --> |
|---|
| 21 | |
|---|
| 22 | <xsl:stylesheet version='1.0' |
|---|
| 23 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|---|
| 24 | |
|---|
| 25 | <xsl:template match="repno"> |
|---|
| 26 | <xsl:value-of select="./rn" disable-output-escaping="yes"/> |
|---|
| 27 | </xsl:template> |
|---|
| 28 | |
|---|
| 29 | <xsl:variable name="closed" select="/iconf/closed"/> |
|---|
| 30 | |
|---|
| 31 | <xsl:template name="displayModifIcons"> |
|---|
| 32 | <xsl:param name="item"/> |
|---|
| 33 | <xsl:param name="confId"/> |
|---|
| 34 | <xsl:param name="sessId"/> |
|---|
| 35 | <xsl:param name="sessCode"/> |
|---|
| 36 | <xsl:param name="contId"/> |
|---|
| 37 | <xsl:param name="subContId"/> |
|---|
| 38 | <xsl:param name="uploadURL"/> |
|---|
| 39 | <xsl:param name="manageLink"/> |
|---|
| 40 | <xsl:param name="manageLinkBgColor">#ECECEC</xsl:param> |
|---|
| 41 | <!-- |
|---|
| 42 | If true the menu is aligned to the right with respect |
|---|
| 43 | to the popup menu arrow. |
|---|
| 44 | --> |
|---|
| 45 | <xsl:param name="alignMenuRight">false</xsl:param> |
|---|
| 46 | <xsl:variable name="menuName">menu<xsl:value-of select="$confId"/><xsl:value-of select="translate($sessCode, '-','')"/><xsl:value-of select="$contId"/><xsl:value-of select="$subContId"/></xsl:variable> |
|---|
| 47 | <xsl:if test="$closed = 'False' and ($item/modifyLink != '' or $item/materialLink != '' or $item/minutesLink != '')"> |
|---|
| 48 | <!-- script that creates a variable for a menu --> |
|---|
| 49 | |
|---|
| 50 | <xsl:choose> |
|---|
| 51 | <xsl:when test="$manageLink != ''"> |
|---|
| 52 | <xsl:text disable-output-escaping="yes"><![CDATA[<div class="manageLink" style="background: ]]></xsl:text> |
|---|
| 53 | <xsl:value-of select="$manageLinkBgColor"/> |
|---|
| 54 | <xsl:text disable-output-escaping="yes"><![CDATA[;">]]></xsl:text> |
|---|
| 55 | <xsl:text disable-output-escaping="yes"><![CDATA[<div class="dropDownMenu fakeLink" id="]]></xsl:text> |
|---|
| 56 | <xsl:value-of select="$menuName"/> |
|---|
| 57 | <xsl:text disable-output-escaping="yes"><![CDATA[">Manage</div></div>]]></xsl:text> |
|---|
| 58 | </xsl:when> |
|---|
| 59 | <xsl:otherwise> |
|---|
| 60 | <xsl:text disable-output-escaping="yes"><![CDATA[<span class="confModifIcon" id="]]></xsl:text> |
|---|
| 61 | <xsl:value-of select="$menuName"/> |
|---|
| 62 | <xsl:text disable-output-escaping="yes"><![CDATA["></span>]]></xsl:text> |
|---|
| 63 | </xsl:otherwise> |
|---|
| 64 | </xsl:choose> |
|---|
| 65 | |
|---|
| 66 | <xsl:text disable-output-escaping="yes"> |
|---|
| 67 | <![CDATA[<script type="text/javascript"> $E(']]></xsl:text><xsl:value-of select="$menuName"/> |
|---|
| 68 | <xsl:text disable-output-escaping="yes"><![CDATA[').observeClick(function() { |
|---|
| 69 | var element = $E(']]></xsl:text> |
|---|
| 70 | <xsl:value-of select="$menuName"/><xsl:text disable-output-escaping="yes"><![CDATA['); |
|---|
| 71 | ]]></xsl:text> |
|---|
| 72 | <xsl:value-of select="$menuName"/><xsl:text disable-output-escaping="yes"><![CDATA[.open(element.getAbsolutePosition().x]]> |
|---|
| 73 | </xsl:text> |
|---|
| 74 | |
|---|
| 75 | <xsl:if test="$alignMenuRight = 'true'"> |
|---|
| 76 | <xsl:text disable-output-escaping="yes"><![CDATA[+element.dom.offsetWidth+1]]></xsl:text> |
|---|
| 77 | </xsl:if> |
|---|
| 78 | |
|---|
| 79 | <xsl:if test="$manageLink != ''"> |
|---|
| 80 | <xsl:text disable-output-escaping="yes"><![CDATA[+9]]></xsl:text> |
|---|
| 81 | </xsl:if> |
|---|
| 82 | |
|---|
| 83 | <xsl:text disable-output-escaping="yes"><![CDATA[, element.getAbsolutePosition().y+element.dom.offsetHeight);}); |
|---|
| 84 | |
|---|
| 85 | var ]]> |
|---|
| 86 | </xsl:text> |
|---|
| 87 | <xsl:value-of select="$menuName"/> |
|---|
| 88 | <xsl:text disable-output-escaping="yes"> |
|---|
| 89 | <![CDATA[ |
|---|
| 90 | = new PopupMenu({ |
|---|
| 91 | ]]> |
|---|
| 92 | </xsl:text> |
|---|
| 93 | <xsl:choose> |
|---|
| 94 | <xsl:when test="$item/modifyLink != '' and $sessCode = '' and $contId = '' and $subContId = ''"> |
|---|
| 95 | 'Edit event': '<xsl:value-of select="$item/modifyLink"/>', |
|---|
| 96 | </xsl:when> |
|---|
| 97 | <xsl:when test="$item/modifyLink != '' and $subContId != 'null'"> |
|---|
| 98 | 'Edit subcontribution': '<xsl:value-of select="$item/modifyLink"/>', |
|---|
| 99 | </xsl:when> |
|---|
| 100 | <xsl:when test="$item/modifyLink != '' and $contId != 'null'"> |
|---|
| 101 | 'Edit contribution': '<xsl:value-of select="$item/modifyLink"/>', |
|---|
| 102 | </xsl:when> |
|---|
| 103 | <xsl:when test="$item/slotId != 'null' and $item/ID != 'null' and $confId != 'null'"> |
|---|
| 104 | 'Edit session': function(){IndicoUI.Dialogs.__addSessionSlot("<xsl:value-of select="$item/slotId"/>", "<xsl:value-of select="$item/ID"/>","<xsl:value-of select="$confId"/>")}, |
|---|
| 105 | </xsl:when> |
|---|
| 106 | <xsl:when test="$item/modifyLink != ''"> |
|---|
| 107 | 'Edit entry': '<xsl:value-of select="$item/modifyLink"/>', |
|---|
| 108 | </xsl:when> |
|---|
| 109 | </xsl:choose> |
|---|
| 110 | <xsl:if test="$item/cloneLink != ''"> |
|---|
| 111 | 'Clone event': '<xsl:value-of select="$item/cloneLink"/>', |
|---|
| 112 | </xsl:if> |
|---|
| 113 | <xsl:if test="$item/minutesLink != ''"> |
|---|
| 114 | 'Edit minutes': function(m){IndicoUI.Dialogs.writeMinutes('<xsl:value-of select="$confId"/>', |
|---|
| 115 | '<xsl:value-of select="$sessId"/>', |
|---|
| 116 | '<xsl:value-of select="$contId"/>', |
|---|
| 117 | '<xsl:value-of select="$subContId"/>');m.close();return false;}, |
|---|
| 118 | </xsl:if> |
|---|
| 119 | <xsl:if test="$sessCode = '' and $contId = '' and $subContId = ''"> |
|---|
| 120 | 'Compile minutes': function(m){if (confirm('Are you sure you want to compile minutes from all talks in the agenda? This will replace any existing text here.')) { |
|---|
| 121 | IndicoUI.Dialogs.writeMinutes('<xsl:value-of select="$confId"/>', |
|---|
| 122 | '<xsl:value-of select="$sessId"/>', |
|---|
| 123 | '<xsl:value-of select="$contId"/>', |
|---|
| 124 | '<xsl:value-of select="$subContId"/>',true);m.close();}return false;}, |
|---|
| 125 | </xsl:if> |
|---|
| 126 | <xsl:if test="$item/materialLink != ''"> |
|---|
| 127 | 'Manage material': function(m){ |
|---|
| 128 | IndicoUI.Dialogs.Material.editor('<xsl:value-of select="$confId"/>', |
|---|
| 129 | '<xsl:value-of select="$sessId"/>', |
|---|
| 130 | '<xsl:value-of select="$contId"/>', |
|---|
| 131 | '<xsl:value-of select="$subContId"/>', |
|---|
| 132 | <xsl:value-of select="$item/parentProtection"/>, |
|---|
| 133 | <xsl:value-of select="$item/materialList"/>, |
|---|
| 134 | <xsl:value-of select="$uploadURL"/>, |
|---|
| 135 | true); |
|---|
| 136 | |
|---|
| 137 | m.close(); |
|---|
| 138 | return false; |
|---|
| 139 | } |
|---|
| 140 | </xsl:if> |
|---|
| 141 | <xsl:text disable-output-escaping="yes"> |
|---|
| 142 | <![CDATA[ |
|---|
| 143 | },[$E("]]></xsl:text> |
|---|
| 144 | <xsl:value-of select="$menuName"/> |
|---|
| 145 | <xsl:text disable-output-escaping="yes"><![CDATA[")],null, false, ]]></xsl:text> |
|---|
| 146 | <xsl:value-of select="$alignMenuRight"/> |
|---|
| 147 | <xsl:text disable-output-escaping="yes"><![CDATA[);</script>]]></xsl:text> |
|---|
| 148 | </xsl:if> |
|---|
| 149 | |
|---|
| 150 | </xsl:template> |
|---|
| 151 | |
|---|
| 152 | |
|---|
| 153 | |
|---|
| 154 | <xsl:template match="user"> |
|---|
| 155 | <xsl:param name="span" default=""/> |
|---|
| 156 | <span class="{$span}"> |
|---|
| 157 | <xsl:apply-templates select="./name"/> |
|---|
| 158 | <xsl:if test="./organization != ''"> |
|---|
| 159 | <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>(<xsl:value-of select="./organization" disable-output-escaping="yes"/>)</xsl:if> |
|---|
| 160 | </span> |
|---|
| 161 | </xsl:template> |
|---|
| 162 | |
|---|
| 163 | <xsl:template name="fulluser"> |
|---|
| 164 | <xsl:param name="span" default=""/> |
|---|
| 165 | <span class="{$span}"> |
|---|
| 166 | <xsl:apply-templates select="./title"/> |
|---|
| 167 | <xsl:apply-templates select="./name"/> |
|---|
| 168 | <xsl:if test="./organization != ''"> |
|---|
| 169 | <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>(<xsl:value-of select="./organization" disable-output-escaping="yes"/>)</xsl:if> |
|---|
| 170 | </span> |
|---|
| 171 | </xsl:template> |
|---|
| 172 | |
|---|
| 173 | <xsl:template match="title"> |
|---|
| 174 | <xsl:if test=".!=''"> |
|---|
| 175 | <xsl:value-of select="."/> |
|---|
| 176 | <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> |
|---|
| 177 | </xsl:if> |
|---|
| 178 | </xsl:template> |
|---|
| 179 | |
|---|
| 180 | <xsl:template match="VRVS"> |
|---|
| 181 | VRVS <xsl:value-of select="./description"/> |
|---|
| 182 | </xsl:template> |
|---|
| 183 | |
|---|
| 184 | <xsl:template match="HERMES"> |
|---|
| 185 | HERMES <xsl:value-of select="./description"/> |
|---|
| 186 | </xsl:template> |
|---|
| 187 | |
|---|
| 188 | <xsl:template match="EDIAL"> |
|---|
| 189 | eDial <xsl:value-of select="./description"/> |
|---|
| 190 | </xsl:template> |
|---|
| 191 | |
|---|
| 192 | <xsl:template match="name"> |
|---|
| 193 | <xsl:value-of select="./@first" disable-output-escaping="yes"/> |
|---|
| 194 | <xsl:if test="./@first!='' and ./@last!=''"> |
|---|
| 195 | <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> |
|---|
| 196 | </xsl:if> |
|---|
| 197 | <xsl:value-of select="./@last" disable-output-escaping="yes"/> |
|---|
| 198 | </xsl:template> |
|---|
| 199 | |
|---|
| 200 | |
|---|
| 201 | |
|---|
| 202 | <xsl:template match="location"> |
|---|
| 203 | <xsl:param name="span"/> |
|---|
| 204 | <xsl:if test="count(../../location/name)=0 or ../../location/name != ./name"> |
|---|
| 205 | <xsl:value-of select="./name"/> |
|---|
| 206 | <xsl:if test="./name != '' and ./room != '0--' and ./room != 'Select:' and ./room != ''"> |
|---|
| 207 | ( |
|---|
| 208 | </xsl:if> |
|---|
| 209 | </xsl:if> |
|---|
| 210 | <xsl:if test="./room != '0--' and ./room != 'Select:' and ./room != ''"> |
|---|
| 211 | <xsl:if test="./roomMapURL != ''"> |
|---|
| 212 | <xsl:text disable-output-escaping="yes"> |
|---|
| 213 | <a href=" |
|---|
| 214 | </xsl:text> |
|---|
| 215 | <xsl:value-of select="./roomMapURL" disable-output-escaping="yes"/> |
|---|
| 216 | <xsl:text disable-output-escaping="yes"> |
|---|
| 217 | "> |
|---|
| 218 | </xsl:text> |
|---|
| 219 | </xsl:if> |
|---|
| 220 | <span class="{$span}"> |
|---|
| 221 | <xsl:value-of select="./room" disable-output-escaping="yes"/> |
|---|
| 222 | </span> |
|---|
| 223 | <xsl:text disable-output-escaping="yes"> |
|---|
| 224 | </a> |
|---|
| 225 | </xsl:text> |
|---|
| 226 | <xsl:if test="count(../../location/name)=0 or ../../location/name != ./name"> |
|---|
| 227 | <xsl:if test="./name != '' and ./room != '0--' and ./room != 'Select:' and ./room != ''"> |
|---|
| 228 | ) |
|---|
| 229 | </xsl:if> |
|---|
| 230 | </xsl:if> |
|---|
| 231 | </xsl:if> |
|---|
| 232 | </xsl:template> |
|---|
| 233 | |
|---|
| 234 | <xsl:template match="supportEmail"> |
|---|
| 235 | <a href="mailto:{.}"> |
|---|
| 236 | <xsl:value-of select="."/> |
|---|
| 237 | </a> |
|---|
| 238 | </xsl:template> |
|---|
| 239 | |
|---|
| 240 | <xsl:template match="materialLink"> |
|---|
| 241 | <xsl:param name="fileType"/> |
|---|
| 242 | <xsl:param name="imgURL"/> |
|---|
| 243 | <xsl:param name="imgAlt"/> |
|---|
| 244 | |
|---|
| 245 | <xsl:if test="count(./files/file[type='$fileType']) = 1"> |
|---|
| 246 | <a href="{./files/file[type='$fileType'][1]/url}" class="material"><img src="{$imgURL}" border="0" alt="{$imgAlt}"/></a> |
|---|
| 247 | </xsl:if> |
|---|
| 248 | |
|---|
| 249 | <xsl:if test="count(./files/file[type='$fileType']) > 1"> |
|---|
| 250 | <xsl:variable name="materialMenuName">materialMenu<xsl:value-of select="./type"/><xsl:value-of select="$fileType"/><xsl:value-of select="$sessionId"/><xsl:value-of select="$contribId"/><xsl:value-of select="$subContId"/></xsl:variable> |
|---|
| 251 | <a class="material"> |
|---|
| 252 | <div class="dropDownMaterialMenu" id="{$materialMenuName}"> |
|---|
| 253 | <img src="{$imgURL}" border="0" alt="{$imgAlt}"/> |
|---|
| 254 | <!-- <img src="images/pdf_small.png" border="0" alt="pdf file"/>--> |
|---|
| 255 | </div> |
|---|
| 256 | </a> |
|---|
| 257 | <script type="text/javascript"> |
|---|
| 258 | $E('<xsl:value-of select="$materialMenuName"/>').observeClick(function() { |
|---|
| 259 | var elem = $E('<xsl:value-of select="$materialMenuName"/>'); |
|---|
| 260 | var parentElem = $E(elem.dom.parentNode); |
|---|
| 261 | <xsl:value-of select="$materialMenuName"/>.open(parentElem.getAbsolutePosition().x, parentElem.getAbsolutePosition().y + parentElem.dom.offsetHeight); |
|---|
| 262 | } |
|---|
| 263 | ); |
|---|
| 264 | |
|---|
| 265 | var <xsl:value-of select="$materialMenuName"/> = new PopupMenu({ |
|---|
| 266 | <xsl:for-each select="./files/file[type='$fileType']"> |
|---|
| 267 | '<xsl:value-of select="./name"/>':'<xsl:value-of select="./url"/>' |
|---|
| 268 | <xsl:if test="position() != last()"> |
|---|
| 269 | , |
|---|
| 270 | </xsl:if> |
|---|
| 271 | </xsl:for-each> |
|---|
| 272 | }, [$E("<xsl:value-of select="$materialMenuName"/>")], 'materialMenuPopupList', false, false); |
|---|
| 273 | </script> |
|---|
| 274 | </xsl:if> |
|---|
| 275 | </xsl:template> |
|---|
| 276 | |
|---|
| 277 | <xsl:template match="material"> |
|---|
| 278 | <xsl:param name="sessionId"/> |
|---|
| 279 | <xsl:param name="contribId"/> |
|---|
| 280 | <xsl:param name="subContId"/> |
|---|
| 281 | |
|---|
| 282 | <span class="materialGroup"> |
|---|
| 283 | <a href="{./displayURL}" class="material materialGroup"> |
|---|
| 284 | <xsl:value-of select="./type"/> |
|---|
| 285 | <xsl:value-of select="./title"/> |
|---|
| 286 | <xsl:if test="./locked = 'yes'"> |
|---|
| 287 | <img src="images/protected.png" border="0" alt="locked" style="margin-left: 3px;"/> |
|---|
| 288 | </xsl:if> |
|---|
| 289 | </a> |
|---|
| 290 | |
|---|
| 291 | <xsl:for-each select="./types/type"> |
|---|
| 292 | |
|---|
| 293 | <xsl:variable name="typeName" select="./name"/> |
|---|
| 294 | |
|---|
| 295 | <xsl:if test="count(./../../files/file[type=$typeName]) = 1"> |
|---|
| 296 | <a href="{./../../files/file[type=$typeName][1]/url}" class="material"><img src="{./imgURL}" border="0" alt="{./imgAlt}"/></a> |
|---|
| 297 | </xsl:if> |
|---|
| 298 | |
|---|
| 299 | <xsl:if test="count(./../../files/file[type=$typeName]) > 1"> |
|---|
| 300 | <xsl:variable name="materialMenuName">materialMenu<xsl:value-of select="./../../ID"/><xsl:value-of select="./name"/><xsl:value-of select="$sessionId"/><xsl:value-of select="$contribId"/><xsl:value-of select="$subContId"/></xsl:variable> |
|---|
| 301 | <a class="material dropDownMaterialMenu" id="{$materialMenuName}"> |
|---|
| 302 | <img class="resourceIcon" src="{./imgURL}" border="0" alt="{./imgAlt}"/> |
|---|
| 303 | <img class="arrow" src="images/menu_arrow_black.png" border='0' alt="down arrow"/> |
|---|
| 304 | </a> |
|---|
| 305 | <script type="text/javascript"> |
|---|
| 306 | $E('<xsl:value-of select="$materialMenuName"/>').observeClick(function() { |
|---|
| 307 | var elem = $E('<xsl:value-of select="$materialMenuName"/>'); |
|---|
| 308 | <xsl:value-of select="$materialMenuName"/>.open(elem.getAbsolutePosition().x, elem.getAbsolutePosition().y + elem.dom.offsetHeight); |
|---|
| 309 | } |
|---|
| 310 | ); |
|---|
| 311 | |
|---|
| 312 | var <xsl:value-of select="$materialMenuName"/> = new PopupMenu({ |
|---|
| 313 | <xsl:for-each select="./../../files/file[type=$typeName]"> |
|---|
| 314 | '<xsl:value-of select="./name"/>':'<xsl:value-of select="./url"/>' |
|---|
| 315 | <xsl:if test="position() != last()"> |
|---|
| 316 | , |
|---|
| 317 | </xsl:if> |
|---|
| 318 | </xsl:for-each> |
|---|
| 319 | }, [$E("<xsl:value-of select="$materialMenuName"/>")], 'materialMenuPopupList', false, false); |
|---|
| 320 | </script> |
|---|
| 321 | </xsl:if> |
|---|
| 322 | |
|---|
| 323 | </xsl:for-each> |
|---|
| 324 | </span> |
|---|
| 325 | </xsl:template> |
|---|
| 326 | |
|---|
| 327 | <xsl:template match="description|abstract|minutesText"> |
|---|
| 328 | <xsl:choose> |
|---|
| 329 | <xsl:when test="contains(.,'<p>') or contains(.,'<P>') or contains(.,'<p ') or contains(.,'<P ') or contains(.,'<br>') or contains(.,'<BR>') or contains(.,'<LI>') or contains(.,'<li>')"> |
|---|
| 330 | <xsl:value-of select="." disable-output-escaping="yes"/> |
|---|
| 331 | </xsl:when> |
|---|
| 332 | <xsl:otherwise> |
|---|
| 333 | <pre><xsl:value-of select="." disable-output-escaping="yes"/></pre> |
|---|
| 334 | </xsl:otherwise> |
|---|
| 335 | </xsl:choose> |
|---|
| 336 | </xsl:template> |
|---|
| 337 | |
|---|
| 338 | </xsl:stylesheet> |
|---|