Retour

Maison de l'étudiant

Une erreur s'est produite en traitant le calibre.
?index_of(...) expects a string as its first argument.
1<#-- 
2Application display templates can be used to modify the look of a 
3specific application. 
4 
5Please use the left panel to quickly add commonly used variables. 
6Autocomplete is also available and can be invoked by typing "${". 
7--> 
8 
9<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService") /> 
10<#assign classNameLocalService = serviceLocator.findService("com.liferay.portal.service.ClassNameLocalService") /> 
11<#assign assetLinkLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetLinkLocalService") /> 
12<#assign bookmarksEntryLocalService = serviceLocator.findService("com.liferay.portlet.bookmarks.service.BookmarksEntryLocalService") /> 
13<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") /> 
14<#assign journalStructureLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService") /> 
15<#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService") /> 
16 
17<#assign typeJournalArticle = "com.liferay.portlet.journal.model.JournalArticle" /> 
18<#assign typeBookmarksEntry = "com.liferay.portlet.bookmarks.model.BookmarksEntry" /> 
19<#assign typeDLFileEntry = "com.liferay.portlet.documentlibrary.model.DLFileEntry" /> 
20 
21<#assign journalArticle = journalArticleLocalService.getArticle(groupId, .vars['reserved-article-id'].data) /> 
22<#assign entry = assetEntryLocalService.getEntry(typeJournalArticle, journalArticle.getResourcePrimKey()) /> 
23<#assign relatedAssetTypedLists = buildRelatedAssetTypedLists(entry, "false") /> 
24 
25<#assign jaClassNameId = classNameLocalService.getClassNameId(typeJournalArticle) /> 
26 
27<#assign pdfViewer = '/fu/js/pdfjs/web/viewer.html?zoom=page-fit&file=' /> 
28 
29<#assign serviceContextThreadLocal = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"] /> 
30<#assign themeDisplay = serviceContextThreadLocal.getServiceContext().getThemeDisplay() /> 
31 
32<#assign carouselNb = 0 /> 
33 
34<#-- ARTICLE CONTAINER --> 
35 
36<div class="interior-article-container"> 
37     
38    <article class="interior-article interior-article-displayed"> 
39         
40        <section class="interior-article-mainContent"> 
41             
42            <#if relatedAssetTypedLists[typeJournalArticle]?? && relatedAssetTypedLists[typeJournalArticle]?has_content > 
43                <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeJournalArticle structure="CDA_ZOOM_SUR" /> 
44            </#if> 
45             
46            <h2>${.vars['reserved-article-title'].data}</h2> 
47             
48            <#if Accroche.getData() != ""> 
49                <p class="interior-article-chapo">${Accroche.getData()}</p> 
50            </#if> 
51             
52            <#if Contenu.getSiblings()?has_content> 
53                <#list Contenu.getSiblings() as content> 
54                     
55                    <#assign zoomedParagraph = "" /> 
56                    <#assign isZoomed = content.par_zoom.getData() /> 
57                    <#if isZoomed == "true" > 
58                        <#assign zoomedParagraph = "zoomed-paragraph" /> 
59                    </#if> 
60                     
61                    <#assign floatingMedia = "no-floating-media" /> 
62                    <#assign alignValue = "" /> 
63                    <#assign alignValue = content.Media.alignment.getData() /> 
64                    <#if alignValue == "fLeft" || alignValue == "fRight" > 
65                        <#assign floatingMedia = "floating-media" /> 
66                    <#elseif alignValue == "flexLeft" || alignValue == "flexRight"> 
67                        <#assign floatingMedia = "flex-media" /> 
68                    </#if> 
69                     
70                    <#assign contentTitle = content.content_title.getData() /> 
71                     
72                    <#assign mediaSrc = "" /> 
73                    <#assign urlIframePortlet = "" /> 
74                     
75                    <#if content.Media?? && content.Media?has_content > 
76                        <#assign mediaSrc = content.Media.getData()/> 
77                        <#assign urlIframePortlet = content.Media.url_iframe_portlet.getData() /> 
78                    </#if> 
79                     
80                     
81                    <#if contentTitle!="" || content.getData()!="" || mediaSrc!="" || urlIframePortlet !="" > 
82                         
83                        <div class="interior-article-paragraph ${zoomedParagraph} ${floatingMedia}"> 
84                             
85                            <#if content.anchor?has_content> 
86                                <#assign anchor = content.anchor.getData() /> 
87                                <#if anchor != "" > 
88                                    <a id="${anchor}" class="page-anchor"></a> 
89                                </#if> 
90                            </#if> 
91                             
92                            <#if contentTitle != "" > 
93                                <h3>${contentTitle}</h3> 
94                            </#if> 
95                             
96                            <#if floatingMedia == "no-floating-media" > 
97                             
98                                ${content.getData()?replace("<p></p>","")} 
99                                <#if content.Media?? && content.Media?has_content > 
100                                    <@getMedia media=content.Media urlIframePortlet=urlIframePortlet /> 
101                                </#if> 
102                                 
103                            <#elseif floatingMedia == "floating-media"> 
104                             
105                                <#if content.Media?? && content.Media?has_content > 
106                                    <@getMedia media=content.Media urlIframePortlet=urlIframePortlet /> 
107                                </#if> 
108                                ${content.getData()?replace("<p></p>","")} 
109                                <div class="clear-float"></div> 
110                                 
111                             <#elseif floatingMedia == "flex-media"> 
112                              
113                                <div class="flex-display flex-media-paragraph ${alignValue}"> 
114                                    <#if content.Media?? && content.Media?has_content > 
115                                        <@getMedia media=content.Media urlIframePortlet=urlIframePortlet /> 
116                                    </#if> 
117                                    <div class="flex-media-paragraph-content"> 
118                                        ${content.getData()?replace("<p></p>","")} 
119                                    </div> 
120                                </div> 
121                                 
122                            </#if> 
123                             
124                        </div> 
125                         
126                    </#if> 
127 
128                </#list> 
129            </#if> 
130              
131        </section> 
132         
133        <@getCustomRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists /> 
134         
135    </article> 
136     
137    <footer class="interior-article-footer"> 
138        <ul class="interior-article-footer-items-list"> 
139            <li class="interior-article-footer-item interior-article-profile"><a class="inner-link" href="/tableau-de-bord" title="Gérer mon profil">Mon profil</a></li> 
140        <li class="interior-article-footer-item interior-article-rss"><a class="inner-link" href="/les-flux-rss-de-l-agglo">Les flux RSS de l'agglo</a></li> 
141        <li class="interior-article-footer-item interior-article-print"><button type="button" class="inner-link" title="Imprimer">Imprimer</button></li> 
142        <li class="interior-article-footer-item interior-article-mail"><button type="button" class="inner-link" title="Partager par mail">Partager par mail</button></li> 
143        <li class="interior-article-footer-item interior-article-twitter"><button type="button" class="inner-link" title="Partager sur Twitter">Partager sur Twitter</button></li> 
144        <li class="interior-article-footer-item interior-article-facebook"><button type="button" class="inner-link" title="Partager sur Facebook">Partager sur Facebook</button></li> 
145        </ul> 
146    </footer> 
147     
148</div> 
149 
150<#-- FOOTER CONTACT --> 
151 
152<footer class="interior-content-footer interior-content-footer-displayed"> 
153     
154    <#if relatedAssetTypedLists[typeJournalArticle]?? && relatedAssetTypedLists[typeJournalArticle]?has_content > 
155        <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeJournalArticle structure="CDA_CONTACT_SERVICE" /> 
156    <#else> 
157        <@getDefaultFooterContact /> 
158    </#if> 
159 
160</footer> 
161 
162 
163<#--************************************* 
164** MEDIA DISPLAY 
165*************************************--> 
166 
167<#macro getMedia media urlIframePortlet> 
168     
169    <#local mediaSrc = media.getData()/> 
170     
171    <#if mediaSrc != '' || urlIframePortlet != ''> 
172         
173        <#local mediaType = media.media_type.getData() /> 
174        <#assign carouselWrapper = "" /> 
175        <#if mediaType == "carousel"> 
176            <#assign carouselWrapper = "interior-article-media-carousel-wrapper" /> 
177        </#if> 
178        <#local width = media.width.getData() /> 
179        <#local displayWidth = '' /> 
180        <#if width == 'null'> 
181            <#local displayWidth = '' /> 
182        <#elseif width != ""> 
183            <#local displayWidth = 'style="width:'+width+'px;"' /> 
184        </#if> 
185         
186        <#local height = media.height.getData() /> 
187        <#if height == 'null'> 
188            <#local height = '' /> 
189        </#if> 
190        <#local displayMode = media.display_mode.getData() /> 
191        <#local imgMini = media.img_mini.getData() /> 
192        <#local alignment = media.alignment.getData() /> 
193        <#local legend = media.legend.getData() /> 
194        <#local altText = media.alt_text.getData() /> 
195        <#if altText == 'null'> 
196            <#local altText = '' /> 
197        </#if> 
198         
199        <figure class="interior-article-media interior-article-media-${alignment} ${carouselWrapper}" ${displayWidth}> 
200             
201            <#switch mediaType> 
202                <#case "image"> 
203                    <#if displayMode == "normal"> 
204                       <@getImageMedia mediaSrc=mediaSrc urlIframePortlet=urlIframePortlet altText=altText height=height /> 
205                    <#elseif displayMode == "popup"> 
206                        <@getImageMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
207                    </#if> 
208                    <#break > 
209                <#case "video"> 
210                    <#if displayMode == "normal"> 
211                       <@getVideoMedia imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
212                    <#elseif displayMode == "popup"> 
213                        <@getVideoMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
214                    </#if> 
215                    <#break > 
216                <#case "pdf"> 
217                    <#if displayMode == "normal"> 
218                       <@getPdfMedia mediaSrc=mediaSrc height=height /> 
219                    <#elseif displayMode == "popup"> 
220                        <@getPdfMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
221                    </#if> 
222                    <#break > 
223                <#case "iframe"> 
224                    <#if displayMode == "normal"> 
225                       <@getIframeMedia urlIframePortlet=urlIframePortlet height=height /> 
226                    <#elseif displayMode == "popup"> 
227                        <@getIframeMediaPopup imgMini=imgMini urlIframePortlet=urlIframePortlet altText=altText height=height /> 
228                    </#if> 
229                    <#break > 
230                <#case "svg"> 
231                    <#if displayMode == "normal"> 
232                       <@getSvgMedia mediaSrc=mediaSrc height=height /> 
233                    <#elseif displayMode == "popup"> 
234                        <@getSvgMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
235                    </#if> 
236                    <#break > 
237                <#case "flash"> 
238                    <#if displayMode == "normal"> 
239                       <@getFlashMedia mediaSrc=mediaSrc height=height /> 
240                    <#elseif displayMode == "popup"> 
241                        <@getFlashMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
242                    </#if> 
243                    <#break > 
244                <#case "portlet"> 
245                    <#if displayMode == "normal"> 
246                       <@getPortletMedia urlIframePortlet=urlIframePortlet height=height /> 
247                    <#elseif displayMode == "popup"> 
248                        <@getPortletMediaPopup imgMini=imgMini urlIframePortlet=urlIframePortlet altText=altText height=height /> 
249                    </#if> 
250                    <#break > 
251                <#case "flickr"> 
252                    <#if displayMode == "normal"> 
253                       <@getFlickrMedia urlIframePortlet=urlIframePortlet /> 
254                    <#elseif displayMode == "popup"> 
255                        <@getFlickrMediaPopup imgMini=imgMini urlIframePortlet=urlIframePortlet altText=altText height=height /> 
256                    </#if> 
257                    <#break > 
258                <#case "gallery"> 
259                    <#if displayMode == "normal"> 
260                       <@getGalleryMedia mediaSrc=mediaSrc height=height /> 
261                    <#elseif displayMode == "popup"> 
262                        <@getGalleryMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
263                    </#if> 
264                    <#break > 
265                <#case "carousel"> 
266                    <#if displayMode == "normal"> 
267                       <@getCarouselMedia media=media mediaSrc=mediaSrc altText=altText height=height width=width /> 
268                       <#assign carouselNb = carouselNb + 1 /> 
269                    <#elseif displayMode == "popup"> 
270                        <@getCarouselMediaPopup imgMini=imgMini media=media mediaSrc=mediaSrc altText=altText height=height /> 
271                    </#if> 
272                    <#break > 
273                <#case "audio"> 
274                    <@getAudioMedia mediaSrc=mediaSrc altText=altText /> 
275                    <#break > 
276                <#default> 
277            </#switch> 
278             
279            <#local hasLegend = legend?length != 0 /> 
280            <#if hasLegend> 
281                <figcaption class="interior-article-media-legend">${legend}</figcaption> 
282            </#if> 
283             
284        </figure> 
285         
286    </#if> 
287     
288</#macro> 
289 
290 
291<#macro getImageMedia mediaSrc urlIframePortlet altText height > 
292    <#local displayedHeight = '' /> 
293    <#if height != ""> 
294        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
295    </#if> 
296    <#if urlIframePortlet != ""> 
297        <#assign target = "href='"+ urlIframePortlet +"'" /> 
298        <#if !isInternalLink(urlIframePortlet)> 
299            <#assign target = target + " target='_blank' rel='noopener noreferrer'" /> 
300        </#if> 
301        <a ${target}> 
302    </#if> 
303    <img class="interior-article-media-image" src="${mediaSrc}" alt="${altText}" ${displayedHeight} /> 
304    <#if urlIframePortlet != ""> 
305        </a> 
306    </#if> 
307</#macro> 
308 
309 
310<#macro getImageMediaPopup imgMini mediaSrc altText height > 
311    <#local displayedHeight = '' /> 
312    <#if height != ""> 
313        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
314    </#if> 
315    <a class="link-img" href="${mediaSrc}" title="${altText}"> 
316        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
317    </a> 
318</#macro> 
319 
320 
321<#macro getVideoMedia imgMini mediaSrc height altText> 
322    <#local displayedHeight = '' /> 
323    <#if height != ""> 
324        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
325    </#if> 
326    <video class="interior-article-media-video" itemprop="url" poster="${imgMini}" title="${htmlUtil.escapeAttribute(altText)}" alt="${htmlUtil.escapeAttribute(altText)}" controls="" preload="auto" ${displayedHeight} > 
327        <source itemprop="url" content="https://www2.larochelle-technopole.fr${mediaSrc}" src="${mediaSrc}" type="video/mp4"> 
328        <a href="${mediaSrc}" download="">${htmlUtil.escapeAttribute(altText)}</a> 
329    </video> 
330</#macro> 
331 
332 
333<#macro getVideoMediaPopup imgMini mediaSrc altText height > 
334    <#local displayedHeight = '' /> 
335    <#if height != ""> 
336        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
337    </#if> 
338    <a class="link-video" href="${mediaSrc}" title="${altText}"> 
339        <img class="interior-article-media-image" src="/cdalr-new-theme/images/blank.png" data-src="${imgMini}" alt="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} /> 
340    </a> 
341</#macro> 
342 
343 
344<#macro getAudioMedia mediaSrc altText> 
345    <audio class="interior-article-media-audio" title="${htmlUtil.escapeAttribute(altText)}" alt="${htmlUtil.escapeAttribute(altText)}" controls="" > 
346        <source src="${mediaSrc}" type="audio/mpeg"> 
347        <a href="${mediaSrc}" download="">${htmlUtil.escapeAttribute(altText)}</a> 
348    </audio> 
349</#macro> 
350 
351 
352<#macro getPdfMedia mediaSrc altText height > 
353    <#local displayedHeight = '' /> 
354    <#if height != ""> 
355        <#local displayedHeight = 'style="height:'+height+'px;"' /> 
356    </#if> 
357    <iframe class="interior-article-media-iframe" src="${pdfViewer+mediaSrc}" title="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} allowfullscreen ></iframe> 
358</#macro> 
359 
360 
361<#macro getPdfMediaPopup imgMini mediaSrc altText height > 
362    <#local displayedHeight = '' /> 
363    <#if height != ""> 
364        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
365    </#if> 
366    <a class="link-pdf" href="${mediaSrc}"> 
367        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
368    </a> 
369</#macro> 
370 
371 
372<#macro getIframeMedia urlIframePortlet height > 
373    <#local displayedHeight = '' /> 
374    <#if height != ""> 
375        <#local displayedHeight = 'style="height:'+height+'px;"' /> 
376    </#if> 
377    <iframe class="interior-article-media-iframe" src="${urlIframePortlet}" ${displayedHeight} allowfullscreen></iframe> 
378</#macro> 
379 
380 
381<#macro getIframeMediaPopup imgMini urlIframePortlet altText height > 
382    <#local displayedHeight = '' /> 
383    <#if height != ""> 
384        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
385    </#if> 
386    <a class="link-iframe" href="${urlIframePortlet}"> 
387        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
388    </a> 
389</#macro> 
390 
391 
392<#macro getSvgMedia mediaSrc height > 
393 
394</#macro> 
395 
396 
397<#macro getSvgMediaPopup imgMini mediaSrc altText height > 
398 
399</#macro> 
400 
401 
402<#macro getFlashMedia mediaSrc height > 
403    <#local displayedHeight = '' /> 
404    <#if height != ""> 
405        <#local displayedHeight = 'style="height:'+height+'px;"' /> 
406    </#if> 
407    <object class="interior-article-media-object" type="application/x-shockwave-flash"  data="${mediaSrc}" ${displayedHeight}></object>  
408</#macro> 
409 
410 
411<#macro getFlashMediaPopup imgMini mediaSrc altText height > 
412    <#local displayedHeight = '' /> 
413    <#if height != ""> 
414        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
415    </#if> 
416    <a class="link-flash" href="${mediaSrc}"> 
417        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
418    </a> 
419</#macro> 
420 
421 
422<#macro getPortletMedia urlIframePortlet height > 
423     
424    <#local displayedHeight = '' /> 
425    <#if height != ""> 
426        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
427    </#if> 
428     
429    <#local hasInstanceId = urlIframePortlet?contains('INSTANCE') /> 
430    <#local hasQueryString = urlIframePortlet?contains('?') /> 
431    <#local portletId = urlIframePortlet /> 
432    <#local queryString = '' /> 
433     
434    <#if hasInstanceId> 
435        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of(instanceId))] /> 
436    </#if> 
437    <#if hasQueryString> 
438        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of('?')-1)] /> 
439        <#local queryString = urlIframePortlet[(urlIframePortlet?index_of('?')+1)..] /> 
440    </#if> 
441     
442    <#local divId = "embedded-portlet-" + portletId /> 
443    <#local plid = themeDisplay.plid /> 
444     
445    <#if urlIframePortlet?contains('cdalrEService') || urlIframePortlet?contains('cdalrEservice') || urlIframePortlet?contains('cuCreate')> 
446        <#local queryString = queryString +"&p_l_id="+plid+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive" /> 
447     
448        <div id="${divId}" class="embedded-portlet" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="" ${displayedHeight}></div> 
449         
450    <#else> 
451         
452        <#local remoteUrl = "/c/portal/layout?p_l_id="+plid+"&p_p_id="+portletId+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive"+queryString /> 
453         
454        <div id="${divId}" class="embedded-portlet" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="${remoteUrl}" ${displayedHeight}></div> 
455         
456    </#if> 
457     
458</#macro> 
459 
460 
461<#macro getPortletMediaPopup imgMini urlIframePortlet altText height > 
462       
463    <#local divId = "embedded-portlet-" + urlIframePortlet /> 
464     
465    <#local displayedHeight = '' /> 
466    <#if height != ""> 
467        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
468    </#if> 
469     
470    <#local hasInstanceId = urlIframePortlet?contains('INSTANCE') /> 
471    <#local hasQueryString = urlIframePortlet?contains('?') /> 
472    <#local portletId = urlIframePortlet /> 
473    <#local queryString = '' /> 
474 
475    <#if hasInstanceId> 
476        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of(instanceId))] /> 
477    </#if> 
478    <#if hasQueryString> 
479        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of('?')-1)] /> 
480        <#local queryString = urlIframePortlet[(urlIframePortlet?index_of('?')+1)..] /> 
481    </#if> 
482     
483    <#if themeDisplay?? && themeDisplay.plid?? > 
484         
485        <#local plid = themeDisplay.plid /> 
486         
487        <#if urlIframePortlet?contains('cdalrEService') || urlIframePortlet?contains('cdalrEservice') > 
488            <#local queryString = queryString +"&p_l_id="+plid+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive" /> 
489      
490            <#local formTitle = "" /> 
491            <#local formPictoClass = "" /> 
492            <#if urlIframePortlet?contains('FiberOpticalConnectionRequest')> 
493                <#local formTitle = "Demande d'information pour le raccordement à la fibre optique" /> 
494                <#local formPictoClass = "eservice-form-opener-picto-fiber" /> 
495            <#elseif urlIframePortlet?contains('AntContact')> 
496                <#local formTitle = "Contacter l'aménagement numérique du territoire" /> 
497                <#local formPictoClass = "eservice-form-opener-picto-contact" /> 
498            <#elseif urlIframePortlet?contains('ReinscriptionConservatoire')> 
499                <#local formTitle = "Formulaire de réinscription au conservatoire" /> 
500                <#local formPictoClass = "eservice-form-opener-picto-music" /> 
501            <#elseif urlIframePortlet?contains('ContactUs')> 
502                <#local formTitle = "Contacter l'agglo" /> 
503                <#local formPictoClass = "eservice-form-opener-picto-contact" /> 
504            <#elseif urlIframePortlet?contains('JobApplication')> 
505                <#local formTitle = "Postuler à une offre d'emploi" /> 
506                <#local formPictoClass = "eservice-form-opener-picto-job" /> 
507            <#elseif urlIframePortlet?contains('WastebinRepair')> 
508                <#local formTitle = "Demande de nouveau bac ou de réparation" /> 
509                <#local formPictoClass = "eservice-form-opener-picto-wastebin" /> 
510            <#elseif urlIframePortlet?contains('WastewaterConnection')> 
511                <#local formTitle = "Raccorder ou brancher mon installation au réseau d'eaux usées" /> 
512                <#local formPictoClass = "eservice-form-opener-picto-water" /> 
513            <#elseif urlIframePortlet?contains('WastesortingTour')> 
514                <#local formTitle = "Visiter le centre de tri" /> 
515                <#local formPictoClass = "eservice-form-opener-picto-altriane" /> 
516            </#if> 
517             
518            <div class="link-portlet eservice-form-opener" data-divId="${divId}" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="" tabindex="0"> 
519                <div class="eservice-form-opener-picto ${formPictoClass}"></div> 
520                <p class="eservice-form-opener-text">${formTitle}</p> 
521            </div> 
522             
523        <#else> 
524             
525            <#local portletClass = "link-portlet" /> 
526            <#if urlIframePortlet?contains('19_WAR')> 
527                <#local portletClass = "link-portlet planning-cmd-opener" /> 
528            </#if> 
529            <#local remoteUrl = "/c/portal/layout?p_l_id="+plid+"&p_p_id="+portletId+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive"+queryString /> 
530         
531            <div class="${portletClass}" data-divId="${divId}" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="${remoteUrl}" tabindex="0"> 
532                <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
533            </div> 
534         
535        </#if> 
536         
537    </#if> 
538     
539</#macro> 
540 
541 
542<#macro getFlickrMedia urlIframePortlet > 
543    <div class="interior-article-media-flickr" data-embed-flickr='${urlIframePortlet}'></div> 
544</#macro> 
545 
546 
547<#macro getFlickrMediaPopup imgMini urlIframePortlet altText height > 
548    <#local displayedHeight = '' /> 
549    <#if height != ""> 
550        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
551    </#if> 
552    <div class="link-flickr" data-flickr='${urlIframePortlet}' tabindex="0"> 
553        <img class="interior-article-media-image" src="/cdalr-new-theme/images/blank.png" data-src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
554    </div> 
555</#macro> 
556 
557 
558<#macro getGalleryMedia mediaSrc height > 
559 
560</#macro> 
561 
562 
563<#macro getGalleryMediaPopup imgMini mediaSrc altText height > 
564 
565</#macro> 
566 
567 
568<#macro getCarouselMedia media mediaSrc altText height width >  
569     
570    <#local ratioDisplay = "" /> 
571    <#if height != "" && width != "" > 
572        <#local ratio = height?number / width?number * 100 /> 
573        <#local ratioDisplay = 'style="padding-top:' + ratio + '%"' /> 
574    </#if> 
575     
576    <div class="carousel" id="carousel-${carouselNb}" data-carousel="carousel-${carouselNb}" ${ratioDisplay}> 
577         
578        <button type="button" id="carousel-${carouselNb}-arrow-prev" data-carousel="carousel-${carouselNb}" data-direction="prev" class="carousel-arrow carousel-arrow-prev">Image précédente</button> 
579        <button type="button" id="carousel-${carouselNb}-arrow-next" data-carousel="carousel-${carouselNb}" data-direction="next" class="carousel-arrow carousel-arrow-next">Image suivante</button> 
580 
581        <img id="carousel-${carouselNb}-img-0" data-carousel="carousel-${carouselNb}" data-img="0" class="carousel-img carousel-img-displayed" src="/cdalr-new-theme/images/blank.png" data-src="${mediaSrc}" alt="${altText}"> 
582 
583        <#if media.media_more??> 
584            <#list media.media_more.getSiblings() as node> 
585                <img id="carousel-${carouselNb}-img-${node_index+1}" data-carousel="carousel-${carouselNb}" data-img="${node_index+1}" class="carousel-img carousel-img-noDisplay" src="/cdalr-new-theme/images/blank.png" data-src="${node.getData()}" alt="${altText}"> 
586            </#list> 
587        </#if> 
588 
589    </div> 
590 
591</#macro> 
592 
593 
594<#macro getCarouselMediaPopup imgMini media mediaSrc altText height > 
595    <#local diapos = mediaSrc /> 
596    <#if media.media_more??> 
597        <#list media.media_more.getSiblings() as node> 
598            <#if node_index != 0> 
599                <#local diapos = diapos + "," /> 
600            </#if> 
601            <#local diapos = diapos + node.getData() /> 
602        </#list> 
603    </#if> 
604    <#local displayedHeight = '' /> 
605    <#if height != ""> 
606        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
607    </#if> 
608    <a class="link-diapo popup-img-opener" href="${mediaSrc}" title="${htmlUtil.escapeAttribute(altText)}" data-diapos="${diapos}"> 
609        <img class="interior-article-media-image" src="/cdalr-new/images/blank.png" data-src="${imgMini}" alt="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} /> 
610    </a> 
611</#macro> 
612 
613 
614<#--************************************* 
615**  RELATED CONTENT 
616*************************************--> 
617 
618<#function buildRelatedAssetTypedLists entry info > 
619    <#assign relatedAssetTypedLists = {} /> 
620    <#assign infos = "" /> 
621    <#assign assetLinks = assetLinkLocalService.getDirectLinks(entry.getEntryId()) /> 
622 
623    <#list assetLinks as assetLink> 
624        <#if assetLink.getEntryId1() == entry.getEntryId() > 
625            <#assign assetLinkEntry = assetEntryLocalService.getEntry(assetLink.getEntryId2()) /> 
626        <#else> 
627            <#assign assetLinkEntry = assetEntryLocalService.getEntry(assetLink.getEntryId1()) /> 
628        </#if> 
629         
630        <#if assetLinkEntry?? && assetLinkEntry.isVisible() > 
631            <#assign linkedAssetRenderer = assetLinkEntry.getAssetRenderer() /> 
632     
633            <#if linkedAssetRenderer.hasViewPermission(permissionChecker) > 
634             
635                <#assign type = assetLinkEntry.getClassName() /> 
636                 
637                <#assign newEntry = [{"assetEntry":assetLinkEntry,"assetLink":assetLink}] /> 
638                <#if relatedAssetTypedLists?keys?seq_contains(type)> 
639                    <#assign relatedAssetTypedList = relatedAssetTypedLists[type] + newEntry /> 
640                <#else> 
641                    <#assign relatedAssetTypedList = newEntry /> 
642                </#if> 
643                <#assign relatedAssetTypedLists = relatedAssetTypedLists + {type : relatedAssetTypedList} /> 
644                <#-- 
645                <#assign infos> 
646                    ${infos} ${type}=${relatedAssetTypedLists[type]?size}  (${newEntry?first.getClassPK()}) <br/> 
647                </#assign> 
648                --> 
649            </#if> 
650        </#if> 
651    </#list> 
652     
653    <#if info == "true"> 
654        <#return infos /> 
655    <#else> 
656        <#return relatedAssetTypedLists /> 
657    </#if> 
658    <#return {} /> 
659</#function> 
660 
661 
662<#macro getCustomRelatedAssets relatedAssetTypedLists> 
663    <#local hasRelatedAssets = "false" /> 
664    <#if relatedAssetTypedLists[typeBookmarksEntry]?? && relatedAssetTypedLists[typeBookmarksEntry]?size != 0> 
665        <#local hasRelatedAssets = "true" /> 
666    </#if> 
667    <#if relatedAssetTypedLists[typeDLFileEntry]?? && relatedAssetTypedLists[typeDLFileEntry]?size != 0> 
668        <#local hasRelatedAssets = "true" /> 
669    </#if> 
670    <#-- 
671    <#if relatedAssetTypedLists[typeJournalArticle]?? && relatedAssetTypedLists[typeJournalArticle]?has_content > 
672        <#local webContentNb = getRelatedWebContentNb(relatedAssetTypedLists[typeJournalArticle]) /> 
673        <#if webContentNb != 0> 
674            <#local hasRelatedAssets = "true" /> 
675        </#if> 
676    </#if> 
677    --> 
678    <#if hasRelatedAssets == "true" > 
679        <aside class="interior-article-moreContent-container"> 
680            <p class="interior-article-moreContent-title">En savoir plus</p> 
681            <#if relatedAssetTypedLists[typeBookmarksEntry]?? && relatedAssetTypedLists[typeBookmarksEntry]?has_content > 
682                <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeBookmarksEntry structure=""/> 
683            </#if> 
684            <#if relatedAssetTypedLists[typeDLFileEntry]?? && relatedAssetTypedLists[typeDLFileEntry]?has_content > 
685                <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeDLFileEntry structure="" /> 
686            </#if> 
687        </aside> 
688    </#if> 
689</#macro> 
690 
691 
692<#macro getTypedRelatedAssets relatedAssetTypedLists type structure> 
693    <#if type == typeJournalArticle && structure == "CDA_ZOOM_SUR" > 
694        <@getRelatedZoomSur assets=relatedAssetTypedLists[type] /> 
695    <#elseif type == typeJournalArticle && structure == "CDA_CONTACT_SERVICE" > 
696        <@getRelatedFooterContact assets=relatedAssetTypedLists[type] /> 
697    <#elseif type == typeBookmarksEntry > 
698        <@getRelatedPages assets=relatedAssetTypedLists[type] /> 
699    <#elseif type == typeDLFileEntry > 
700        <@getRelatedDocuments assets=relatedAssetTypedLists[type] /> 
701    </#if> 
702</#macro> 
703 
704 
705<#macro getRelatedZoomSur assets> 
706    <#if assets?size != 0> 
707        <#list assets as assetMap> 
708            <#local asset = assetMap.assetEntry /> 
709            <#local article = journalArticleLocalService.getLatestArticle(asset.getClassPK()) /> 
710            <#assign strucName = journalStructureLocalService.getStructure(article.groupId, jaClassNameId, article.structureId?string, true).getName(locale) /> 
711            <#if strucName == 'CDA_ZOOM_SUR'> 
712                <#local img = getField(article,"back_img")/> 
713                <#local url = getField(article,"url_link")/> 
714                <#local target = "href='"+ url +"'" /> 
715                <#if !isInternalLink(url)> 
716                    <#local target = target + " target='_blank' rel='noopener noreferrer'" /> 
717                </#if> 
718                <div class="article-header-alert"> 
719                    <#if url != ""> 
720                        <a class="inner-link" ${target}> 
721                    </#if> 
722                    <img src="${img}" alt="${asset.getTitleCurrentValue()}"/> 
723                    <h3 class="article-header-alert-title">${asset.getTitleCurrentValue()}</h3> 
724                    <#if url != ""> 
725                        </a> 
726                    </#if> 
727                </div> 
728            </#if> 
729        </#list> 
730    </#if> 
731</#macro> 
732 
733<#macro getRelatedFooterContact assets> 
734    <#if assets?size == 0> 
735        <@getDefaultFooterContact /> 
736    <#else> 
737        <#local hasContactFooter = false /> 
738        <#list assets as assetMap> 
739            <#local asset = assetMap.assetEntry /> 
740            <#local article = journalArticleLocalService.getLatestArticle(asset.getClassPK()) /> 
741            <#assign strucName = journalStructureLocalService.getStructure(article.groupId, jaClassNameId, article.structureId?string, true).getName(locale) /> 
742            <#if strucName == 'CDA_CONTACT_SERVICE'> 
743                <#local contact_service = getField(article,"Contact_service")/> 
744                <#local adresse = getField(article,"Adresse")/> 
745                <#local cp = getField(article,"CP")/> 
746                <#local ville = getField(article,"Ville")/> 
747                <#local telephone = getField(article,"Telephone")/> 
748                <#if telephone==""> 
749                    <#local telephone = "05 46 30 34 00" /> 
750                </#if> 
751                <#local courriel = getField(article,"Courriel")/> 
752                <#local annuaire = getField(article,"annuaire_link")/> 
753                <#if annuaire==""> 
754                    <#local annuaire = "/annuaire-des-services"/> 
755                </#if> 
756                <a class="interior-content-footer-contact interior-content-footer-service" href="${annuaire}"> 
757                    Contact<br/> 
758                    ${asset.getTitle(locale)} 
759                </a> 
760                <p class="interior-content-footer-contact interior-content-footer-address"> 
761                    <span class="interior-content-footer-contact-inner">${adresse}<br/>${cp} ${ville}</span> 
762                </p> 
763                <p class="interior-content-footer-contact interior-content-footer-phone"> 
764                    <span class="interior-content-footer-contact-inner">${telephone}</span> 
765                </p> 
766                <a class="interior-content-footer-contact interior-content-footer-email" href="mailto:${courriel}?subject=Contact%20site%20Agglo"> 
767                    <span class="interior-content-footer-contact-inner">Envoyer un courriel</span> 
768                </a> 
769                <a class="interior-content-footer-annuaire" href="${annuaire}">Annuaire des services</a> 
770                <#local hasContactFooter = true /> 
771                <#break /> 
772            </#if> 
773        </#list> 
774        <#if hasContactFooter == false> 
775            <@getDefaultFooterContact /> 
776        </#if> 
777    </#if> 
778</#macro> 
779 
780 
781<#macro getDefaultFooterContact > 
782    <a class="interior-content-footer-contact interior-content-footer-service" href="/annuaire-des-services"> 
783        Contact<br/> 
784        Agglo La Rochelle 
785    </a> 
786    <p class="interior-content-footer-contact interior-content-footer-address"> 
787        <span class="interior-content-footer-contact-inner">6, rue Saint-Michel<br/>17000 La Rochelle</span> 
788    </p> 
789    <p class="interior-content-footer-contact interior-content-footer-phone"> 
790        <span class="interior-content-footer-contact-inner">05 46 30 34 00</span> 
791    </p> 
792    <a class="interior-content-footer-contact interior-content-footer-email" href="/contacter-l-agglo"> 
793        <span class="interior-content-footer-contact-inner">Envoyer un courriel</span> 
794    </a> 
795    <a class="interior-content-footer-annuaire" href="/annuaire-des-services">Annuaire des services</a> 
796</#macro> 
797 
798 
799<#function getRelatedWebContentNb assets> 
800    <#local nb = 0 /> 
801    <#if assets?size != 0> 
802        <#local nb = 0 /> 
803        <#list assets as assetMap> 
804            <#local asset = assetMap.assetEntry /> 
805            <#local article = journalArticleLocalService.getLatestArticle(asset.getClassPK()) /> 
806            <#assign strucName = journalStructureLocalService.getStructure(article.groupId, jaClassNameId, article.structureId?string, true).getName(locale) /> 
807            <#if strucName != 'CDA_CONTACT_SERVICE' && strucName != 'CDA_ZOOM_SUR'> 
808                <#local nb = nb + 1 /> 
809            </#if> 
810        </#list> 
811    </#if> 
812    <#return nb /> 
813</#function> 
814 
815 
816<#macro getRelatedPages assets> 
817    <ul> 
818        <#local orderedAssets = getOrderedAssets(assets) /> 
819        <#list orderedAssets?reverse as assetMap> 
820            <#local asset = assetMap.assetEntry /> 
821            <#local assetLink = assetMap.assetLink /> 
822            <#local linkedAssetRenderer = asset.getAssetRenderer() /> 
823            <#local assetLinkEntryTitle = asset.getTitle(locale) /> 
824            <#local assetLinkEntryDescription = asset.getDescription() /> 
825            <#local assetLinkBookmark = bookmarksEntryLocalService.getEntry(asset.getClassPK()) /> 
826            <#local assetURL = assetLinkBookmark.getUrl() /> 
827             
828            <#local target = "" /> 
829            <#if assetURL?contains('widget') || assetURL?contains('iframe') || assetURL?contains('embed') > 
830                <#local target = " data-iframe='true' href='"+ assetURL +"' class='link-iframe'" /> 
831            <#else> 
832                <#local target = "href='"+ assetURL +"'" /> 
833                <#if !isInternalLink(assetURL)> 
834                    <#local target = target + " target='_blank' rel='noopener noreferrer'" /> 
835                </#if> 
836            </#if> 
837 
838            <li class="interior-article-moreContent" data-entry-id="${asset.getEntryId()}"><a ${target} title="${htmlUtil.escapeAttribute(assetLinkEntryDescription)}">${assetLinkEntryTitle}</a></li> 
839       </#list> 
840   </ul> 
841</#macro> 
842 
843 
844<#macro getRelatedDocuments assets> 
845     
846    <#assign folderNb = 0 /> 
847    <#local orderedAssets = getOrderedAssets(assets) /> 
848    <#local collapsedFolders = false /> 
849     
850    <#list orderedAssets?reverse as assetMap> 
851     
852        <#local asset = assetMap.assetEntry /> 
853        <#local fileEntry = dlFileEntryLocalService.getFileEntry(asset.getClassPK()) /> 
854 
855        <#local documents = dlFileEntryLocalService.getFileEntries(fileEntry.getGroupId(),fileEntry.getFolderId()) /> 
856        <#local folder = fileEntry.getFolder() /> 
857        <#local folderDescription = folder.getDescription()/> 
858        <#if folderDescription != ""> 
859            <#if documents?size &gt; 5> 
860                <#local collapsedFolders = true /> 
861            </#if> 
862        </#if> 
863    </#list> 
864     
865    <#list orderedAssets?reverse as assetMap> 
866     
867        <#local asset = assetMap.assetEntry /> 
868        <#local fileEntry = dlFileEntryLocalService.getFileEntry(asset.getClassPK()) /> 
869 
870        <#local documents = dlFileEntryLocalService.getFileEntries(fileEntry.getGroupId(),fileEntry.getFolderId()) /> 
871        <#local folder = fileEntry.getFolder() /> 
872        <#local folderDescription = folder.getDescription()/> 
873        <#if folderDescription != ""> 
874            <#if collapsedFolders == true> 
875                <input type="checkbox" class="interior-article-moreContent-checkbox" id="interior-article-moreContent-checkbox-${folderNb}" name="interior-article-moreContent-checkbox-${folderNb}"> 
876                <p class="interior-article-moreContent-title"><label for="interior-article-moreContent-checkbox-${folderNb}">${folderDescription}</label></p> 
877                <#assign folderNb = folderNb + 1 /> 
878            <#else> 
879                <p class="interior-article-moreContent-title">${folderDescription}</p> 
880            </#if> 
881        </#if> 
882         
883        <ul class="interior-article-moreContent-list"> 
884            <#local orderedDocs = getOrderedDocs(documents) /> 
885            <#list orderedDocs?reverse as docEntry> 
886                 
887                <#if !docEntry.isInTrash()> 
888                     
889                    <#local assetDocEntry = assetEntryLocalService.getEntry(docEntry.getGroupId(),docEntry.getUuid()) /> 
890                     
891                    <#if assetDocEntry.getAssetRenderer()??> 
892                     
893                        <#local linkedAssetRenderer = assetDocEntry.getAssetRenderer() /> 
894                         
895                        <#local assetLinkEntryTitle = assetDocEntry.getTitle(locale) /> 
896                        <#local assetLinkEntryDescription = assetDocEntry.getDescription(locale) /> 
897                        <#local extension = docEntry.getLatestFileVersion(true).getExtension() /> 
898                         
899                        <#local assetURL = linkedAssetRenderer.getURLDownload(themeDisplay) /> 
900                         
901                        <#local extensionType = "" /> 
902                        <#switch extension> 
903                            <#case "pdf"> 
904                                <#local extensionType = "link-pdf" /> 
905                                <#break> 
906                            <#case "jpg"> 
907                                <#local extensionType = "link-img" /> 
908                                <#break> 
909                            <#case "png"> 
910                                <#local extensionType = "link-img" /> 
911                                <#break> 
912                            <#case "mp4"> 
913                                <#local extensionType = "link-video" /> 
914                                <#break> 
915                            <#case "swf"> 
916                                <#local extensionType = "link-flash" /> 
917                                <#break> 
918                            <#default> 
919                        </#switch> 
920                        <#assign dlFileEntry = docEntry.getLatestFileVersion(true)/> 
921                         
922                        <#local toDownload = "" /> 
923                        <#if assetLinkEntryTitle?contains("- téléchargement")> 
924                            <#local toDownload = "download" /> 
925                            <#if assetURL?contains("?version")> 
926                                <#local assetURL = assetURL + "&download=true" /> 
927                            <#else> 
928                                <#local assetURL = assetURL + "?download=true" /> 
929                            </#if> 
930                        </#if> 
931                         
932                        <#local target = " href='"+ assetURL +"'" /> 
933                         
934                        <li class="interior-article-moreContent" data-entry-id="${asset.entryId}"> 
935                           <a ${target} class="extension-${extension} ${extensionType}" title="${htmlUtil.escapeAttribute(assetLinkEntryDescription)}" ${toDownload} > 
936                                ${assetLinkEntryTitle} <span class="interior-article-moreContent-extension">${extension}</span> 
937                            </a>  
938                        </li> 
939                         
940                    </#if> 
941                     
942                </#if> 
943                 
944            </#list> 
945        </ul> 
946         
947    </#list> 
948     
949</#macro> 
950 
951 
952<#function getOrderedAssets assets> 
953    <#local orderedAssets = [] /> 
954    <#local assetsWithDate = [] /> 
955    <#list assets as assetMap> 
956        <#local asset = assetMap.assetEntry /> 
957        <#local modifiedDate = asset.getModifiedDate() /> 
958        <#local assetsWithDate = assetsWithDate + [{'assetMap':assetMap,'modifiedDate':modifiedDate}] /> 
959    </#list> 
960    <#list assetsWithDate?sort_by('modifiedDate') as orderedAsset> 
961        <#local orderedAssets = orderedAssets + [orderedAsset.assetMap] /> 
962    </#list> 
963    <#return orderedAssets> 
964</#function> 
965 
966<#function getOrderedDocs docs> 
967    <#local orderedDocs = [] /> 
968    <#local docsWithDate = [] /> 
969    <#list docs as docMap> 
970        <#local doc = assetEntryLocalService.getEntry(docMap.getGroupId(),docMap.getUuid()) /> 
971        <#local modifiedDate = doc.getModifiedDate() /> 
972        <#local docsWithDate = docsWithDate + [{'docMap':docMap,'modifiedDate':modifiedDate}] /> 
973    </#list> 
974    <#list docsWithDate?sort_by('modifiedDate') as orderedDoc> 
975        <#local orderedDocs = orderedDocs + [orderedDoc.docMap] /> 
976    </#list> 
977    <#return orderedDocs> 
978</#function> 
979 
980 
981<#function isInternalLink link> 
982  <#local internal = link?contains(".agglo-larochelle.fr") || !link?contains("//")> 
983  <#return internal> 
984</#function> 
985 
986 
987<#function getField journalArticle fieldName> 
988    <#local fieldValue = ''/> 
989     <#local document = saxReaderUtil.read(journalArticle.getContent()) /> 
990     <#local rootElement = document.getRootElement() /> 
991     <#if (rootElement?? && rootElement?has_content)> 
992        <#local xPathSelector =  saxReaderUtil.createXPath("dynamic-element[@name='"+fieldName+"']/dynamic-content") /> 
993        <#if (validator.isNotNull(xPathSelector))> 
994        <#local nbNodes = xPathSelector.selectNodes(rootElement)?size /> 
995        <#if (nbNodes &gt; 0)> 
996            <#local fieldValue = xPathSelector.selectSingleNode(rootElement).getStringValue() /> 
997        </#if> 
998     </#if> 
999     <#return fieldValue /> 
1000     </#if> 
1001</#function>