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